Continuous rotation of freehand object on matlab figure

3 ビュー (過去 30 日間)
Nikan Fakhari
Nikan Fakhari 2021 年 8 月 2 日
回答済み: Ananya Tewari 2021 年 8 月 5 日
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

回答 (1 件)

Ananya Tewari
Ananya Tewari 2021 年 8 月 5 日
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