In this post, I am going to discuss about how to convert RGB or color map images into binary.
The following piece of code is used to convert RGB image to binary.
The following piece of code is used to convert RGB image to binary.
I=imread('1.jpg');
imshow(I);
binary=im2bw(I);
figure,imshow(binary);
In the above code, binary
= im2bw(I)
converts the truecolor image RGB
to the binary intensity image . The im2bwfunction converts RGB images to binary in which their values lies between 0 and 1.
No comments:
Post a Comment