please help me in coding to find a white color in image and also find the value of white color???
Show older comments
i am capturing a run-time image from a webcam ..i want to find white color in that images and also want to get the values of that white color... please help me for writing its source code... here is my code...
y = wavread(hfile); %#ok<REMFF1>
[y, Fs, nbits, readinfo] = wavread(hfile);
vid1= videoinput('winvideo',2,'RGB24_640x480');
set(vid1, 'FramesPerTrigger', Inf);
set(vid1, 'ReturnedColorspace', 'rgb')
3 Comments
Walter Roberson
on 7 Jun 2015
What is "white color" for you? is (255, 255, 254) white? Is (128,128,128) white? Is (240,228,245) white?
Talha Ahmad
on 7 Jun 2015
Edited: Talha Ahmad
on 7 Jun 2015
Walter Roberson
on 7 Jun 2015
There is no "value of white color". White is defined as a mix of colors in equal intensities. (1,1,1), the minimum non-black color of equal intensities is white by definition, just with a very low intensity. (255,255,254) does not have equal intensities and so is by definition not white but rather "off white".
When you are referring to the "white of someone's eye" then "white" is not being used in the same sense. The "white" of someone's eye might be visibly yellow or red or even have brown places.
The technical term for the "white" of the human eye is "sclera"
Answers (1)
Image Analyst
on 7 Jun 2015
0 votes
I have several color segmentation demos in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 Upload your image so I can advise which color segmentation method might be best. You also have to decide how close to white do you require. Like what about light gray? Cream? Yellow? Light pastel pink?
2 Comments
Talha Ahmad
on 7 Jun 2015
Image Analyst
on 7 Jun 2015
That doesn't sound right at all. I think you'd better check here: http://www.visionbib.com/bibliography/motion-f725.html#Driver%20Monitoring,%20Eyes,%20Gaze
16.7.2.4.1 Driver Monitoring, Eyes, Gaze
for the proper algorithm. I don't know where you're looking (at the sclera, iris and pupil, or both together) but I don't know that a white color means the eyes are open, and certainly not if you are looking at the whole eyeball of a brown eyed person. Plus it depends on what the skin color is. Are you going for the narrow case of only using very dark skinned persons?
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!