How can I represent my image pixel values inside a HSV cone

Hello,
I'm trying to develop a colour model for fire in HSV colour space.I have a million sample pixels per channel for the HSV colour space. I want to represent these samples inside the HSV cone to get an idea of how they are distributed. Any thoughts or suggestions on how i could possibly proceed with this? Thanks in anticipation.

 Accepted Answer

See my attempt at doing it in MATLAB attached below in blue.
A better option is to use the Java code that was originally written for ImageJ but can be called from MATLAB. See my code samples in http://www.mathworks.com/matlabcentral/answers/?search_submit=answers&query=color-inspector&term=color-inspector

3 Comments

I've visualized and managed to 'carve' out the gamut in RGB color space. However as part of my analysis I want to visualize it in the HSV cone as well.
I initially used polar plot command to plot Hue and Saturation. It seems to make sense to me but I'm not sure if it is correct.
I followed this post ( http://www.mathworks.de/matlabcentral/answers/84068-lab-vs-rgb-vs-hsv-color-spaces-for-color-detection ) earlier and installed ImageJ but i can't figure out how to import my data set into ImageJ. It's not an image, just a million by 3 matrix of HSV values.
Just create any image. Like (untested)
k = 1;
for row = 1 : 1000
for col = 1 : 1000
hsvImage(row, col, 1) = hsv(k, 1);
hsvImage(row, col, 2) = hsv(k, 2);
hsvImage(row, col, 3) = hsv(k, 3);
k = k + 1;
end
end
% Now convert that to an RGB image
rgbImage = hsv2rgb(hsvImage);
imwrite(rgbImage, fullFileName);
Then import it into the Color Inspector and view the gamut as HSV.
Thanks. That worked like a charm. I should have thought of that sooner.

Sign in to comment.

More Answers (1)

Simply use scatter3?

1 Comment

I tried scatter3 but since the circular nature of the HSV colour space isn't taken into account the results are not adequate for my needs.

Sign in to comment.

Asked:

on 22 Nov 2013

Commented:

on 22 Nov 2013

Community Treasure Hunt

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

Start Hunting!