I want to do background subtraction in a video file using OpenCV method. Right now I'm able to do background subtraction, but the problem is that I couldn't get the output in color mode. All the output after subtracting the background is coming in grayscale color mode :(. I want to get the color information to the foreground which is the resulting output after background got subtracted.
Can I do it using masking technique?? like the following procedure which I'm thinking about.
InputFrame
(RGB)InputFrame
TempFrame
(which is coming in grayscale :( )TempFrame
InputFrame
OutFrame
I'm struck up with doing the masking using OpenCV. I'm just a very beginner in OpenCV. Please help me to overcome this.
Thanks in advance.
code is here
http://code.google.com/p/derin-deli-mavi/downloads/detail?name=denemeOpenCv23.zip&can=2&q=
to reach a colored foreground just copy image by using foreground mask
// image.copyTo(foreground,foreground);