I would like to detect colorcode of image (live stream image) while camera preview is going on. I want to develop sample android application which works like ColorGrab android application. Please find attached screenshot for the same.
How can I make demo program application which capture and recognize colors simply by pointing the camera and show as hexcode of that color.
Any help would be appreciated. Thanks for your time.
Swatches app identifies the colors of whatever your phone camera points to - Curbed.
Picklor: Camera Color Picker is a free application for Android devices that you can make use of to identify any color using the device's built-in camera.
Many of the features Google Lens delivers already exist, but they're tucked inside individual apps. For example, you can install apps on an iPhone or Android device today that use the camera to: Identify colors (Color Name, Color Grab)
https://play.google.com/store/apps/details?id=com.raj.colorwalls
Look at this app url, it should give you some idea. It uses this code:
int frameHeight1 = camera.getParameters().getPreviewSize().height;
int frameWidth1 = camera.getParameters().getPreviewSize().width;
int rgb1[] = new int[frameWidth * frameHeight];
decodeYUV420SP(rgb1, data, frameWidth, frameHeight);
Bitmap bmp1 = Bitmap.createBitmap(rgb, frameWidth1, frameHeight1, Config.ARGB_8888);
int pixel = bmp1.getPixel( x,y );
int redValue1 = Color.red(pixel);
int blueValue1 = Color.blue(pixel);
int greenValue1 = Color.green(pixel);
int thiscolor1 = Color.rgb(redValue1, greenValue1, blueValue1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With