public bool FindSharpTemplate(string ccdName, HObject srcImg, RectangleF searchArea, out MatchingResult result) { result = new MatchingResult(); // if (!IsLoadOK) return false; Matching.InitMatchingParam(this); if (!Matching.FindShapeModel(srcImg, searchArea, out result)) { Logger.PopError(ccdName + "查找模板失败!"); return(false); } return(true); }
public bool Load(string path) { if (Matching == null) { Matching = new MatchingModule(); Matching.InitMatchingParam(this); } //string tempName = path + "ModelImage.shm"; TemplatePath = path; if (!FileLib.DirectoryEx.Exist(TemplatePath, false)) { return(false); } IsLoadOK = Matching.LoadShapeModel(TemplatePath); return(IsLoadOK); }
public St_TemplateParam(bool isInit = true) { MatchingType = En_TemplateMatchingType.形状匹配; StartAngle = -10; EndAngle = 10; Level = 5; Score = 70; Scale = 1.0; CenterX = 0; CenterY = 0; TemplateAngle = 0; OffsetXMax = 5; OffsetXMin = -5; OffsetYMax = 5; OffsetYMin = -5; Matching = new MatchingModule(); IsLoadOK = false; TemplatePath = ""; MaxError = 50; Area = 50; ContLength = 0; Matching.InitMatchingParam(this); }