On the image above there is some geometrical pattern. Model a
distance is known. Points are not in model distance strictly.
I want to:
a
) the better point fits to pattern better quality coeficient it should have (I've tried to take distance and 45deg angle)What I've tried so far:
a - delta
and a + delta
Why it failed:
So the question is: what is the best algorithm to calculate points quality in this case, and fill pattern. Pattern should be filled by averaging position of element taking in account neighbours positions. The best answer will be pseudocode or code or reference to some known algorithm which can be helpful in this case.
Question is a little bit related with my previous question Filling rectangle with points pattern but the filling could not be done with wrong quality points.
If the error/distortion of the points does not get bigger when you go from left to right or top to bottom (i.e. the average distance a
between neighbouring good points is known exactly enough), you can try the following:
[0,a[ x [0,a[
by taking the remainder of x and y coordinates when dividing through a (generating Qi). Thus the good points will more or less be mapped onto one point. R
with the closest neighbours (e.g. sum up 1/distance
for all distances to other points Qj, j≠ i, and choose the one with maximal sum). If the point R (with the closest neighbours) has a coordinate close to 0 or a (i.e. R is close to the border of the square [0,a[ x [0,a[
), you better start from the beginning and add a/2
to the corresponding coordinate (of each Pi) before computing the remainder, in order to bring the point R more to the center of the square. (Or you manage to compute the minimal distance of the different possibilities of leaving the square [0,a[ x [0,a[
on one side and come back into it on the opposite side.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With