03-04-2010 07:43 AM
Hello, I'm trying to pattern match to letters on a VF backlit display. Sometimes the letters are slightly dimmer or brighter than the learned .png template and the matchscore returns 0. I just want to know that it's the correct letter and don't care much about the intensity of the letter. The matching seems much too sensitive to intensity. Here is a portion of VB6 code I am using with .png templates. I don't know if the MatchOptions are setup the best for what I am trying to do. I've tried adjusing the mincontrast and changed rotinvariant to shiftinvariant, with mixed results. I don't know what matchfactor is for. There might be more options I could use, but don't know about.
MatchOptions.MatchFactor = 0
MatchOptions.MatchMode = cwimaqMatchRotationInvariant
MatchOptions.MinimumContrast = 30
MatchOptions.MinimumMatchScore = 500
MatchOptions.NumMatchesRequested = 1
MatchOptions.RotationAngleRanges.Add 2
MatchOptions.RotationAngleRanges(1).Min = -20
MatchOptions.RotationAngleRanges(1).Max = 20
MatchOptions.RotationAngleRanges(2).Min = 0
MatchOptions.RotationAngleRanges(2).Max = 0
MatchOptions.SubPixelAccuracy = 0
SearchRect.Initialize X, Y, DX, DY
'Draw Rectangle box for Searching
frmMain.CWIMAQViewer1.Image.Overlays(1).DrawRectangle SearchRect, cwimaqOverlayModeFrame, vbYellow
' frmMain.CWIMAQViewer1.Refresh
'Match Template to Image In Search Box
frmMain.CWIMAQVision1.MatchPattern2 frmMain.CWIMAQViewer1.Image, frmMain.CWIMAQViewer2.Image, MatchOptions, Matchreport, SearchRect
03-05-2010 02:21 PM
Hi Dan,
Match Factor appears to be the Match List Reduction Factor.