RGB values of Image pixel using JavaCV

This post will explain how to get RGB color space values of Image pixel using JavaCV.
For JavaCV setup on Windows, follow link below
http://opencvlover.blogspot.in/2012/04/javacv-setup-with-eclipse-on-windows-7.html

If you want to access HSV color space values, then refer to link below
http://opencvlover.blogspot.in/2013/02/hsv-values-of-image-pixel-using-javacv.html

Pixel values in RGB color space are often required in Image processing. Following gist demonstrates how to access and print pixel values in RGB color space. We can call 'cvGet2D()' function to access image matrix and use it get pixel values at desired location.


This will print RGB values in console. This code comes really handy while using manual threshold.
You can fork me on github for complete project of this code.
https://github.com/nikhil9/getRGB

2 comments: