F_VN_MatchContours1vsN
Compare a reference contour with multiple other contours using the Hu moment invariants. Returns a sorted list of best matches.
Syntax
Definition:
FUNCTION F_VN_MatchContours1vsN : HRESULT
VAR_INPUT
ipRefContour : ITcVnContainer;
ipContours : ITcVnContainer;
ipMatchIndexes : Reference To ITcVnContainer;
ipDissimilarities : Reference To ITcVnContainer;
fDissimilarityThreshold : LREAL;
eComparisonMethod : ETcVnContoursMatchComparisonMethod;
hrPrev : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
ipRefContour |
Reference contour (ContainerType_Vector_TcVnPoint2_DINT or ContainerType_Vector_TcVnPoint2_REAL; The elements of this container are the points of the contour) | |
ipContours |
Collection of multiple contours (CTcVnContainer_Vector_Vector_TcVnPoint2_DINT) | |
ipMatchIndexes |
Reference To ITcVnContainer |
Returns the indexes of the best matches (CTcVnContainer_Vector_ULINT; sorted, first element is best match, i.e. has lowest dissimilarity) |
ipDissimilarities |
Reference To ITcVnContainer |
Returns the computed dissimilarities of the best matches (CTcVnContainer_Vector_LREAL; Optional, set to 0 if not required; sorted corresponding to ipMatchIndexes) |
fDissimilarityThreshold |
LREAL |
Neglect irrelevant matches, i.e. dissimilarity > fDissimilarityThreshold |
eComparisonMethod |
Method used for comparing the Hu moment invariants of the contours | |
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Required License
TC3 Vision Matching
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 |