How to import a image in HUV format?

2 views (last 30 days)
Pram
Pram on 11 Feb 2014
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?

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!