Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How can i know what object created with imroi did i move

조회 수: 1 (최근 30일)
Raldi
Raldi 2012년 7월 15일
마감: MATLAB Answer Bot 2021년 8월 20일
Lets say i create a bunch of rectangles usind the following way
for i = 1:2
h(i) = imrect(gca, compdata(i,:));
end
how can i know which one did i move so i can store its location into a 2x4 matrix where the first row will be saved for the first rectangle and so on.

답변 (1개)

Image Analyst
Image Analyst 2012년 7월 15일
If this is related to your other question, then you moved all of them. You never answered my question from there about why you wanted to save all the intermediate boxes in the first place. Of what use is that?
  댓글 수: 5
Image Analyst
Image Analyst 2012년 7월 15일
Well I can't see any reason at all to capture the intermediate rectangles. Let's say I grabbed a corner and scribbled around the screen for 2 minute, generating thousands of rectangle, before I finally dropped it at the final location and size I want. Why on earth would you care about all the thousands of earlier rectangles before I made up my mind on the final location?
Raldi
Raldi 2012년 7월 15일
If you put it like that, i can't disagree. But still that makes it no easier for me as i can't seem to be able to store those positions at the right place and the update it. It would be easier if i didnt used a for and i draw each rectangle by myslef. But i like it more with the for loop so i can add 3 or 10 rectangles etc.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by