Hi
I have one requirement like remove the background from live video.
So i tried Emgu CV for the same but i didn't get any exact solution for the above requirement.
If any one have any idea please help me ...
Its very urgent.....
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Keyur PatelRank #1,216 · 1.5K reputationPosted May 31, 2013, 4:29 AM EDT
I know , it would not help you much but i believe, you have gone through following library and code for Live webcam video in WPF. You can get background property from this library and remove background area.
http://easywebcam.codeplex.com/
Vivek A S27 reputationPosted Jun 2, 2013, 9:10 PM EDT
Now i got the solution for this by using GrabCutter,
First i display live video from webcam(particular person standing front of the fixed background "Grean/Blue").
Then i take one frame from the live video and remove the background by using GrabCutter,
but i faced one issue in this solution .i mean, by executing the GrabCutter function it will take long time .
In below please check the code,
int numberOfIterations = 1;
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(0, 10, frame.Width, frame.Height);
Image
while executing this line it will take around 4 minutes...
mask = mask.ThresholdBinary(new Gray(2), new Gray(255));
System.Drawing.Color cl = System.Drawing.Color.FromArgb(0, 255, 255, 255);
Image
frame.Copy(processed_image, mask);
using (var stream = new MemoryStream())
{
// My way to display frame
processed_image.Bitmap.Save(stream, ImageFormat.Bmp);
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.StreamSource = new MemoryStream(stream.ToArray());
bitmap.EndInit();
img1.Source = bitmap;
};
Thanks & Regards
Vivek A S