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.
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!