The right method to obtain R-G-B intensities of image?

view full story

http://stackoverflow.com – I am using a simple camera app, and obtain the live camera preview to a surfaceView. I turn the camerea on/off using a button. In the button's onClick, after I call camera.startPreview(), I run: camera.setPreviewCallback(new PreviewCallback() { @Override public void onPreviewFrame(byte[] data, Camera camera) { sumRED = 0; sumGREEN = 0; sumBLUE = 0; int frameHeight = camera.getParameters().getPictureSize().height; int frameWidth = camera.getParameters().getPictureSize().width; int[] myPixels = convertYUV420_NV21toRGB8888(data, 200, 200); (HowTos)