DecomposeHomography

Decompose a homography matrix and verify four solutions of rotation, translation, and plane normal. It uses visible reference points being in front of the camera to confirm which solution(s) of the four solutions (maximum two solutions) are consistent with all reference points.

Syntax

Definition:

HRESULT DecomposeHomography(
    HRESULT              hrPrev,
    TcVnMatrix3x3_LREAL& aHomography,
    TcVnMatrix3x3_LREAL& aCameraMatrix,
    TcVnMatrix3x3_LREAL& aRotationMatrixA,
    TcVnVector3_LREAL&   aTranslationVectorA,
    TcVnVector3_LREAL&   aNormVectorA,
    TcVnMatrix3x3_LREAL& aRotationMatrixB,
    TcVnVector3_LREAL&   aTranslationVectorB,
    TcVnVector3_LREAL&   aNormVectorB,
    ULONG&               nSolutions,
    ITcVnContainer*      ipPointsSrc = nullptr,
    ITcVnContainer*      ipPointsDes = nullptr,
    ITcVnContainer*      ipInlierMask = nullptr
)

Parameters

Name

Type

Default

Description

hrPrev

HRESULT

 

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

aHomography

TcVnMatrix3x3_LREAL&

 

Homography matrix (a perspective transformation between two planes)

aCameraMatrix

TcVnMatrix3x3_LREAL&

 

Camera matrix

aRotationMatrixA

TcVnMatrix3x3_LREAL&

 

Rotation matrix of the first solution (Ra)

aTranslationVectorA

TcVnVector3_LREAL&

 

Translation vector of the first solution (Ta)

aNormVectorA

TcVnVector3_LREAL&

 

Norm vector of the first solution (Na)

aRotationMatrixB

TcVnMatrix3x3_LREAL&

 

Rotation matrix of the second solution (Rb)

aTranslationVectorB

TcVnVector3_LREAL&

 

Translation vector of the second solution (Tb)

aNormVectorB

TcVnVector3_LREAL&

 

Norm vector of the second solution (Nb)

nSolutions

ULONG&

 

Return the number of true potential solutions [0,1, or 2]. 0: no true potential solutions for the given corresponding points are confirmed. 1: the solution (Ra, Ta, Na) is confirmed. 2: both solution (Ra, Ta, Na) and (Rb, Tb, Nb) are confirmed. In all cases the function returns two solutions (Ra, Ta, Nb) and (Rb, Tb, Nb). The third and the fourth solutions can be calculated as follows: (Ra, -Ta, -Na) and (Rb, -Tb, -Nb).

ipPointsSrc

ITcVnContainer*

nullptr

Container with source points (ContainerType_Vector_TcVnPoint2_REAL)

ipPointsDes

ITcVnContainer*

nullptr

Container with destination points (same number as ipPoints1, ContainerType_Vector_TcVnPoint2_REAL)

ipInlierMask

ITcVnContainer*

nullptr

A mask marking the inliers (optional, set to 0 if not available; ContainerType_Vector_SINT or ContainerType_Vector_USINT)

DecomposeHomography 1: Return value

HRESULT

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision