How to work out Pythagoras Error from image points?
이전 댓글 표시

Hi There,
How do you work out pythagoras error using matlab?
As an example if you look at the image attached I have a number of actual points (ten in total, referred to as actual positions) that are the x, y coordinates for various locations in an image, I want to create a mechanism that the user can select where they think these points are on an image (called user placed positions).
I'd like to calculate the pythagoras error for each user selected point in relation to the actual points held in an array.
So for the example provided, the error is the same as the hypotenuse of the triangle whose sides are 5 (7-2) and 2 (4-2 or D-B as it were). By simple Pythagorus' theorem, the error is the Square root of the sum of the two sides, ie. 5.2.
How would I do this?
I'd REALLY appreciate some help!
Many thanks!
답변 (1개)
Walter Roberson
2017년 11월 1일
0 개 추천
pdist2()
댓글 수: 2
DocD
2017년 11월 2일
Walter Roberson
2017년 11월 2일
actual_points = [0, 5];
user_point = [2, 0];
pdist2(user_point, actual_points)
actual_points can be a 2D array in which the rows are the desired coordinates of one point; pdist2() would then return the distance from user_point to each of the points described by a row in actual_points.
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!