MATLAB: How to obtain the brightness value of the image taken by any camera

color analysiscolor standardizationImage Processing Toolbox

First i am going to take a color image using any camera, and i am concerned on the values of RGB and Brightness of that image. NOTE: i can get the RGB values but Brightness is not obtained and it is important for me.

Best Answer

What is your definition of brightness? Do you want to convert to grayscale, CIELAB color space and take the L channel, or HSV color space and take the V channel?
brightness = rgb2gray(rgbImage);
hsvImage = rgb2hsv(rgbImage);
brightness = hsvImage(:, 3);
labImage = rgb2lab(rgbImage);
brightness = labImage(:, 1);