How can I make one side of a color image greyscale and then have the color gradually return to the other?

1 回表示 (過去 30 日間)
I have a color image that I want to process in a very specific way. I need a code that can convert far lefthand side of the picture to the equivalent grey (so still in rgb format), and then have the color gradually return as you go right. I would also like to be able to set the point where the picture is completely restored.
Same question for the noise. Could I add some noise (make the picture grainy) in the same way - left side very noisy, then gradually the noise disappears until some point where it disappears completely?
Thank you all in advance.

採用された回答

Image Analyst
Image Analyst 2013 年 11 月 26 日
In the hsv color space you could just multiply your saturation image by values going from 1 down to 0 to reduce the image to gray.
hsv = rgb2hsv(rgbImage);
hsv(:,:,2) = hsv(:,:,2)*reductionFactor;
newrgbImage = hsv2rgb(hsv);
or something similar. For the noise, just add different amounts of noise with imnoise. Not hard. Write back if you can't figure it out.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by