How to delete a ROI after having drawn a new one
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello all.
In my program I create a square roi using imrect and impoly, the user has to position, resize and roate it on the image as he sees fit, but when the user resizes and rotate the roi a new one is created... Im having problems erasing the old one from the image. Does anybody has an idea how could I do that?
I already tried a function from Image Analyst -
function ClearLinesFromAxes()
axesHandlesToChildObjects = findobj(gca, 'Type', 'line');
if ~isempty(axesHandlesToChildObjects)
delete(axesHandlesToChildObjects);
end
return; % from ClearLinesFromAxes
but it clears all the image and I already have some other plots on it that shouldn't be erased...
and tried also - set(ROI_Q,'Visible','off')
Thanks
0 comentarios
Respuesta aceptada
Matt Kindig
el 25 de Feb. de 2013
Probably the most robust way is to save the handles to imrect/impoly and then delete just that object. Something like this:
hrect = imrect(IMG) % your imrect code here
hpoly = impoly(IMG) % your impoly code here
%and then later when you want to delete it:
delete(hrect);
delete(hpoly);
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!