How to work out Pythagoras Error from image points?
Show older comments

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!
Answers (1)
Walter Roberson
on 1 Nov 2017
0 votes
pdist2()
2 Comments
DocD
on 2 Nov 2017
Walter Roberson
on 2 Nov 2017
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.
Categories
Find more on Neighborhood and Block Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!