如何在 openCV C++ 上填充圆圈

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18886083/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 22:18:34  来源:igfitidea点击:

How fill circles on openCV C++

c++opencvgeometrycomputer-vision

提问by Samuel Freitas

Using openCV, how can I fill some circles found using the HoughCircles in C++? This Circles will be used to create a mask on a image. There is a better way to do this?

使用 openCV,如何填充使用 C++ 中的 HoughCircles 找到的一些圆圈?此圆圈将用于在图像上创建蒙版。有没有更好的方法来做到这一点?

Thanks.

谢谢。

回答by Haris

You can pass thickness of the circle out line to CV_FILLED or -1 to fill the circle like

您可以将圆外线的厚度传递给 CV_FILLED 或 -1 以填充圆,例如

circle(img, Point(50,50),50, Scalar(255,255,255),CV_FILLED, 8,0);

See OpenCV Docfor more info.

有关更多信息,请参阅OpenCV 文档