I have to apply segmentation on color image of banana

1 回表示 (過去 30 日間)
sanjay
sanjay 2014 年 3 月 13 日
コメント済み: Image Analyst 2014 年 3 月 13 日
I have to remove background from banana in color form. which is the best way? and how to apply it? i mean code of segmentation with little explanation.

採用された回答

Image Analyst
Image Analyst 2014 年 3 月 13 日
Since the background is neutral colored, I'd probably convert to hsv color space
hsv = rgb2hsv(rgbImage);
and then threshold the S channel
background = hsv(:,:,2) < 0.2; % Or whatever value works.
After that it depends on what your mathematical definition of "remove" means. Do you mean to make it pure black? Do you want to crop for some reason? What do you need to do?
See my File Exchange for full blown demos on hsv color segmentation: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
  2 件のコメント
sanjay
sanjay 2014 年 3 月 13 日
thank you..
yes i means make it pure white.
Image Analyst
Image Analyst 2014 年 3 月 13 日
Glad it worked for you. Please mark as "Accepted" - you can still come back with any questions if you run into any.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by