////////////////////////////////////////////////////////////////////////////////////////////////////////////// private void frmDemo_Shown(object sender, EventArgs e) { TGMTregistry.GetInstance().Init("IPSS"); bikeDetector = new IPSSbike(); if (bikeDetector == null) { return; } CheckForIllegalCrossThreadCalls = false; this.KeyPreview = true; txtIpAddress.Text = TGMTregistry.GetInstance().ReadRegValueString("cameraAddress"); chkEnableLog.Checked = TGMTregistry.GetInstance().ReadRegValueBool("EnableLog"); bikeDetector.EnableLog = chkEnableLog.Checked; chkCrop.Checked = TGMTregistry.GetInstance().ReadRegValueBool("CropResultImage"); chkSaveInputImage.Checked = TGMTregistry.GetInstance().ReadRegValueBool("SaveInputImage"); chk_enableDeepScan.Checked = bikeDetector.EnableDeepScan; 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 += " " + bikeDetector.Version; this.Text += bikeDetector.IsLicense ? " (Licensed)" : " (Vui lòng liên hệ: 0939.825.125)"; }
private void Form1_Load(object sender, EventArgs e) { //Init class IPSSbike detector = new IPSSbike(); //OPTIONs //đườ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 BikePlate result = detector.ReadPlate(@"8892.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ố (phải có key mới trả về kết quả) //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; }