[vtkusers] ICP transformation matrix

Neill neillr at comp.leeds.ac.uk
Tue Mar 19 06:09:56 EST 2002


I've managed to download vtk compile it and render some point data.  I'm
now using the vtkIterativeClosestPointTransform class to match two point
sets as the code below.
--------------------------------------------------
vtkIterativeClosestPointTransform icptrans
	icptrans SetTarget profile1
	icptrans SetSource profile2
	icptrans SetMaximumMeanDistance 0.001
	icptrans StartByMatchingCentroidsOn
------------------------------------------------------
When I alter the original profile using vtkTransformPolyDataFilter and
view this it appears to have worked.

However I would like to obtain the actual values use within the
transformation matrix.

I've tried:
-----------------------------------------------------
vtkMatrix4x4 tranmat
tranmat DeepCopy [icptrans GetMatrix]

for {set j 1} {$j <= 4} {incr j} {
	for {set i 1} {$i <= 4} {incr i} {
		set elem [tranmat GetElement $j $i]
		puts "The element $j $i is: $elem"
	}
}
----------------------------------------------------

This does not appear to return what I would expect of a 4x4 transformation
matrix (output below).  Is the matrix in a different form or am I
attempting to obtain it wrong?


The element 1 1 is: 1.11233
The element 1 2 is: -0.000997572
The element 1 3 is: -6.35984
The element 1 4 is: -0.146388
The element 2 1 is: 0.00436371
The element 2 2 is: 1.10295
The element 2 3 is: 23.3.3673
The element 2 4 is: 0
The element 3 1 is: 0
The element 3 2 is: 0
The element 3 3 is: 1
The element 3 4 is: 0
The element 4 1 is: 0
The element 4 2 is: 0
The element 4 3 is: 0
The element 4 4 is: 0


Thanks for any assistance!

Neill Rank
School of Computing
University of Leeds




More information about the vtkusers mailing list