private void calculateGreyValues() { int size = image.getPixelCount(); int gray; for (int pos = 0; pos < size; pos++) { gray = image.get(pos); grayValue[pos] = (byte) (gray / GRAY_SCALE); // quantized for texture analysis grayHistogram[gray]++; } Arrays2.div(grayHistogram, size); }
public Coocurrence(ByteProcessor b, int numGrayValues, int haralickDist) { this.NUM_GRAY_VALUES = numGrayValues; this.image = b; this.GRAY_SCALE = (double) GRAY_RANGES / (double) NUM_GRAY_VALUES; this.cooccurrenceMatrices = new double[NUM_GRAY_VALUES][NUM_GRAY_VALUES]; this.grayValue = new byte[image.getPixelCount()]; this.grayHistogram = new double[GRAY_RANGES]; this.HARALICK_DIST = haralickDist; calculate(); }
public double getCooccurenceSums() { return image.getPixelCount() * 8; }