Algorithm(s) used to train this PMAlign pattern. The PMAlign pattern can only be executed using the algorithms that were enabled at train-time. The algorithm actually used at run-time is specified in ICogPMAlignRunParams.
Namespace: Cognex.VisionPro.PMAlignAssembly: Cognex.VisionPro.PMAlign (in Cognex.VisionPro.PMAlign.dll) Version: 93.1.0.0
Syntax
Property Value
Type: CogPMAlignTrainAlgorithmConstantsEvents
| Event Type | Reason |
|---|---|
| CogPMAlignPattern Changed | Fires when the value of this property changes. The following state flag may be affected: |
| CogPMAlignPattern Changed | Fires when the value of this property changes and the pattern was untrained. The following state flags may be affected: |
Remarks
A CogPMAlignTrainAlgorithmConstants specifying the algorithm(s) used to train this PMAlign pattern. The PMAlign pattern can only be executed using the algorithms that were enabled at train-time. The algorithm actually used at run-time is specified in CogPMAlignRunParams that you specify for the search.
Default Value: PatMaxAndPatQuick if Cognex security for PatMax is available, PatQuick if not.
Examples
Imports Cognex.VisionPro Imports Cognex.VisionPro.PMAlign Private myPattern As CogPMAlignPattern Private myParams As CogPMAlignRunParams Private myResults As CogPMAlignResults Private Sub doTrain() myPattern = New CogPMAlignPattern myParams = New CogPMAlignRunParams myResults = New CogPMAlignResults myPattern.TrainAlgorithm = CogPMAlignTrainAlgorithmConstants.PatMaxAndPatQuick myPattern.TrainMode = CogPMAlignTrainModeConstants.Image myPattern.TrainImage = anImage myPattern.TrainRegion = trainRect myPattern.TrainRegionMode = CogRegionModeConstants.PixelAlignedBoundingBox myPattern.Origin.TranslationX = trainRect.CenterX myPattern.Origin.TranslationY = trainRect.CenterY myPattern.Train() end sub
using Cognex.VisionPro; using Cognex.VisionPro.PMAlign; private CogPMAlignPattern myPattern; private CogPMAlignRunParams myParams; private CogPMAlignResults myResults; private void doTrain() { myPattern = new CogPMAlignPattern(); myParams = new CogPMAlignRunParams(); myResults =new CogPMAlignResults(); myPattern.TrainAlgorithm = CogPMAlignTrainAlgorithmConstants.PatMaxAndPatQuick; myPattern.TrainMode = CogPMAlignTrainModeConstants.Image; myPattern.TrainImage = anImage; myPattern.TrainRegion = trainRect; myPattern.TrainRegionMode = CogRegionModeConstants.PixelAlignedBoundingBox; myPattern.Origin.TranslationX = trainRect.CenterX; myPattern.Origin.TranslationY = trainRect.CenterY; myPattern.Train(); }
See Also