Background Removal From Images
1 次查看(过去 30 天)
显示 更早的评论
I'm working on a stereo camera setup and need to track a white ball as it moves around. Here is a picture of the setup:
As you can see there is a high contrast between the ball and background. Currently I am thresh holding the image and then getting the centroid of the ball to determine the location. I would like to have a more robust method where I would subtract the background. Any help would be greatly appreciated.
0 个评论
采纳的回答
Image Analyst
2013-9-25
编辑:Image Analyst
2013-9-25
correctedBallImage = abs(double(ballImage) - double(backgroundImage));
4 个评论
Image Analyst
2013-9-25
If the ball disappears then it must be the same intensity as the background so you won't see it. You must have the ball be either brighter or darker than the background it's over. In that case, you will see it in the difference image. You can use rgb or grayscale. But to display the corrected image you must use either cast to uint8 for rgb, or use [] and leave it as double for grayscale:
correctedBallImage = uint8(correctedBallImage); % Gray scale or RGB.
imshow(correctedBallImage, []); % Gray scale only.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!