How Do I Plot Color Distribution of HSV Image in MATLAB I have a dataset of images representing human skin. How do I plot the skin color distribution in HSV color space and YCBCR color space. However, I'd like ignore the "value" or "brightness" in both color spaces and analyze rest of the layers.

edit

The below is the code, I found to plot the distribution for ycbcr but don't understand what it means. Can anyone explain it please?

chroma = zeros(256);
cb = imycc(:,:,2);
cb = reshape(cb, 1, numel(cb));
cb = round(cb);

cr = imycc(:,:,3);
cr = reshape(cr, 1, numel(cr));
cr = round(cr);

for i = 1:length(cb)
   chroma(cb(i), cr(i)) = chroma(cb(i), cr(i)) + 1;
end
surf(chroma)
Have a look at File Exchange Submission - RGB/HSV Distribution on  visualization of RGB/HSV distribution in a given image:



hsv_distribution(inputImage, 5)


It should do what you're after as the result is like: