Clear Filters
Clear Filters

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

2 views (last 30 days)
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 Comment
Image Analyst
Image Analyst on 9 Oct 2017
Edited: Image Analyst on 9 Oct 2017
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???

Sign in to comment.

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!