Apply a colored filter on grayscale image?
3 ビュー (過去 30 日間)
古いコメントを表示
Filippo Gambarota
2019 年 1 月 16 日
コメント済み: Filippo Gambarota
2019 年 1 月 21 日
I have two grayscale images and i need to merge as an anaglyph image without shifting. The purpose is to watch this image with red-green glasses thereby having a red filtered image only visible with one lens and a green filtered image only visible with the other.
I've found the function
imfuse()
But i need to apply a red and green filter. It is possible on grayscale images? how can i do?
Thanks
0 件のコメント
採用された回答
Naman Chaturvedi
2019 年 1 月 21 日
You grayscale image (say iRed) is a m*n*1 matrix. (m, n are x and y dimensions). To make the grayscale image iRed to redscale image, do the following computations:
>> iRedMonochrome=cat(3,iRed,zeros(size(iRed)),zeros(size(iRed))); % for red filter [R 0 0]
>> iGreenMonochrome=cat(3,zeros(size(iGreen)),iGreen,zeros(size(iGreen))); % for green filter [0 G 0]
>> iBlueMonochrome=cat(3,zeros(size(iBlue)),zeros(size(iBlue)),iBlue); % for blue filter [0 0 B]
You can then simply add the images:
>> iRGB=iRedMonochrome+iGreenMonochrome+iBlueMonochrome;
3 件のコメント
Image Analyst
2019 年 1 月 21 日
If the gray is the ref
meanGreen = mean2(greenImage);
meanRed = mean2(redImage);
redImage = double(redImage) * meanGreen / meanRed;
Or use imhistmatch().
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!