Exemple #1
0
        //////////////////////////////////////////////////////////////////////////////////////////////////////////////

        private void frmDemo_Shown(object sender, EventArgs e)
        {
            TGMTregistry.GetInstance().Init("IPSScar");
            carDetector = new IPSScar();
            if (carDetector == null)
            {
                return;
            }

            CheckForIllegalCrossThreadCalls = false;
            this.KeyPreview = true;

            txtIpAddress.Text = TGMTregistry.GetInstance().ReadRegValueString("cameraAddress");

            chkEnableLog.Checked      = TGMTregistry.GetInstance().ReadRegValueBool("EnableLog");
            carDetector.EnableLog     = chkEnableLog.Checked;
            chkCrop.Checked           = TGMTregistry.GetInstance().ReadRegValueBool("CropResultImage");
            chkSaveInputImage.Checked = TGMTregistry.GetInstance().ReadRegValueBool("SaveInputImage");

            txtFolderOutput.Text = TGMTregistry.GetInstance().ReadRegValueString("folderOutput");
            txtFailedDir.Text    = TGMTregistry.GetInstance().ReadRegValueString("txtFailedDir");
            txtValidDir.Text     = TGMTregistry.GetInstance().ReadRegValueString("txtValidDir");
            txtInvalidDir.Text   = TGMTregistry.GetInstance().ReadRegValueString("txtInvalidDir");

            this.Text += " " + carDetector.Version;
            this.Text += carDetector.IsLicense ? " (Licensed)" : " (Vui lòng liên hệ: 0939.825.125)";
        }
Exemple #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //khởi tạo đối tượng
            //Init class
            IPSScar detector = new IPSScar();

            //CÁC OPTION

            //đường dẫn chứa file output, nếu set null hoặc rỗng thì sẽ không save ảnh output
            //set output dir, if output dir is null or empty engine will not save output image
            detector.OutputFoler = @"D:\Result";


            //engine nhận tham số là ảnh hoặc đường dẫn đến ảnh
            //you can set input pameter is bitmap or image path
            CarPlate result = detector.ReadPlate(@"Test98.JPG");

            //kết quả trả về là class IPSSresult gồm nhiều thuộc tính
            //text là các ký tự biển số
            //result is a class contain some values
            //.text is plate character
            label1.Text = result.text;

            //bitmap là hình ảnh kết quả
            //bimap is image has returned
            Bitmap bmp = result.bitmap;

            pictureBox1.Image = bmp;

            //thời gian xử lý
            //elapsed time read plate
            int ms = result.elapsedMilisecond;

            //mã lỗi (nếu có)
            //error code to diagnostic
            string error = result.error;

            //nếu có biển số giá trị là true
            //.hasPlate is true when found plate in image
            bool hasPlate = result.hasPlate;

            //nếu đọc đủ các ký tự thì kết quả là true
            //.isValid is true when read enough character
            bool isValid = result.isValid;

            //biển số vuông hay biển số dài
            //.type is long or short plate
            label2.Text = result.type.ToString();
        }