Update the ROI with drawrectangle change
古いコメントを表示
Hi,
I'm trying to draw a shape (rectangle, circle etc.) to determine region of interest (ROI) in an image. When I use the drawrectangle function, I can get the corners of the first instance that the rectangle is drawn, however when I edit the rectangle on the figure (change size/position), it does not update the roi variable. How can I update the roi variable when the rectangle is altered in a script?
Code I use is below and I use R20109a;
temp = snapshot(cam1);
imshow(temp);
rect = drawrectangle;
roi = rect.Position;
4 件のコメント
xi
2019 年 9 月 6 日
After you change the size/position , run 'roi=rect.Position' again. Should see the difference, at least on my computer
Mert Karakaya
2019 年 9 月 9 日
Dheeraj Singh
2019 年 9 月 13 日
You can try running the code in the loop for the required functionality
while true
%when you receive an update
x=input()
rect = drawrectangle;
%update roi
roi = rect.Position;
end
OR you can use Callbacks using App Designer.
Mert Karakaya
2019 年 9 月 16 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で ROI-Based Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!