F_VN_FindReferenceKeyPointsInImageExp
Searches a reference image, represented by its 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_FindReferenceKeyPointsInImageExp : HRESULT
VAR_INPUT
ipSrcKeyPoints : ITcVnContainer;
ipSrcDescriptors : ITcVnImage;
ipRefKeyPoints : ITcVnContainer;
ipRefDescriptors : ITcVnImage;
nRefImageWidth : UDINT;
nRefImageHeight : UDINT;
ipEdgePoints : Reference To ITcVnContainer;
fMaxDist : REAL;
fMaxKnnRatio : REAL;
eNormType : ETcVnNormalizationType;
eAlgorithm : ETcVnEstimationAlgorithm;
fReprojThreshold : LREAL;
nMaxIterations : UDINT;
fConfidence : LREAL;
ipGoodMatches : Reference To ITcVnContainer;
ipInlierMask : Reference To ITcVnContainer;
hrPrev : HRESULT;
END_VAR
VAR_OUTPUT
aPerspectiveTransform : TcVnMatrix3x3_LREAL;
nNumberOfGoodMatches : UDINT;
nNumberOfInliers : UDINT;
END_VAR
Inputs
|
Name |
Type |
Description |
|---|---|---|
|
ipSrcKeyPoints |
KeyPoints of the source image, e.g. (ContainerType_Vector_TcVnKeyPoint) | |
|
ipSrcDescriptors |
Descriptors of the source image KeyPoints | |
|
ipRefKeyPoints |
KeyPoints of the reference image (ContainerType_Vector_TcVnKeyPoint) | |
|
ipRefDescriptors |
Descriptors of the reference image KeyPoints | |
|
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 the coordinates of the source image (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 |
Normalization type used for descriptor matching (HAMMING recommended for AKAZE, ORB, and BRISK. HAMMING2 is recommended for ORB if the ORB nBriefPoints parameter is 3 or 4. ) | |
|
eAlgorithm |
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) |
|
ipGoodMatches |
Reference To ITcVnContainer |
Returns a container with good matches (optional, set to 0 if not required; ContainerType_Vector_TcVnDMatch) |
|
ipInlierMask |
Reference To ITcVnContainer |
Returns a mask marking the inliers (optional, set to 0 if not required; ContainerType_Vector_SINT; only for RANSAC, LMEDS) |
|
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
aPerspectiveTransform |
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 |
Required License
TC3 Vision Matching