Hi i try to index image by image after downloading from image but Array out of bound Exceptio comes. Please guide me.

131 views
Skip to first unread message

_droid_

unread,
Feb 2, 2012, 8:56:24 AM2/2/12
to lire-dev
Deleting content of: C:\Users\SanjibNarzary\Documents\NetBeansProjects
\CBKD_FINAL\root\frontier
log4j:WARN No appenders could be found for logger
(org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager).
log4j:WARN Please initialize the log4j system properly.
Stored: http://www.nitc.ac.in/app/webroot/img/rightbut_5.jpg
Index Written 579048134c2358295d3266d7cdfa8ccb.jpg
Stored: http://www.nitc.ac.in/app/webroot/img/rightbut_bottom1.jpg
Index Written 58b9cb1ac786709edbb52f7bf3e9cfeb.jpg
Stored: http://www.nitc.ac.in/app/webroot/img/mainbut_5.jpg
Index Written 5281204fafea43c63bf723856d1b60af.jpg
Stored: http://www.nitc.ac.in/app/webroot/img/rightbut_1.jpg
Index Written 33ae084977a574437c6821b89f721bf4.jpg
Stored: http://www.nitc.ac.in/app/webroot/img/rightbut_2.jpg
Index Written 0d35791b34ce15323718e03e4054b70d.jpg
Stored: http://www.nitc.ac.in/res_cons/images/nitc_logo_without_background1.png
java.lang.ArrayIndexOutOfBoundsException: 3
at
java.awt.image.ComponentSampleModel.getPixel(ComponentSampleModel.java:
702)
at java.awt.image.Raster.getPixel(Raster.java:1522)
at
net.semanticmetadata.lire.imageanalysis.mpeg7.ColorLayoutImpl.createShape(Unknown
Source)
at
net.semanticmetadata.lire.imageanalysis.mpeg7.ColorLayoutImpl.extract(Unknown
Source)
at
net.semanticmetadata.lire.imageanalysis.mpeg7.ColorLayoutImpl.init(Unknown
Source)
at
net.semanticmetadata.lire.imageanalysis.mpeg7.ColorLayoutImpl.extract(Unknown
Source)
at
net.semanticmetadata.lire.impl.GenericDocumentBuilder.createDocument(Unknown
Source)
at
net.semanticmetadata.lire.impl.ChainedDocumentBuilder.createDocument(Unknown
Source)
at
net.semanticmetadata.lire.AbstractDocumentBuilder.createDocument(Unknown
Source)
at CreateIndexTest.testCreateIndex(CreateIndexTest.java:31)
at ImageCrawler.visit(ImageCrawler.java:84)
at
edu.uci.ics.crawler4j.crawler.WebCrawler.processPage(WebCrawler.java:
291)
at
edu.uci.ics.crawler4j.crawler.WebCrawler.run(WebCrawler.java:179)
at java.lang.Thread.run(Thread.java:619)


i can index the first 11 images but later it show error.

Mathias Lux

unread,
Feb 4, 2012, 2:24:14 AM2/4/12
to lire...@googlegroups.com
Hi!

Have you checked if the image is diferent to the other ones, e.g.
greyscale, or by being tiny like 2x2 pixels?

cheers,
Mathias

--
Dr. Mathias Lux
Assistant Professor, Klagenfurt University, Austria
http://tinyurl.com/mlux-itec

_droid_

unread,
Feb 9, 2012, 5:33:12 AM2/9/12
to lire-dev
as per as i know the indexing is working when image height is less
than image width, i need to work it for any image, how to fix that.



Thank You.

Mathias Lux

unread,
Feb 11, 2012, 3:29:33 PM2/11/12
to lire...@googlegroups.com

Hi!

This is not a Lire issue testing with the class:


public class Test {

    public static void main(String[] args) throws IOException {

        BufferedImage img = ImageIO.read(new File("C:\\Temp\\nitc_logo_without_background1.png"));

        int[] pixel = new int[3];

        img.getRaster().getPixel(1,1,pixel);

        System.out.println("pixel.length = " + pixel.length);

    }

}


I get the same error

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 3

at java.awt.image.ComponentSampleModel.getPixel(ComponentSampleModel.java:702)

at java.awt.image.Raster.getPixel(Raster.java:1522)

at at.juggle.gdx.Test.main(Test.java:19)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)


Process finished with exit code 1


Java simply can't read the image.


cheers, 

Mathias

sn

unread,
Feb 12, 2012, 5:28:57 AM2/12/12
to lire...@googlegroups.com
ok thank you sir....
--
I am on Twitter. Follow Me @SanjibNarzary


Reply all
Reply to author
Forward
0 new messages