我想用一个使用Emgu形状为圆形(未填充)的内核来卷积我的图像。 我找到了适合我需要的ConvolutionKernelF(Gaussian Noise in emgucv)。
有人知道如何在这个内核中绘制圆圈吗?没有抗锯齿。 使用圆形内核进行卷积的另一种简单方法也很受欢迎。
我试过了:
Image<Gray, float> kernel = new Image<Gray, float>(radius * 2 + 1, radius * 2 + 1);
kernel.Draw(new CircleF(new Point(radius, radius), radius), new Gray(1.0), 1);
ConvolutionKernelF ckernel = new ConvolutionKernelF(kernel.Data); // error
kernel.CopyTo(ckernel);
不幸的是,第三个声明给了我:
Argument 1: cannot convert from 'float[*,*,*]' to 'float[*,*]'
此外,它看起来效率不高。
干杯,
汤姆
答案 0 :(得分:0)
好的,我是这样做的:
Image<Gray, float> kernel = new Image<Gray, float>(radius * 2 + 1, radius * 2 + 1);
kernel.Draw(new CircleF(new Point(radius, radius), radius), new Gray(1.0), 1);
CvInvoke.cvFilter2D(A, B, kernel, new Point(-1, -1));