I have an image in RGB.
fragment of code:
clc,clear all,close all, format long g, format compact A=imread('car.jpg'); a=size(A); w_image=a(2); h_image=a(1); s=round(0.05*w_image); w=round(0.05*h_image); C=imcrop(A,[0.05*w_image 0.4*h_image ... w_image-1.5*s h_image-w]); figure(1),imshow(C) red=C(:,:,1); green=C(:,:,2); blue=C(:,:,3);
How could I separate only one color from an image?
I want to display new image which shows all blue pixels from old one (other pixels should be black/white).
No products are associated with this question.
You already separated it. And you know how to display.
I'm not sure how to interpret your last sentence. It doesn't make sense. The blue channel of a color image is a monochrome image. If you just display the values, you can use the normal gray colormap, or any other one you want. ANd what are "other pixels"? And what color are they now?