Flood Flow Algorithm

Hi,

Can anyone say how to implement the flood fill algorithm for video. OpenCV has example for image. But I would like to know how to implement it for video. Any help would be appreciated.

Thanks,
Prashanth.

Can you be more specific on what you want to accomplish? I would assume you could use the image method on each frame of the video. I guess the trick would be to know where to start the fill in a moving image. For that, you could pick an initial location and use optical flow analysis to track the spot’s movement. I’ve never worked with optical flow, but I believe OpenCV also supports this.

Hi Tim,

Thanks for the reply. Basically I need to find the eye region both white part and black part of eye. I can find the pupil(black part) which is not a problem since its threshold value will be less under any image conditions but the problem is with white part. I am not getting any idea on how to extract that region.

Thanks,
Prashanth.

I really think you could find also the white part using a threshold.
To find the pupil you propably threshold near the black area; now if you make a second threshold ie. around 127 you’ll probably find the white area. If you’re working under non constant lighting condition you should try an adaptive threshold or an otsu threshold.

A different approach would be to find contours and track down connected components (if you have the “learning opencv” book you’ll find examples), but, unless you have a macro image of the eye, this could be overkill.