Ask Your Question

HepsiPearl's profile - activity

2014-09-17 01:05:48 -0600 asked a question Index OutOfRange Exception was unhandled in opencv circle detection

Hello, am new one for computer vision , can anyone help me to solve the error?. I have an error in for loop condition.

private void timer1_Tick(object sender, EventArgs e) { double cannyThreshold = 180.0; double circleAccumulatorThreshold = 120; double cannyThresholdLinking = 160;

    Image<Bgr, Byte> imagez5 = capturez.QueryFrame().Resize(400, 400, Emgu.CV.CvEnum.INTER.CV_INTER_LINEAR, true);
    pictureBox2.Image = imagez5.Bitmap;
    Image<Gray, Byte> gray = imagez5.Convert<Gray, Byte>().PyrDown().PyrUp();
    Image<Gray, byte> imagez7 = gray.Canny(cannyThreshold, cannyThresholdLinking);
    CircleF[] circlez = imagez7.HoughCircles(
        new Gray(cannyThreshold), new Gray(circleAccumulatorThreshold), 1, 60, 3, 300)[0];
    Image<Bgr, Byte> circleImage = imagez5.CopyBlank();


    for (int i =0; i<=circlez.Length; i++)
    {
        imagez7.Draw(circlez[i], new Gray(255), 3);

    }

        pictureBox1.Image = imagez7.Bitmap;

}

}