Beispiel #1
0
        private void btnCalibrationImg_Click(object sender, EventArgs e)
        {
            if (calibrationImage == null)
            {
                Image <Bgr, byte> resultImg = new Image <Bgr, byte>(binaryImg.Bitmap);
                foreach (PointF item in imageInfo.ImageCorner)
                {
                    CvInvoke.Circle(resultImg, new Point((int)item.X, (int)item.Y), 8, new MCvScalar(0, 2, 255), 8);
                }
                for (int i = 0; i < 4; ++i)
                {
                    Point p1 = new Point((int)imageInfo.ImageCorner[i].X, (int)imageInfo.ImageCorner[i].Y);

                    Point p2 = new Point((int)imageInfo.ImageCorner[(i + 1) % 4].X, (int)imageInfo.ImageCorner[(i + 1) % 4].Y);
                    CvInvoke.Line(resultImg, p1, p2, new MCvScalar(200, 255, 0), 12);
                }
                calibrationImage = new frmCalibrationImage(new Bitmap[2] {
                    myImg.Bitmap, resultImg.Bitmap
                });
                calibrationImage.Show();
            }
            else
            {
                calibrationImage.Activate();
                calibrationImage.Show();
            }
        }
Beispiel #2
0
 private void btnCalibrationImgClick(Bitmap[] bitmaps)
 {
     calibrationImage = new frmCalibrationImage(bitmaps);
     calibrationImage.Show();
 }