How to apply a filter to an image to scale the saturation?
조회 수: 4 (최근 30일)
이전 댓글 표시
I am trying to represent two distinct variables in a single figure by denoting one of the variables with hue and the other with saturation.
See below for an example from the literature:
The color bar contains two variables: phase and intensity. Color hue represents phase while color saturation represents the intensity. (Note: the authors should have written "intensity" instead of "amplitude")
To achieve this figure, I have one matrix that represents intensity
and another that represents phase
I would like to scale the saturation of each point in the phase matrix by the corresponding value of the intensity matrix. For example, there are regions in the intensity matrix where there is 0 signal. The saturation of the corresponding indices in the phase matrix ought to be multiplied by 0 in this case. On the other hand, there are other regions in the intensity matrix where the signal is brightest, i.e. 1. The saturation of the corresponding indices in the phase matrix ought to be unchanged in this case. To summarize the question, I would like to use a matrix of values between 0 and 1 as a filter to scale the saturation of a different matrix with the same dimensions. In this case, the matrix of values between 0 and 1 is the intensity matrix and the matrix-to-be-scaled is the phase matrix.
댓글 수: 0
답변 (2개)
Image Analyst
2018년 5월 11일
Use hsv2rgb where you construct the hsv image with your matrices:
hsvImage = cat(3, hueImage, saturationImage, intensityImage);
rgbImage = hsv2rgb(hsvImage);
See how that works. If it doesn't look good, try making the intensity image range from 0-100
intensityImage = 100 * mat2gray(intensityImage);
before putting into hsvImage. If RGB image is in the range 0-255 then it must be cast to uint8 before displaying. If it's in the range 0-1 then you should be able to use imshow on it directly.
댓글 수: 3
Image Analyst
2018년 5월 12일
I'm a little unsure what you want. If the intensity is low, it will be black. If you don't want it black then set intensity equal to one minus intensity. If you can, mock up what you'd like and show that, and attach your images for phase, hue, saturation, and intensity.
참고 항목
카테고리
Help Center 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!