Borrar filtros
Borrar filtros

How to choose a specific area of an image?

5 visualizaciones (últimos 30 días)
Ann G
Ann G el 5 de Oct. de 2015
Comentada: Image Analyst el 9 de Dic. de 2017
I would like to ask you how to choose a specific area of an image and then use the elements of this content?
  5 comentarios
Yap Sam
Yap Sam el 9 de Dic. de 2017
Hi, I have a question here. Lets say, I have defined an area of polygon using its x and y coordinates. But,how do I able to find out the mean pixels intensity of this area of polygon? Secondly,how should I apply the"if" condition to thershold a certain value of mean intensity of this polygon area.
Kindly advice
Image Analyst
Image Analyst el 9 de Dic. de 2017
Make a mask and then use mean on the masked image:
mask = poly2mask(x, y, rows, columns);
theMeanIntensity = mean(grayImage(mask));

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 5 de Oct. de 2015
You need to use some kind of array indexing. Often the easiest is to use logical indexing, which would allow you to select the area that you want.

Más respuestas (1)

Image Analyst
Image Analyst el 5 de Oct. de 2015
If you want masking demos, ask me.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by