0
我試圖做一個關於如何使用HoughTransformation
類的AForge的實驗。我使用這個類來嘗試計算圖像上的圓圈數量。但我總是得到這個錯誤信息:源圖像的不支持的像素格式。 這裏是我的代碼:AForge Hough變換
private void CountCircles(Bitmap sourceImage)
{
HoughCircleTransformation circleTransform = new HoughCircleTransformation(15);
circleTransform.ProcessImage(sourceImage);
Bitmap houghCircleImage = circleTransform.ToBitmap();
int numCircles = circleTransform.CirclesCount;
MessageBox.Show("Number of circles found : "+numCircles.ToString());
}