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
Walter Roberson 2017 年 11 月 1 日

0 投票

pdist2()

2 件のコメント

DocD
DocD 2017 年 11 月 2 日
How would this work, can you give me an example of how to code that in the context of my example?
Walter Roberson
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.

サインインしてコメントする。

質問済み:

2017 年 11 月 1 日

コメント済み:

2017 年 11 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by