how do i segment the attached image based on color?
Show older comments
i need to select the only fruit region and extract various color feature. That is why i need to segment the image and select only fruit region. Please give me your suggestion in this regard.

1 Comment
Md. Motiur Rahman
on 19 May 2018
Edited: Md. Motiur Rahman
on 20 May 2018
Answers (1)
KALYAN ACHARJYA
on 20 May 2018
Edited: KALYAN ACHARJYA
on 20 May 2018
0 votes
% code
input_image=imread('banana.png');
pattern=repmat(all(~input_image,3),[1 1 3]);
%convert to white pixels
input_image(pattern)=255;
imshow(input_image);
2 Comments
KALYAN ACHARJYA
on 20 May 2018
By doing loop, you can find the R,G,B of any pixels.
input_image(i,j,1) % gives R value of respective pixel;
input_image(i,j,2) % gives G value of respective pixel;
input_image(i,j,3) % gives B value of respective pixel;
Md. Motiur Rahman
on 21 May 2018
Categories
Find more on Image Processing and Computer Vision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!