Hello,
I'm using Vision Module 8.5 and imaq VC++ 6.0/VB 2005
/ / The following access code from the clipboard image
/ / SaveObject2Bitmap (m_ImageMinuend, bmTemplate);
/ / CopyBitmapToClipboard (NULL, bmTemplate, NULL);
ImaqClipboardToImage (imTemplate, NULL);
/ / Pattern Match: Learning
ImaqLearnPattern success = (imTemplate, IMAQ_LEARN_ALL);
If (! Success)
(
Char * err = imaqGetErrorText (imaqGetLastError ());
:: MessageBox (NULL, err, "Error Learning Pattern", MB_OK | MB_ICONERROR);
ImaqDispose (err);
Goto FailMatch;
)
/ / The following access code from the clipboard image
/ / SaveObject2Bitmap (m_ImageMinuend, bmSearch);
/ / CopyBitmapToClipboard (NULL, bmSearch, NULL);
ImaqClipboardToImage (imSearch, NULL);
/ / Golden Template: Learning
ImaqLearnGoldenTemplate success = (imTemplate, IMAQ_NO_OFFSET, NULL); / / error,
/ / Error usually: Invalid image border.
But it done in VB 2005:
'Learn template
CWIMAQVision1.LearnPattern2(TemplateImage, LearnOptions)
CWIMAQVision1.LearnGoldenTemplate(TemplateImage)
'Perform the Inspection
MatchReport.Item(1).Position.CopyTo(Alignment.Position)
Alignment.Angle = MatchReport.Item(1).Angle
Alignment.ScalePercentage = 100
GoldenTemplateOptions.BrightThreshold = 100
GoldenTemplateOptions.DarkThreshold = 100
GoldenTemplateOptions.EdgeThicknessToIgnore = 1
CWIMAQVision1.CompareGoldenTemplate(CurImage, TemplateImage, Alignment, GoldenTemplateOptions, DefectImage, DefectImage) 'No
whether the use of function ImaqLearnGoldenTemplate properly? Jifen reply, Thanks!