how do get a color region?
2 ビュー (過去 30 日間)
古いコメントを表示
I want to get something like like apple.jpg without using watershed.
How to get the color piece after I done edge detection, imclose and rgb2label.
My result is elephant.jpg how can turn it like apple.jpg
0 件のコメント
採用された回答
Image Analyst
2015 年 11 月 22 日
You're going to have to use a better segmentation routine to get the elephant. Perhaps get gray things. Compute the HSV image from rgb2hsv() and look as the s image:
hsvImage = rgb2hsv(rgbImage);
sImage = hsvImage(:,:, 2);
% Binarize to find low saturation (gray) pixels.
binaryImage = sImage < 0.3;
That's just a guess, because you didn't attach the original RGB image. Elephants can sometimes blend in well with their surroundings so it might be tough to get it all, particularly if it's obscured by branches or other elephants or trucks or walls or whatever. If you get a noisy outline, you can clean it up with activecontour(), demo attached.
See my File Exchange which has several color segmentation demos: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
4 件のコメント
Image Analyst
2015 年 11 月 23 日
The code I gave you above should work to get the elephants in a colored background. There is a full blown demo on my File Exchange page: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
But I know of no way to have the program determine where one elephant starts and another stops. You could do edge detection, but the problem is there are going to be tons of edges everywhere, not just at the overlap line.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!