How to import a image in HUV format?

I want to use chroma information of colour to differentiate shadows form forground objects. For this I wish to use chroma colour information of the image. I need to extract Hue of each and every pixel for this. What I do right now is i import the image and convert it to HUV
img=imread('image.jpg'); huvimg=rgb2huv(img); H=huvimg(:,:,1);
The problem i'm having now is some of the HUV information is lost when the image is first loaded into matlab in RGB format. For eg: two different shades of red and blue with V-->0 both will look like white and will have a RGB value of [255,255,255]. Thus it will be the same colour in matlab space eventhough they are too different shades.
So when i convert such values back into HUV I may not get the original huv values i would observe in jpeg (in a software such as 'paint').
Is there a way to prevent this from happening? Maybe a way of loading a image directly as HUV rather than RGB?

답변 (0개)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2014년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by