Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the C++ code to obtain gray scale image pixel intensity values using CImg library ? #57

Closed
blvlohithkumar opened this issue Apr 21, 2016 · 1 comment

Comments

@blvlohithkumar
Copy link

Hi, everyone I’m a beginner to C++ and raspberrypi, Here I’m working on a project to capture the real time images using Raspberrypi CSI camera and to perform simple image processing operation in C++ using CImg library.

That is, to detect the bright spot in an image (such as LED light glow) and if detects the bright spot, output should be given as ‘1’ and if not (when the LED is off ) output should be given as ‘0’.

Note: The image processing has to be done only in the specific portion of an image (i.e focus only on the led section of an image and neglecting remaining portion of an image which is out of interest, such that it saves processing time and improves performance)

But firstly I don’t know how to get pixel intensity values of a gray scale image using CImg library such that we can compare the values obtained in the pixel to the threshold value and problem could be solved ( this is my algorithm for the above operation but any other simpler methods for the above processing ,your suggestions are always welcome )

Could you help me in a C++ code or algorithm to perform the above task.
Thanks in advance.

@shimpe
Copy link

shimpe commented Jul 23, 2016

one possibility may be to use image.RGBtoYCbCr().channel(0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants