i am getting grayscale value 0 to 255 .which is 8 bits grayscale image .
int imgwidth = image.getWidth();
int imgheight = image.getHeight();
int minThreshold = 0, maxThreshold = 65535;
//int roiX = p11.x;
// int roiY = p11.y;
int roiX = start.x;
int roiY = start.y;
double hismin = 0.0,hismax = 0.0;
short pixelsum = 0;
int[] histogram = new int[65536];
short[] pixels = new short[imgwidth * imgheight ];
Vector pixelValue = new Vector();
Raster raster = image.getRaster();
for (int y=roiY; y <(roiY+ height1); y++)
{
for (int x=roiX; x < (roiX+width1); x++)
{
pixelsum =(short) raster.getSample(x,y,0);
// short w =(short)(255 - pixelsum);
// pixelValue.add(w);
pixelValue.add(pixelsum);
}
}
Vector pixelMin = new Vector();
for(int i = 0; i < pixelValue.size(); i++)
{
pixels[i] =(Short)pixelValue.elementAt(i);
System.out.println("DIV ddspanel under pixel ...----->"+pixels[i]);
int y = histogram[pixels[i++]&0xffff]++;
// System.out.println("DIV ddspanel Y ...----->"+y);
pixelMin.add(y);
}