according to diagram, i have an object in time 't' with a special position and in 't+1' in which it moved to another position, how can I find the moving direction? these spot (blue and red) are an object in two binary images (time 't' and 't+1')

 채택된 답변

Thorsten
Thorsten 2014년 12월 15일

0 개 추천

If the object has position (x1, y2) at time t and (x2, y2) at time t+1, it moved in the direction (x2 - x1, y2 -y1).

댓글 수: 4

Abo
Abo 2014년 12월 15일
for instance, the first position was (2,4) and the second one (4,6), regarding your answer: result is (2,2). in the second example, if the object move from position (4,6) to (2,4) we have: (-2,-2). how can I find direction according to your answer in matlab?
P1 = [2 4]; P2 = [4 6];
D = P2 - P1;
Abo
Abo 2014년 12월 16일
thank you for your answer. please let me know how can I draw this direction and how can I define this direction as positive or negative?
Thorsten
Thorsten 2014년 12월 16일
In general you should start a new question if you have a new question. In this case I answer it anyway: Draw an arrow from P1 to P2, google it if you don't know how to draw arrows in Matlab; and the values you get could be positive or negative... That gives you some idea how to define a direction as positive or negative :-)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

질문:

Abo
2014년 12월 15일

댓글:

2014년 12월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by