Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

HSV color model in image processing

Asked by pradeep

pradeep (view profile)

on 15 Feb 2013

Hi, i am working on image processing using HSV model, the thing is in all the way they are showing hue value should be in degree(0-360), and saturation should be 100-0, and value should be 100-0, but the problem i am facing is i am getting all the values ranging from 0-1 in MATLAB, can any body please help me why it is and tell me is any way to get the right format. i used some simple code that i given below.

a=imread('IMAGE, format');
figure, imshow(a);
b=rgb2hsv(a);
figure,imshow(b);
c=double(b);
hhh=c(100:200,60:150,1);
sss=c(100:200,60:150,2);
vvv=c(100:200,60:150,3);
hh=mean(hhh);
ss=mean(sss);
vv=mean(vvv);
h=mean(hh)
s=mean(ss)
v=mean(vv)

0 Comments

pradeep

pradeep (view profile)

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson

Walter Roberson (view profile)

on 15 Feb 2013

Multiply H by 360, and Saturation and Value by 100.

0 Comments

Walter Roberson

Walter Roberson (view profile)

Contact us