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

1 visualización (últimos 30 días)
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.

Respuesta aceptada

Image Analyst
Image Analyst el 26 de Nov. de 2013
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.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by