MATLAB Answers

Comparing images of the same on MATLAB and selecting particular features.

1 view (last 30 days)
Rana Jud
Rana Jud on 16 Sep 2020
Commented: Rana Jud on 26 Sep 2020
How do I match multiple coloured images to other images of the same but that is in black and white and eliminate everything that matches with the black part and keep only the parts of the image that match with the white on MATLAB as part of a CNN?


Sign in to comment.

Accepted Answer

Aditya Patil
Aditya Patil on 22 Sep 2020
As per my understanding, you have an image that has only black and white colors. You have other colored images, from which you would like to remove parts, where the corresponding pixel in the b/w image is black.
Depending on your use case, you could load the images as matrices. Then create a binary mask based on b/w image, as follows
bwimage = imread(image_path)
flag = [bwimage == value] % where value is value of white
colorimage(flag) = 0 % or another appropriate value
Designing a CNN to do this might not be necessary as this can be done easily with few lines of code.


Image Analyst
Image Analyst on 22 Sep 2020
Rana, attach a few of the images so we have some idea of what you're talking about.
Rana Jud
Rana Jud on 26 Sep 2020
For example, this would be the original input image
And this would be the black and white output image that I would like to match it to.
Once that is done, id like to segment the image where it gets rid of the black and only keeps the white. At the end, it should output only the bit of the original image that matched to the white for further analysis of the cells without the background(black parts)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!