0
我正在使用HorgeCircleTransformation类的AForge来检测圆。我想在检测到圆圈的图像上绘制圆圈(以突出显示原始图像上的圆圈)。我如何修改'foreach循环'来做到这一点?应用hough变换后在图像上绘制圆圈?
public Bitmap hough(Bitmap bmp)
{
HoughCircleTransformation circleTransform = new HoughCircleTransformation(35);
// apply Hough circle transform
circleTransform.ProcessImage(bmp);
Bitmap houghCirlceImage = circleTransform.ToBitmap();
// get circles using relative intensity
HoughCircle[] circles = circleTransform.GetCirclesByRelativeIntensity(0.5);
int numCircles = circleTransform.CirclesCount;
MessageBox.Show("Number of circles found : " + numCircles.ToString());
foreach (HoughCircle circle in circles)
{
//code to draw circle
}
return bmp;
}