You should try this where x and y are the pixel position
int frameHeight = camera.getParameters().getPreviewSize().height; int frameWidth = camera.getParameters().getPreviewSize().width; int rgb[] = new int[frameWidth * frameHeight]; decodeYUV420SP(rgb, data, frameWidth, frameHeight); Bitmap bmp = Bitmap.createBitmap(rgb, frameWidth, frameHeight, Config.ARGB_8888); int pixel = bmp.getPixel( x,y ); int redValue = Color.red(pixel); int blueValue = Color.blue(pixel); int greenValue = Color.green(pixel); int thiscolor = Color.rgb(redValue, greenValue, blueValue);
Satyavrat
source share