Affine transformation with scale rotate

Feel free to ask any question here
Post Reply
trudon01
Posts: 2
Joined: Sat Sep 17, 2016 6:27 pm

Affine transformation with scale rotate

Post by trudon01 »

Hi forum,

This software has been amazing first up, so thank you immensely for providing and actively supporting it!

I am currently working on a university project of lidar scans for a changing sample volume over time (drying therefore decreasing in size) in a petri dish, requiring highly accurate volume measurements. The petri dish sits on a marked up wooden base board with small drill holes used as a reference grid to assist in aligning & comparing multiple scans. I have imported the coordinates for the board grid into CC as a layer (assuming a Z of 0 and the first hole as reference 0,0 as X,Y), and imported the scan data as a separate layer. Unfortunately, the scanner heavily distorted the clouds in the Y axis, and this was easily overcome by applying an approximate Y factor of 0.2 on the Scale/Multiple tool (not the correct scale as currently unknown).

The problem is that, I cannot get the points between the two sets to align and scale correctly (i.e. transform). I have used the ‘align two point clouds by picking at least 4 points’ function, with all varying options selected ie. Adjust scale, rotation x/y/z, to XY to X etc selected/attempted to no success. The clouds come to the same Z = 0, with roughly the same X scale but Y always distorts no matter the process. It is important that the same method be used consistently, as there are many scans to analyse and accuracy in measurements is imperative.
Image 2
Image 2
Image 1.jpg (54.37 KiB) Viewed 1959 times
Image 1
Image 1
Image 2.jpg (16.31 KiB) Viewed 1959 times

An example of the hole coordinates for base-plate and scanned result are given below.

(SCAN)__ID__X__Y__Z......(BASE-PLATE)__ID__X__Y__Z
A2 -33.3321 1099.8889 226.0430........A2 025.0 126.0 0
A3 -07.1124 1098.8485 226.4802........A3 049.1 124.9 0
A4 016.3227 1098.6202 226.3501........A4 073.8 123.6 0
A5 041.1889 1099.1078 225.1989........A5 099.3 122.9 0
B2 -34.3609 1068.8546 226.3853........B2 026.2 100.5 0
B3 -09.1797 1067.3857 225.6675........B3 050.5 100.1 0
B4 015.3845 1066.6841 226.9746........B4 075.4 98.4 0
B5 040.1417 1068.0746 225.7801........B5 100.3 98.0 0
E2 -39.0780 0910.5215 226.8394........E2 024.3 24.6 0
E5 035.3827 0910.1904 224.9775........E5 100.5 23.5 0
F2 -39.7171 0880.6773 226.2889........F2 025.3 0.0 0
F3 -13.7557 0880.0922 226.2656........F3 050.2 0.0 0
F4 010.0377 0879.7043 225.3108........F4 075.8 0.0 0
F5 035.0825 0880.0424 226.8277........F5 101.3 0.0 0

Googling, the closes solution I could come to was searching for ‘affine translate xls’, first option providing a surveying affine transformation spreadsheet (6 parameters with weights) but limited to XY only, no Z. The results provided the following:

I 12094.9998 Σ wi xi Xi a1 0.9903532
II 71303.3233 Σ wi yi Yi b1 0.03767851
III -519.979261 Σ wi xi Yi a2 0.059619
IV 1792.38159 Σ wi yi Xi b2 1.8301616
V 12245.0943 Σ wi xi2 a0 -64.837571
VI 38971.1636 Σ wi yi2 b0 875.051515
VII -536.212857 Σ wi xi yi

|I have no idea how to bring these into the ‘Apply Transformation’ Matrix 4x4 option, or how to incorporate elevation scaling and rotation.
Could someone please tell me what I’m doing wrong, or suggest the simplest suggestion to get around this. If someone has a link to a coordinate (original and transformation) spreadsheet with weighting that can produce Matric 4x4 transformation parameters from my user selected points to align, I, and I’m sure many others would appreciate that too. I’m stuck, tried everything and researched to no avail. I’m at your mercy of you forum Gurus’.

Please give me a life line. :-)
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Affine transformation with scale rotate

Post by daniel »

In fact I just don't see how your clouds could match. No 4x4 matrix could fix your issue. Even non-rigid registration techniques can't help you in fact (anyway you can't expect reproducible and accurate results with such methods ;).

While the left and right parts seem to have a almost correct relative scale (i.e. the left red part roughly matches the left yellow part, and same thing for the right parts), their relative distance is totally different. You would have to increase the gap between the base plate parts of up to 90 (mm ?) to make them roughly match with the scan.

How did you acquire both set of points exactly? Can you share the original data with us? (you can also send them directly to me: cloudcompare [at] danielgm.net).
Daniel, CloudCompare admin
Post Reply