VladasZs
VladasZs

Reputation: 109

Calculate transformation matrix between 4 points in 3D space

I have 2 sets of 4 vertices of the same object, calculated from different position in 3D space. Like that:

Relative to position 1:
    p0 = [10.9651660037735,  -1732.84852242907, -2077.46947601362]
    p1 = [-28.2892402763447, -1731.04816455574, -2273.71719218789]
    p2 = [168.546146377346,  -1737.13196368097, -2312.30780650516]
    p3 = [206.483925998667,  -1738.21953548907, -2116.14490306792]

Relative to position 2:
    p0 = [-322.364164317381, -1161.90839935893, -2013.94533203480]
    p1 = [-240.373482014670, -1177.43805826682, -1832.26745097626]
    p2 = [-422.125535145367, -1172.37193516593, -1749.48740754854]
    p3 = [-504.665226201976, -1158.25483667854, -1931.16712127311]

The coordinates are received from analog sensors so it may have some inaccuracy. How can i calculate or approximate the transformation matrix between them?

Upvotes: 1

Views: 1666

Answers (1)

Spektre
Spektre

Reputation: 51845

If its "viewed" from different position and perspective is involved than shape and size might be different. So are you sure you do not have perspective involved? Many ranging sensors do include perspective like LIDAR , RADAR etc and some are countering it by processing other are not. So if the object is more distant to sensor is it still the same size or not?

  1. No perspective

    see Problem superimposing and aligning 3D triangles

    The idea is to create transform matrix for each object and then just convert one matrix to the other one.

  2. Perspective

    This is way more complicated. Either use fitting (slooooow) or use some prior knowledge of the sensor (ease up the fitting). Anyway if you have certain geometric features in "view" then you can avoid fitting see:

    that one exploits the fact that you know any 2 perpendicular planes with the points selected on the same altitude ... You can may be exploit similar properties of your data like known size of object or include markers into the "scene".

    After this you just un-project all the stuff you need and then proceed with #1

Upvotes: 1

Related Questions