how to extract or select region of interest for example a red ball from an image and output should be red colored ball with black background?
1 次查看(过去 30 天)
显示 更早的评论
hello sir/madam I have a red ball in an image and I need to extract that ball.After finding the region of interest output should be red ball with black background.Region of interest should be selected automatically not by manual selection.
0 个评论
回答(2 个)
Image Analyst
2014-10-2
Here's a simple though not very robust method: http://www.mathworks.com/matlabcentral/fileexchange/28757-tracking-red-color-objects-using-matlab
If you want better, more robust and flexible methods, see my File Exchange for my color segmentation demos. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
2 个评论
Image Analyst
2014-10-29
See demo I posted here to track a green object. http://www.mathworks.com/matlabcentral/answers/157265#comment_242523
Syed Asad Ali
2016-2-22
Hi..sir please understand me about this intensity formula and threshold for finding green intensity....
r=center(:,:,1); g=center(:,:,2); b=center(:,:,3); green=g-(r/2)-(b/2); bw=(green>30);
in this formula why use /2...and why g is place before r/2 and b/2..and also why use green>30...why use 30 in this...sir pls ans ASAP
1 个评论
Image Analyst
2016-2-22
Basically it's computing "green" as the difference between the actual green signal and the average of the red and blue signals. Then it takes only pixels where that signal is at least 30, so in other words the green must be 30 gray levels brighter than the average of the red and blue channels.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!