How to retrieve the RGB color information from its original image to the segmented sub-images after applying bwlabel()
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone, I have an project which currently need to segmented blast cells from a microscopic image. I had done the watershed segmentation, and I had tried to use bwlabel() function to crop out the blast cells into several sub-images. However, I would like to ask about how to retrieve back the original RGB color space to the sub-images which is just a binary image. I hope someone can help me in this matter, thanks in advance.
0 个评论
回答(1 个)
awezmm
2019-2-28
If I understand you correctly, you want overlay the masked binary back into the RGB so that single cells show up as color.
Lets say that rgb_img is the variable for your rgb image
binary_img is the variable for your masked image
overlayed = bsxfun(@times, rgb_img, cast(binary_img,class(rgb_img)))
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!