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;
}