image processing - jfeaturelib, java for glcm -
i doing program using jfeaturelib searching glcm features. using haralick.java , run program using demo haralickdemo.java. want know how use horizontal neigbhor 0 degree or 90 degree only. code:
private void calculate() { calculategreyvalues(); final int imagewidth = image.getwidth(); final int imageheight = image.getheight(); final int d = haralick_dist; int i, j, pos; // image not empty per default (int y = 0; y < imageheight; y++) { (int x = 0; x < imagewidth; x++) { pos = imagewidth * y + x; // horizontal neighbor: 0 degrees = x - d; // j = y; if (!(i < 0)) { increment(grayvalue[pos], grayvalue[pos - d]); } // vertical neighbor: 90 degree // = x; j = y - d; if (!(j < 0)) { increment(grayvalue[pos], grayvalue[pos - d * imagewidth]); } // 45 degree diagonal neigbor = x + d; j = y - d; if (i < imagewidth && !(j < 0)) { increment(grayvalue[pos], grayvalue[pos + d - d * imagewidth]); } // 135 vertical neighbor = x - d; j = y - d; if (!(i < 0) && !(j < 0)) { increment(grayvalue[pos], grayvalue[pos - d - d * imagewidth]); } } }
and can explain me detail of haralick.java program?
Comments
Post a Comment