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.

回答(2 个)

Image Analyst
Image Analyst 2014-10-2
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

Syed Asad  Ali
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
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!

Translated by