siavashk / pycpd

Pure Numpy Implementation of the Coherent Point Drift Algorithm
MIT License
510 stars 115 forks source link

Transformation with small number of points and fixed scale of 1.0 #84

Closed GeomRJ closed 1 year ago

GeomRJ commented 1 year ago

A point list with about 10 points is to be transformed. However, of these 10 points, only 3 points match the target point set. All others are to be ignored. The scale factor is fixed at 1.0. The tests with 10 points did not give a usable result (s_reg= 0.1591229754). Only with the 3 matching points the result was correct, but the scale factor was 0.9998774093 although s=1.0 was passed. Is it possible to solve this problem with PYCPD?

Example data sets:

Source Data 120.0000 120.0000 116.8168 91.1093 130.5683 141.9590 98.6609 82.2620 124.3115 124.2831 123.2244 165.7592 163.1087 123.1000 166.3159 121.9226 150.1782 89.1302 160.1123 102.0151

Source Data with only matching points 98.6609 82.2620 123.2244 165.7592 160.1123 102.0151

Target original data 666498.735 5158548.881 666450.520 5158621.326 666523.059 5158608.670

translation by -666300 -5158400 target test data set 198.7350 148.8810 150.5200 221.3260 223.0590 208.6700

Test_with_matching_points Test_with_all_points

GeomRJ commented 1 year ago

Test code an data: Test_rigid_2D.zip

gattia commented 1 year ago

Do you know what 3 points in the 10 pt cloud are supposed to be matching? Or is that part of the problem you are trying to solve?Sent from my iPhoneOn Mar 19, 2023, at 11:27 AM, GeomRJ @.***> wrote: Reopened #84.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

GeomRJ commented 1 year ago

no the 3 matching points are not known from the start, this should also be recognized by the app. The solution can only be found if the scale factor is fixed at 1.0.

Briefly the explanation of the task in the area of the land survey: the 3 or more target points are measured with GPS device, accuracy about +/- 20-25 mm, the points called source are measured with a total station, several points are connected by a traverse, coordinate accuracy about +/- 3-8 mm, in this list are also included the measurements on the target points, but always in the local system. Now the local points are to be transformed into the global system, the scale factor must remain 1.0, because the accuracy of the measurement of the total station is more better than that of the GPS measurement.

gattia commented 1 year ago

@GeomRJ sorry for the delay here. I am assuming you are using a pip installed version? If so, pip does not yet have the ability to hard code s so while you might be passing this variable pycpd is ignoring it for now.

If you clone the repository and install based on the instructions on the readme this should work - I ran your example with a version stalled from the repository and it worked as you would expect.

I am closing - please open if this does not solve your issue.