How to convert the white component of binary image into an RGB image?

2 次查看(过去 30 天)
This is my code. I want to convert my code final value into original image which is RGB, but the selected one which I separate at the end of my code. Here is my code:
I = imread('D:\seven semester\DIP\lab2\Image Data\N10.png');
figure;
imshow(I);
G = rgb2gray(I);
% figure;
% imshow(G);
A = I(:,:,1);
% figure;
% imshow(A);
F=imsubtract(A,G);
F= im2bw(F,0.18);
figure;
imshow(F);
Thanks for helping
  1 个评论
Image Analyst
Image Analyst 2017-10-9
编辑:Image Analyst 2017-10-9
I can't understand what you want to do. Why would you want to convert a binary image into a color binary image? Are you thinking of label2rgb() perhaps? That works on a labeled image. Or do you want to do masking where inside or outside the mask is black or white???

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by