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;

카테고리

Help CenterFile Exchange에서 Build Interactive Tools에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by