Homography

Find the homography (perspective transformation) between two planar point sets.

Syntax

Definition:

HRESULT Homography(
    HRESULT                  hrPrev,
    ITcVnContainer*          ipSrcPoints,
    ITcVnContainer*          ipDestPoints,
    TcVnMatrix3x3_LREAL&     aPerspectiveTransform,
    ETcVnEstimationAlgorithm eAlgorithm = EA_DEFAULT,
    double                   fReprojThreshold = 3,
    ITcVnContainer**         pipInlierMask = nullptr,
    ULONG                    nMaxIterations = 2000,
    double                   fConfidence = 0.995
)

Parameters

Name

Type

Default

Description

hrPrev

HRESULT

 

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

ipSrcPoints

ITcVnContainer*

 

Container with at least 4 source points (ContainerType_Vector_TcVnPoint2_REAL)

ipDestPoints

ITcVnContainer*

 

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

aPerspectiveTransform

TcVnMatrix3x3_LREAL&

 

Returns the perspective transformation matrix, which transforms the source points to the destination points

eAlgorithm

ETcVnEstimationAlgorithm

EA_DEFAULT

Estimation algorithm

fReprojThreshold

double

3

Maximum allowed reprojection error to treat a point pair as an inlier (only for RANSAC, RHO)

pipInlierMask

ITcVnContainer**

nullptr

Returns a mask marking the inliers (optional, set to 0 if not required; ContainerType_Vector_SINT; only for RANSAC, LMEDS)

nMaxIterations

ULONG

2000

Maximum number of RANSAC iterations

fConfidence

double

0.995

Confidence (0..1)

Homography 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