Combining RGB to colored image after normalization
10 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am trying to equate low-level statistical properties of a set of pictures using the SHINE toolbox http://www.mapageweb.umontreal.ca/gosselif/shine/SHINEmanual.pdf . In particular I am willing to use the histMatch function to match the luminance histograms.
I want to match the RGB layers of the images separately, and then recombine the processed layers to produce color images.
In order to split the color of the images into their 3 RGB channels, I used to code by @Image Analyst found here https://it.mathworks.com/matlabcentral/answers/91036-how-do-i-split-a-color-image-into-its-3-rgb-channels which is the following.
% Read in original RGB image.
rgbImage = imread('flower.png');
% Extract color channels.
redChannel = rgbImage(:,:,1); % Red channel
greenChannel = rgbImage(:,:,2); % Green channel
blueChannel = rgbImage(:,:,3); % Blue channel
% Create an all black channel.
allBlack = zeros(size(rgbImage, 1), size(rgbImage, 2), 'uint8');
% Create color versions of the individual color channels.
just_red = cat(3, redChannel, allBlack, allBlack);
just_green = cat(3, allBlack, greenChannel, allBlack);
just_blue = cat(3, allBlack, allBlack, blueChannel);
I did that for all my pictures and saved their R, G, B images separately like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/499738/image.jpeg)
Then I took the red images, green images and blue images of each picture separately and match them using the histMatch function of theSHINE toolbox. For each image of each channel, I get a calibrated gray image, like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/499743/image.jpeg)
For each image I then try to recombine the three gray images to get a colored image using again the code above mentioned:
rgbImage = cat(3, final_red,final_green,final_blue);
However I get a greenish picture like this (image 1 example):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/499748/image.png)
Any clues?
Thanks
0 件のコメント
回答 (1 件)
Hrishikesh Borate
2021 年 2 月 5 日
Hi,
I understand that you are combining the red, green, blue channels of an image after histogram matching operation and you are observing a predominantly greenish output.
This is observed as the final_green image has more bright pixels as compared to the final_red and final_blue images.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!