namespace circle_detection { public partial class Form1 : Form { private Capture capturez; void InitializeInstanceFields() { capturez = new Capture(); } public Form1() { InitializeInstanceFields(); InitializeComponent(); } 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; } } }
CircleF
circlez
for (int i =0; i<=circlez.Length; i++) { imagez7.Draw(circlez[i], new Gray(255), 3); }
for (int i =0; i<=circlez.Length-1; i++) { imagez7.Draw(circlez[i], new Gray(255), 3); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)