从HoughCircles中保存圆圈

时间:2014-02-09 15:15:09

标签: c# c++ opencv image-processing emgucv

我是图像处理新手,在我的应用程序中,我想将检测到的圆圈保存为新图像,以下代码用于存储检测到的圆圈。

CircleF[] circles = grayframeright_1.HoughCircles(
                        new Gray(cannyThreshold),
                        new Gray(circleAccumulatorThreshold),
                        2.0, //Resolution of the accumulator used to detect centers of the circles
                        20.0, //min distance
                        5, //min radius
                        0 //max radius
                        )[0]; //Get the circles from the first channel

emgu cv / open cv中是否有任何方法可以将圆圈保存为新图像?

请帮我解决这个问题,代码示例会很有用。

提前致谢

1 个答案:

答案 0 :(得分:0)

您可以绘制这些圈子并保存此新图片(查看this page了解更多详情):

#region draw circles
Image<Bgr, Byte> circleImage = img.CopyBlank();
foreach (CircleF circle in circles)
   circleImage.Draw(circle, new Bgr(Color.Brown), 2);   
circleImage.Save("C:/Circles.jpg");
相关问题