how to show background in original color after segmented ??
조회 수: 2 (최근 30일)
이전 댓글 표시
how to show background in original color after be segmented ??
댓글 수: 0
답변 (3개)
Image Analyst
2014년 12월 3일
I have several color segmentation methods in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 They segment the image into "foreground" (the objects of the color you want), and "background" (the colors you don't want). You can use the invert the foreground mask to give an image of just the background:
backgroundMask = ~foregroundMask;
% Mask the image using bsxfun() function
backgroundOnlyImage = bsxfun(@times, rgbImage, cast(backgroundMask, class(rgbImage)));
댓글 수: 0
Sammit Jain
2017년 11월 28일
If you have the background portion of the image, then just binarize it, and take logical product with the original image.
outImg = origImg.*(backImg>0.5);
Here make sure that your dimensions are in order.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!