Borrar filtros
Borrar filtros

HELP image processing!

2 visualizaciones (últimos 30 días)
MartiBB
MartiBB el 7 de En. de 2016
Comentada: MartiBB el 11 de En. de 2016
Hello, I have a question about this ultrasound image. I have to calculate some statistical parameters of the image (mean, std etc) but I want to consider only the pixels below the yellow line.
I know the coordinates of the points that make up the yellow line. How can I do? Thank you in advance.

Respuesta aceptada

Image Analyst
Image Analyst el 7 de En. de 2016
Create a mask of the region you want, then get the stats:
[rows,columns, numberOfColorChannels] = size(grayImage);
mask = poly2mask(x,y,rows,columns);
theMean = mean(grayImage(mask));
theSD = std(grayImage(mask));
  3 comentarios
Image Analyst
Image Analyst el 9 de En. de 2016
I knew that. I was assuming that you knew how to pass them into polymask. I'm assuming you have your line coordinates in x and y. So all you need to do is to add points at the bottom of the image.
% Get x at the bottom of the image
xb1 = x(1);
xb2 = x(end);
% Get complete x - a completely closed polygon.
x = [xb1, x, xb2, xb1]; % Make closed polygon.
% Get y at the bottom
[rows,columns, numberOfColorChannels] = size(grayImage);
y = [rows, y, y(end), rows]; % Make closed polygon.
% Create the mask from x and y.
mask = poly2mask(x,y,rows,columns);
% Get stats
theMean = mean(grayImage(mask));
theSD = std(grayImage(mask));
MartiBB
MartiBB el 11 de En. de 2016
Thank you!!

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by