Example #1
0
        private void CreateTemplate(string filename, string templatefilename = "")
        {
            Bitmap bmp = (Bitmap)Bitmap.FromFile(filename);
            MyDetectFeatureRectAngle dr = new MyDetectFeatureRectAngle(bmp);

            if (dr.Detected())
            {
                if (_artemplate != null)
                {
                    _artemplate.Clear();
                }

                _artemplate = new ARTemplate.Template(filename, bmp, dr.CorrectRect);
                _angle      = new AutoAngle(dr.ListPoint);            //或者导入时 设置
                if (templatefilename != "" && File.Exists(templatefilename))
                {
                    _artemplate.Load(templatefilename);
                }

                this.Hide();
                _artemplate.SetFeaturePoint(dr.ListFeatureRectangle, dr.CorrectRect);
                ARTemplate.FormTemplate f = new ARTemplate.FormTemplate(_artemplate);
                f.ShowDialog();
                this.Show();
            }
        }
Example #2
0
 private void InitTemplate(string templatefilename)
 {
     {
         Template t = new Template(templatefilename);
         if (t.Image != null)
         {
             _artemplate = t;
             List <Point> ListPoint = new List <Point>();
             foreach (Area I in t.Dic["特征点"])
             {
                 ListPoint.Add(I.ImgArea.Location);
             }
             if (ListPoint.Count == 3)
             {
                 _angle = new AutoAngle(ListPoint);
             }
         }
     }
 }
Example #3
0
        public FormM()
        {
            InitializeComponent();
            _workpath    = textBoxWorkPath.Text;
            _angle       = null;
            _artemplate  = null;
            _rundr       = null;
            _runnameList = null;
            _runmsg      = "";
            _exportdata  = "";
            _xztpos      = -1;
            _titlepos    = new Dictionary <string, int>();
            //for 二维码
            DecodingOptions decodeOption = new DecodingOptions();

            decodeOption.PossibleFormats = new List <BarcodeFormat>()
            {
                BarcodeFormat.All_1D
            };
            _br         = new BarcodeReader();
            _br.Options = decodeOption;
        }
Example #4
0
 public AutoComputeXZT(ARTemplate.Template _artemplate, AutoAngle _angle, System.Drawing.Bitmap bmp)
 {
     this._artemplate = _artemplate;
     this._angle      = _angle;
     this._src        = bmp;
 }