![](/img/trans.png)
[英]How can I draw a circle using linerenderer and make it the circle as object child of the object is should draw around?
[英]How can I draw a circle with antialiasing and gaussian line intensity using EmguCV (OpenCV)?
我需要畫出最完美的圓圈。 EmguCV似乎缺乏抗鋸齒選項。
我正在嘗試使用SmoothGaussian,但圓圈仍然不夠好/光滑。
此外,圓線強度應具有高斯形狀(即:在中心更亮)。
我怎樣才能做到這一點?
這是我現在正在做的事情:
using (Image<Gray, Byte> img = new Image<Gray, byte>(800, 800, new Gray(0)))
{
PointF center = new PointF(img.Width / 2, img.Height / 2);
//Center line
float r = 200.0f;
CircleF circle = new CircleF(center, r);
img.Draw(circle, new Gray(255), 1);
img._SmoothGaussian(7, 7, 3, 3);
}
如果您使用Brg,Brga或Grey顏色,您可以使用該黑客:
using(var graph = Graphics.FromImage(image.Bitmap))
{
graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
graph.DrawEllipse(new Pen(color.BackColor), x, y, d`i`ameter, diameter);
}
`編輯:你也可以使用cvInvoke
var center = new Point(x, y);
var color = new Bgr(this.color.BackColor);
CvInvoke.cvCircle(image.Ptr, center, radius, color.MCvScalar, thickness, Emgu.CV.CvEnum.LINE_TYPE.CV_AA, 0);
`
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.