Hello!
Could anyone help me with something?
I have a project to do and I don't know how to do it.
The project is about using a webcam that is filming a room and when a specific color appears in front of the camera (e.g.: a red balloon), a message will be shown on screen.
I am using C#.NET language.
Thank you!
Hemant SrivastavaPosted Nov 23, 2012, 4:10 PM
I developed similar kind of project in past. So I can help you easily...
For this you need to get the digital image (preferbly in jpeg format) from you camera and load into your PC.
Then load that image file into .Net class "Image" and store that image object.
Now you need to convert that image object into Bitmap Object, so that you could get each and every pixel of the image.
Then iterate each pixel one by one and retrieve its color.
Match each pixel color's ARGB value with picked color (in your case 'RED') ARGB value. If values are found, you are done i.e. you deteced the color!
For more details and sample code, you could refer to following link:
http://hemant-srivastava.blogspot.com/2012/11/image-color-detector-in-c.html
If you find any issue to undersatnd this, let me know.
Please mak it as an accepted answer, if it works for you.
Thanks,
Hemant Srivastava
Hemant SrivastavaPosted Nov 23, 2012, 4:58 PM
Catalin TudoroiuPosted Nov 23, 2012, 4:46 PM