F_VN_DecomposeHomography

F_VN_DecomposeHomography 1:

Decompose a homography matrix into four solutions of rotation, translation, and plane normal. It 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).

Syntax

Definition:

FUNCTION F_VN_DecomposeHomography : HRESULT
VAR_IN_OUT
    aHomography         : TcVnMatrix3x3_LREAL;
    aCameraMatrix       : TcVnMatrix3x3_LREAL;
    aRotationMatrixA    : TcVnMatrix3x3_LREAL;
    aTranslationVectorA : TcVnVector3_LREAL;
    aNormVectorA        : TcVnVector3_LREAL;
    aRotationMatrixB    : TcVnMatrix3x3_LREAL;
    aTranslationVectorB : TcVnVector3_LREAL;
    aNormVectorB        : TcVnVector3_LREAL;
END_VAR
VAR_INPUT
    hrPrev              : HRESULT;
END_VAR
VAR_OUTPUT
    nSolutions          : UDINT;
END_VAR

F_VN_DecomposeHomography 2: Inputs

Name

Type

Description

hrPrev

HRESULT

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

F_VN_DecomposeHomography 3: In/Outputs

Name

Type

Description

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

F_VN_DecomposeHomography 4: Outputs

Name

Type

Description

nSolutions

UDINT

Returns the number of solutions. In normal cases, it is equal four.

F_VN_DecomposeHomography 5: Return value

HRESULT

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

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

Tc3_Vision