please tell me the meaning of following code

1 visualización (últimos 30 días)
Anamika baruah
Anamika baruah el 20 de Jun. de 2014
Editada: Image Analyst el 21 de Jun. de 2014
darks = find(v <.2)';
lights = find(s < .05 & v > .85)';
h([darks lights])= -1;
disp(length(darks))
black = length(darks)/pixels;[x,y, z]=size(I);
white = length(lights)/pixels;
red = length(find((h >.9167 | h <=.083) & h~=-1))/pixels;
yellow=length(find(h >.083 & h<=.25))/pixels;
green=length(find(h > .25 & h<= .4167))/pixels;
cyan= length(find(h > .4167 & h<= .5833))/pixels;
blue=length(find(h > .5833 & h <= .75))/pixels;
magenta=length(find(h > .75 & h <= .9167))/pixels;

Respuesta aceptada

Dishant Arora
Dishant Arora el 20 de Jun. de 2014
This code is calculating probably density function of colors(black, white, red , yellow and so on) present in image out of an image(hsv).
  2 comentarios
Anamika baruah
Anamika baruah el 20 de Jun. de 2014
what is density function of colors
Dishant Arora
Dishant Arora el 20 de Jun. de 2014
It says how often a color is occuring/present in image or when you pick up a random pixel what's the probability of that pixel to be of a particular color

Iniciar sesión para comentar.

Más respuestas (1)

Image Analyst
Image Analyst el 20 de Jun. de 2014
It's counting the number of pixels with those particular colors.
  2 comentarios
Anamika baruah
Anamika baruah el 21 de Jun. de 2014
do you mean that above code is for calculating no of pixels of particular color
Image Analyst
Image Analyst el 21 de Jun. de 2014
Editada: Image Analyst el 21 de Jun. de 2014
Yes, but it's normalized (by dividing by the number of pixels), so it's really an area fraction than a pure count.

Iniciar sesión para comentar.

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by