IMcPatternMatchingFindSearchPattern Method
|
|
Finds coordinates of best match of pattern set by SetSearchPattern.
Namespace:
MediaCy.IQL.Align
Assembly:
MediaCy.IQL.Align (in MediaCy.IQL.Align.dll) Version: 10.0.6912.0
SyntaxFunction FindSearchPattern (
Optional NumExpectedObjects As Integer = 1,
Optional Threshold As Double = 0,
<OptionalAttribute> vImage1 As Object,
<OptionalAttribute> <OutAttribute> ByRef vOutRanks As Object
) As Object
Parameters
- NumExpectedObjects (Optional)
- Type: SystemInt32
number of expected objects to find. - Threshold (Optional)
- Type: SystemDouble
search threshold in range from 0 to 1. Default is 0, which will find all candidates. - vImage1 (Optional)
- Type: SystemObject
- vOutRanks (Optional)
- Type: SystemObject
Return Value
Type:
ObjectvOutValues - two dimensional array of arrays of AFFINE_TRANSFORM records corresponded to positions of
found objects on given frame. The first dimension of the array is [NumberOfFrames of Target image]
the number of elements in each element if equal or less than [NumExpectedObjects].
The array of AFFINE_TRANSFORM records is sorted by rank, so the objects in the beginning
of the array have higher correlation coefficients (matching degree).
vOutRanks - optional parameter. If provided, correlation ranks for every objects are returned in 2D array of doubles.
The array dimensions are the same as for vOutValues.
RemarksIf the same search pattern is used on multiple images, then using single call to SetSearchPattern
with multiple FindSearchPattern is faster then using FindPattern calls.
Examples
Dim Im1 As McImage, Ref As McImage
Set Im1 = ActiveImage
ThisApplication.ActiveImage.Aoi.Reset
ThisApplication.ActiveImage.Aoi.SetBox 0, 62, 48, 83, 70
Set Ref = ThisApplication.ActiveImage.Duplicate
Im1.Aoi.Reset
Im1.PatternMatching.CorrelationMethodFFT.DoRotation = False
Im1.PatternMatching.CorrelationMethodFFT.DoScaling = False
Im1.PatternMatching.CorrelationMethodFFT.CorrelationMethod = mcCorrelationFFTPhase
Dim vOut, vRanks
vOut = Im1.PatternMatching.FindPattern(Ref, 50, 0.5, , vRanks)
Debug.Print "Transforms:" & GlobalTools.McToText(vOut).Value
Debug.Print "Ranks: " & GlobalTools.McToText(vRanks).Value
See Also