public static VectorOfVectorOfPoint findApproxContours(IImage image, int threshold = 140)
 {
     return(ContourFinder.getApproxContour(
                ContourFinder.findContours(
                    ImageTransformAlgorithms.getThreshold(
                        ImageTransformAlgorithms.pyramideDec(image), threshold))));
 }
예제 #2
0
 private void pyrDecButton_Click(object sender, EventArgs e)
 {
     try
     {
         imageBox2.Image = ImageTransformAlgorithms.pyramideDec(imageBox1.Image);
     }
     catch (NullReferenceException ex)
     {
         MessageBox.Show(ex.Message, "Null Reference Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }
 public static List <CircleF> getCircles(IImage image, int threshold = 140, int minDistance = 10, int acTreshold = 36, int minRadius = 0, int maxRadius = 100)
 {
     // Hough algorithm
     return(new List <CircleF>(CvInvoke.HoughCircles(
                                   ImageTransformAlgorithms.getThreshold(ImageTransformAlgorithms.pyramideDec(image), threshold),
                                   HoughType.Gradient,
                                   /*2.0,*/ 1.0,
                                   minDistance,
                                   100,
                                   acTreshold,
                                   minRadius,
                                   maxRadius
                                   )));
 }
예제 #4
0
 private void thresholdButton_Click(object sender, EventArgs e)
 {
     try
     {
         imageBox2.Image = ImageTransformAlgorithms.getThreshold(
             ImageTransformAlgorithms.pyramideDec(imageBox1.Image), int.Parse(textBox1.Text));
     }
     catch (FormatException ex)
     {
         MessageBox.Show(ex.Message, "Fromat Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     catch (NullReferenceException ex)
     {
         MessageBox.Show(ex.Message, "Null Reference Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
 }