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?

how can i calculate brightness,contrast,hue and saturation of a image?

Asked by Harshit

Harshit (view profile)

on 26 Feb 2013
Latest activity Commented on by Muhammad Ali Qadar on 8 Feb 2015

i want to calculate brightness,hue,saturation and contrast of an image.

0 Comments

Harshit

Harshit (view profile)

1 Answer

Answer by Jurgen

Jurgen (view profile)

on 26 Feb 2013

Assuming its an rgb image, you can do rgb2hsv to find the hue and saturation of pixels. Value is similar to brightness, but you may mean brightness from the hsb space. There is no function rgb2hsb.

Also note that saturation is/could be defined differently in other colorspaces. E.g. saturation of a pixel in hsl space is not the same as its saturation in hsv space.

Contrast could be defined as a ratio. E.g. highest brightness / lowest brightness in image.

1 Comment

Jurgen

Jurgen (view profile)

Contact us