Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I have predefined line segments (like a stickman) show up overlayed on an image and drag the points into position manually?

1 回表示 (過去 30 日間)
birdman.56
birdman.56 2014 年 1 月 10 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I can set xy coordinates of line segments. What I am stuck on is when i move the points, other line segments move relatively in real time.
Any advice would help. Thanks.

回答 (1 件)

Image Analyst
Image Analyst 2014 年 1 月 10 日
Call imline() for each line segment. Then click and drag the lines into position. Double click them to accept them.
  1 件のコメント
birdman.56
birdman.56 2014 年 1 月 10 日
編集済み: birdman.56 2014 年 1 月 10 日
Okay. I got a line to show up at predefined location. However, after I moved it and double clocked my position variable didn't update with the new position.
Also, I am trying to get another line segment to show at the same time, which shares an end point with the other one. But when I drag the first line endpoint the relation doesn't hold... Is there any way I can the other one move relatively (i.e. drag them at the same time with one endpoint).
Thanks for the help. My code I used is below.
rgb = imread('coloredChips.png');
imshow(rgb)
d = imline(gca,[0 10],[0 100]);
api = iptgetapi(d);
pos = api.getPosition();

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by