How do I separate RBG channel then combine green and blue channel only, leaving the red channel out? Thanks!
Show older comments
I have tried separating the RGB colour channel. Since it is using dark channel for underwater images, the red channel could be ignored completely. Is there any to remove the red channel in the RGB channel and implement the blue and green channel only?
1 Comment
Guillaume
on 8 Feb 2017
What is a dark channel? For that matter, what is a RGB channel?
You have RGB images that consist of 3 colour channels, red, green and blue. Or you have greyscale images that consist of 1 channel: the intensity.
Accepted Answer
More Answers (1)
Guillaume
on 8 Feb 2017
Well, you certainly can manipulate the image pixels using only two colour channels:
GB = RGB(:, :, [2 3]); %two channel pixel matrix
However, I'm not aware of any image file format that support only two channels and certainly your display needs to set an intensity for the red pixels even if it's 0, so you will have to add this red channel back for display or saving to standard image formats.
GBforsaving = cat(3, zeros(size(RGB, 1), size(RGB, 2), 'like', GB), GB) %add red channel with 0 value (no red).
So in the end, I would do what Jan's advised initially: just set the red channel with 0, and use that:
GB = RGB;
GB(:, :, 1) = 0;
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
