Continuous rotation of freehand object on matlab figure

3 visualizzazioni (ultimi 30 giorni)
Hi there,
I have displayed a ROI on the figure using freehand function and now I want the program to puase and wait for me to continously roate this object on my figure and after Im satisfied with the location excetue the program and get the new postion of object.
I know how to perform this on a rectangle object, but having difficulty with freehand.
Can anyone help me with this?
Nikan

Risposte (1)

Ananya Tewari
Ananya Tewari il 5 Ago 2021
Hi,
The drawfreehand function provides the functionality of moving/dragging and editing the ROI that you created. Setting the Name-Value argument of 'FaceSelectable' as true would allow you to move the ROI as per your wish. The wait function will pause the code until the ROI edits are completed, double-click the ROI object to resume. Here is an example for the same.
imshow(imread('yellowlily.jpg'))
h = drawfreehand;
h.FaceAlpha = 1;
h.FaceSelectable = true;
wait(h);
% Once edited the ROI Double-click to proceed
% To get the Position of the ROI
roi_position = h.Position;

Community Treasure Hunt

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

Start Hunting!

Translated by