Remove background portion
이전 댓글 표시
Hi
May I know how to remove background by using original image's binary image? I found that I can use element wise multiplication with original mammogram to obtain the image I want, but how?
Thank you.
댓글 수: 1
Walter Roberson
2011년 10월 7일
My browser can't bring up that file... some problem with redirection for the site logo.
답변 (3개)
Walter Roberson
2011년 10월 7일
MaskedImage = MammogramImage .* repmat(BinaryImage,1,1,size(MammogramImage,3));
Anything set (1) in the binary image would have its corresponding position preserved, and anything clear (0) in the binary image would result in the correspond image location being zero'd (black).
Note: this won't work very well if the original image is a pseudocolor image ;-)
Image Analyst
2011년 10월 7일
I can't bring up the image either. I usually "dot multiply" like Walter did, but here's another method for masking that Sean uses:
% Mask the image.
maskedRgbImage = bsxfun(@times, rgbImage, cast(mask,class(rgbImage)));
It's a little more obtuse and cryptic than dot-multiplication but it gets the job done.
ws
2011년 10월 8일
댓글 수: 5
Image Analyst
2011년 10월 8일
How do we download the original images from that link?
ws
2011년 10월 8일
Walter Roberson
2011년 10월 8일
LM = bsxfun(@times, I, cast(I, class(I2)));
should be
LM = bsxfun(@times, I, cast(I2, class(I)));
ws
2011년 10월 8일
편집: Walter Roberson
2017년 6월 26일
카테고리
도움말 센터 및 File Exchange에서 Image Category Classification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!