I\'m looking for a faster way to extract histogram data from an image. I\'m currently using this piece of code that needs about 1200ms for a 6mpx JPEG image:
You can use getSamples(int x, int y, int w, int h, int b, double[] dArray) method It's possible that this method have internal optimisations. Also, you can try to swap width and height.
for (int i = 0; i < width; i++)
for (int j = 0; j < height; j++) {
}
}
And
for (int i = 0; i < height; i++)
for (int j = 0; j < width; j++) {
}
}
Between this two variants performance difference will be huge. This is influence of the cpu cache