Extracting the red channel of an image
Show older comments
for extracting red color alone of a color image input, i used the following code.
i=imread('football.jpg');
v=i(:,:,1);
imshow(v)
whether my code is doubt and if yes, why red color is not visible
Accepted Answer
More Answers (1)
Razvan
on 9 Apr 2012
v contains only one color plane, so imshow(v) treats it as a grayscale image. You have there the actual red intensities.
If you want to show the image as red, you need to do something like
v = zeros(size(i));
v(:,:,1) = i(:,:,1);
imshow(v)
1 Comment
Sivakumaran Chandrasekaran
on 10 Apr 2012
Moved: DGM
on 29 Dec 2023
Categories
Find more on Red in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!