public void testExtraction() throws IOException { JpegCoefficientHistogram acc = new JpegCoefficientHistogram(); BufferedImage image = ImageIO.read(new FileInputStream(testFilesPath + testFiles[0])); System.out.println("image = " + image.getWidth() + " x " + image.getHeight()); acc.extract(image); System.out.println("acc = " + acc.getStringRepresentation()); }
public void testPerformance() throws IOException { long ms, sum = 0; for (int i = 0; i < sampleQueries.length; i++) { int id = sampleQueries[i]; System.out.println("id = " + id + ": "); String file = testExtensive + "/" + id + ".jpg"; JpegCoefficientHistogram acc = new JpegCoefficientHistogram(); BufferedImage image = ImageIO.read(new FileInputStream(file)); ms = System.currentTimeMillis(); acc.extract(image); ms = System.currentTimeMillis() - ms; sum += ms; System.out.println( "the same? " + acc.getStringRepresentation().equals(acc.getStringRepresentation())); } System.out.println("time per image = " + sum / sampleQueries.length); System.out.println("sum = " + sum); }