How to crop required ROI from an image?
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Revathi S
el 23 de Sept. de 2018
Comentada: Image Analyst
el 29 de Sept. de 2018
% code
h = impoly(gca,[188,30; 189,142; 93,141; 13,41]);
api = iptgetapi(h);
fcn = makeConstrainToRectFcn('impoly',get(gca,'XLim'),get(gca,'YLim'));
api.setPositionConstraintFcn(fcn);
position = wait(h);
a=imcrop(I,[250 91;251 203;155 202;75 102]]);
imshow(I);
end
I am working on medical image processing.
I need to crop eye only from face & position is not constant for all images.
so i use polygonal ROI.
but it shows error.
2 comentarios
Respuesta aceptada
Image Analyst
el 23 de Sept. de 2018
Call imcrop() with no arguments if the coordinates are not the same from image to image. This will let the user interactively select the box.
2 comentarios
Más respuestas (1)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!