background subtraction in video or image
1 次查看(过去 30 天)
显示 更早的评论
I want to background subtraction from video or image and I don't have any background image without foreground objects. Can any body give me code for that? I attached a sample of images.
0 个评论
采纳的回答
Dima Lisin
2015-6-1
You can use vision.ForegroundDetector object in the Computer Vision System Toolbox.
2 个评论
Image Analyst
2015-6-4
You can't expect Dima to drop everything and develop a turnkey application for you. You can hire other people at the Mathworks (consultants) to do that but it won't be instant.
You will have to first find the objects that you want to outline. That means segment the image and get a binary image. Then you can call bwperim() or bwboundaries(). bwperim() gives you a binary image whereas bwboundaries() gives you the x,y coordinates of the outline pixels.
更多回答(2 个)
Image Analyst
2015-6-1
Then you'll have to estimate it. For example, find the foreground objects somehow and then estimate the background by using roifill() to fill in where the foreground objects are. But if you can do that, then maybe you don't even need to subtract the background. Why don't you attach a couple of frames from your video and tell us what you want and don't want?
4 个评论
Image Analyst
2015-6-1
You have to first find the foreground objects so you have a binary image of the foreground, then you can fill them in. I suggest you follow up on Dima's answer as that is the best way.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!