Exemplo n.º 1
0
        public void WriteParam(string fileName)
        {
            SetParam.WriteParam(fileName, "NumLevels", NumLevels.ToString());
            SetParam.WriteParam(fileName, "AngleStart", mStartingAngle.ToString());
            SetParam.WriteParam(fileName, "AngleExtent", mAngleExtent.ToString());
            SetParam.WriteParam(fileName, "AngleStep", AngleStep.ToString());
            SetParam.WriteParam(fileName, "Metric", Metric.ToString());
            SetParam.WriteParam(fileName, "MinScore", MinScore.ToString());
            SetParam.WriteParam(fileName, "NumMatches", NumMatches.ToString());
            SetParam.WriteParam(fileName, "MaxOverlap", mMaxOverlap.ToString());
            SetParam.WriteParam(fileName, "SubPixel", SubPixel.ToString());


            SetParam.WriteParam(fileName, "AutoNumLevels", IsAuto(AUTO_NUM_LEVEL).ToString());
            SetParam.WriteParam(fileName, "AutoAngleStep", IsAuto(AUTO_ANGLE_STEP).ToString());
        }
Exemplo n.º 2
0
        public void WriteHalconObj(string fileName)
        {
            string path = Path.GetDirectoryName(fileName);

            if (path == null || path == "\\")
            {
                return;
            }
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            if (ModelImg != null && ModelImg.IsInitialized())
            {
                ModelImg.WriteImage("bmp", 0, fileName + ".bmp");
            }
            if (nCCModel != null && nCCModel.IsInitialized())
            {
                HOperatorSet.WriteNccModel(nCCModel, fileName + ".ncm");
            }
            if (SearchRegion != null && SearchRegion.IsInitialized())
            {
                HOperatorSet.WriteRegion(SearchRegion, fileName + "se.tif");
            }
            if (ModelRegion != null && ModelRegion.IsInitialized())
            {
                HOperatorSet.WriteRegion(ModelRegion, fileName + "md.tif");
            }

            SetParam.WriteParam(fileName + "par.dat", "ModelImgRow", ModelImgRow.ToString());
            SetParam.WriteParam(fileName + "par.dat", "ModelImgCol", ModelImgCol.ToString());
            SetParam.WriteParam(fileName + "par.dat", "ModelimgAng", ModelimgAng.ToString());
            SetParam.WriteParam(fileName + "par.dat", "TimeOutEnable", TimeOutEnable.ToString());
            SetParam.WriteParam(fileName + "par.dat", "OutTime", OutTime.ToString());
            nCCParam.WriteParam(fileName + "par.dat");
        }