[vtkusers] Difference between two surfaces.

Sebastien BARRE seb-ml-vtk at barre.nom.fr
Mon Jan 15 14:21:08 EST 2001


At 15/01/2001 15:57, Andrew Maclean wrote:

>If I have a surface A, and a surface B, is it possible to generate a 
>difference map showing how much surface B differs from A.
>
>I envisage A to be a reference map of some terrain and B to the actual map 
>of the terrain (say scanned by radar or laser). So I want to calculate a 
>height map showing the difference of B from A. I cannot just subtract the 
>height in A from B because it is unlikely that the coordinates in A will 
>match those sampled in B.

Well, provided that both surfaces do not have the same topology, a naive 
approach would be :

a) Use some algorithm to first match both surfaces position and orientation 
(if needed)
b) then compute the Hausdorff distance between both.

With VTK :

a) I've posted a vtksbIterativeClosestPointTransform some weeks ago, check 
the archive :) Use it to register/match both surfaces.

b) If I find some time, I'll post my vtksbHausdorffDistanceToTarget class, 
but it's actually very easy to implement (do not forget to use a 
vtkPointLocator otherwise it takes forever).

Hum, actually It might not be very satisfying because it computes distance 
between points. So I guess you might also browse each point P of the 
surface A, then find the intersection between the line L starting from that 
point P toward the height direction, and the surface B. Do it also in the 
reverse direction. It (vtkCellLocator) will return a coordinate on B that 
does not have to be a point. Use that coordinate to compute the difference 
as a measure of the distance between A and B.

Good luck :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010115/cd4a699a/attachment.htm>


More information about the vtkusers mailing list