F_VN_FindReferenceKeyPointsInImageORBExp

F_VN_FindReferenceKeyPointsInImageORBExp 1:

Searches a reference image, represented by its ORB keypoints and corresponding descriptors, in a given source image. (expert function)
Can use available TwinCAT Job Tasks for executing parallel code regions.

Syntax

Definition:

FUNCTION F_VN_FindReferenceKeyPointsInImageORBExp : HRESULT
VAR_INPUT
    ipSrcImage            : ITcVnImage;
    ipRefKeyPoints        : ITcVnContainer;
    ipRefDescriptors      : ITcVnImage;
    nRefImageWidth        : UDINT;
    nRefImageHeight       : UDINT;
    ipEdgePoints          : Reference To ITcVnContainer;
    fMaxDist              : REAL;
    fMaxKnnRatio          : REAL;
    eNormType             : ETcVnNormalizationType;
    ipSrcImageMask        : ITcVnImage;
END_VAR
VAR_IN_OUT
    stOrbParams           : TcVnParamsORB;
END_VAR
VAR_INPUT
    eAlgorithm            : ETcVnEstimationAlgorithm;
    fReprojThreshold      : LREAL;
    nMaxIterations        : UDINT;
    fConfidence           : LREAL;
    hrPrev                : HRESULT;
END_VAR
VAR_OUTPUT
    aPerspectiveTransform : TcVnMatrix3x3_LREAL;
    nNumberOfGoodMatches  : UDINT;
    nNumberOfInliers      : UDINT;
END_VAR

F_VN_FindReferenceKeyPointsInImageORBExp 2: Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image

ipRefKeyPoints

ITcVnContainer

KeyPoints of the reference image, e.g. computed with F_VN_KeyPointsAndDescriptorsORB (ContainerType_Vector_TcVnKeyPoint)

ipRefDescriptors

ITcVnImage

Descriptors of the reference image KeyPoints, e.g. computed with F_VN_KeyPointsAndDescriptorsORB

nRefImageWidth

UDINT

Width of the reference image in pixels

nRefImageHeight

UDINT

Height of the reference image in pixels

ipEdgePoints

Reference To ITcVnContainer

Returns a container with the 4 edge points of the reference image transformed into ipSrcImage coordinates (ContainerType_Vector_TcVnPoint2_REAL)

fMaxDist

REAL

Maximum allowed descriptor distance (-1 disables this filter criterion)

fMaxKnnRatio

REAL

Maximum allowed distance ratio between first and second best match ([0..1], -1 disables this filter criterion)

eNormType

ETcVnNormalizationType

Normalization type used for descriptor matching (HAMMING recommended for ORB, HAMMING2 if the ORB nBriefPoints parameter is 3 or 4)

ipSrcImageMask

ITcVnImage

Mask to specify, where to look for keypoints in ipSrcImage (set to 0 if no mask required)

eAlgorithm

ETcVnEstimationAlgorithm

Estimation algorithm used for computing the perspective transformation between the two point sets

fReprojThreshold

LREAL

Maximum allowed reprojection error to treat a point pair as an inlier (only used if eAlgorithm is RANSAC, RHO)

nMaxIterations

UDINT

Maximum number of RANSAC iterations

fConfidence

LREAL

Confidence (0..1)

hrPrev

HRESULT

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

F_VN_FindReferenceKeyPointsInImageORBExp 3: In/Outputs

Name

Type

Description

stOrbParams

TcVnParamsORB

Parameters to configure the keypoint and descriptor computation for ipSrcImage (resulting descriptors must be compatible to ipRefDescriptors!)

F_VN_FindReferenceKeyPointsInImageORBExp 4: Outputs

Name

Type

Description

aPerspectiveTransform

TcVnMatrix3x3_LREAL

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

nNumberOfGoodMatches

UDINT

Return the number of good matches

nNumberOfInliers

UDINT

Return the number of inlier matches

F_VN_FindReferenceKeyPointsInImageORBExp 5: Return value

HRESULT

Required License

TC3 Vision Matching

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