private void btnOk_Click(object sender, EventArgs e) { if (this.picTargetPerson.Image == null) { MessageBox.Show("请选定一张人脸图片"); return; } if (drawRectangle == Rectangle.Empty) { MessageBox.Show("请定位人脸"); return; } String imageFilePathAbsolute = this.picTargetPerson.Image.Tag as string; var ipl = OpenCvSharp.IplImage.FromBitmap((Bitmap)this.picTargetPerson.Image); ipl.ROI = this.drawRectangle.ToCvRect(); var info = new Damany.Imaging.Common.PersonOfInterest(ipl); info.ID = this.txtId.Text; info.Name = this.txtName.Text; info.Gender = Damany.Util.Gender.Male; info.Age = 0; mnger.AddNewPerson(info); MessageBox.Show("添加成功"); }
private void btnOk_Click(object sender, EventArgs e) { if (this.picTargetPerson.Image == null) { MessageBox.Show("请选定一张人脸图片"); return; } if (drawRectangle == Rectangle.Empty) { MessageBox.Show("请定位人脸"); return; } String imageFilePathAbsolute = this.picTargetPerson.Image.Tag as string; var ipl = OpenCvSharp.IplImage.FromBitmap((Bitmap) this.picTargetPerson.Image); ipl.ROI = this.drawRectangle.ToCvRect(); var info = new Damany.Imaging.Common.PersonOfInterest(ipl); info.ID = this.txtId.Text; info.Name = this.txtName.Text; info.Gender = Damany.Util.Gender.Male; info.Age = 0; mnger.AddNewPerson(info); MessageBox.Show("添加成功"); }