Best way to access pixel value from a single channel ? Transform to an array or use existing code ?
This one
Core.extractChannel(mRgba, mR, 0); // for R channel
imageSrc.convertTo(mR, CvType.CV_64FC1);
int size = (int) (mG.total());
double[] dR = new double[size];
mR.get(0, 0, dR);
for (int i = size; i-- > 0;) {
dR[i] = /** do the work */
}
Or accessing pixel value with for x and for y ? ".At" is not possible in java version of OpenCv 2.4.6 Other way (Moster)
width = mR.width(); height = mR.height();
byte[] bR = new byte{size];
for (y= height , y-- >0;) for (x =with, y-- >0;) //Best to work with row 2 Best to decrease counter
bR.get(y, x).val[0} = /** do the work */ } }