Borrar filtros
Borrar filtros

How to calculate intensity of a particular color in an RGB image

3 visualizaciones (últimos 30 días)
I have an rgb image with varied intensity of the colour green. How can i determine the intensity?

Respuesta aceptada

Image Analyst
Image Analyst el 21 de Dic. de 2020
To get a matrix with the gray level intensities of the three different color channels, use imsplit:
[r, g, b] = imsplit(rgbImage);
g will be a matrix of your green intensities. If you want the overall intensity considering the other color channels, you can use
hsvImage = rgb2hsv(rgbImage);
[h, s, v] = imsplit(hsvImage);
and look at the v channel, or
labImage = rgb2lab(rgbImage);
[L, a, b] = imsplit(labImage);
and look at the L image, or
ycbcrImage = rgb2ycbcr(rgbImage);
[Y, Cb, Cr] = imsplit(ycbcrImage);
and look at the Y image.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by