Represent data as image using color amplitude and hue

6 views (last 30 days)
I have 4D data, which is really 2D data with two properties for each location in the 2D array. I would like to represent this data as an image by encoding the first feature as brightness (0=black) and the second feature as color/hue around the color wheel. Does MATLAB have any built in functions to make this easier?

Accepted Answer

Image Analyst
Image Analyst on 4 Aug 2020
You could try something like this:
Sounds like 3-D data to me. Or even two separate 2-D images. So try
[rows, columns, numColors] = size(yourBrightnessImage);
hsvImage = ones(rows, columns, 3);
hsvImage(:, :, 3) = 255 * mat2gray(yourBrightnessImage); % Assign intensity channel.
hsvImage(:, :, 1) = yourHueImage; % Assign hue channel.
rgbImage = hsv2rgb(hsvImage);
imshow(rgbImage);
If you need more help, attach your data.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!