please help me in coding to find a white color in image and also find the value of white color???

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

What is "white color" for you? is (255, 255, 254) white? Is (128,128,128) white? Is (240,228,245) white?
actually i am finding the eye blink detection of a person... for this i am using color scheme... if the value of white color is high its mean eyes are open or if less its mean eye closed...
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"

Sign in to comment.

Answers (1)

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

actually i am finding the eye blink detection of a person... for this i am using color scheme... if the value of white color is high its mean eyes are open or in less its mean eye closed...
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?

Sign in to comment.

Asked:

on 7 Jun 2015

Commented:

on 7 Jun 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!