我是EmguCV的新手,当我尝试使用GPUInvoke.SwapChannel
和GPU.Convolution
时,我得到了:
类型' Emgu.CV.Util.CvException'的第一次机会异常。发生了 在Emgu.CV.dll中
这是我的代码
Image<Rgb, Byte> img = new Image<Rgb, byte>(StringA);
GpuImage<Rgb, Byte> gpi = new GpuImage<Rgb, byte>(img);
int[] a = new int[4];
a[0] = 4;
a[1] = 3;
a[2] = 2;
a[3] = 1;
GpuInvoke.SwapChannels(gpi, a, IntPtr.Zero);
Image<Rgb, Byte> im = gpi.ToImage();
pictureBox2.Image = im.ToBitmap();
和这个
Image<Rgb, Single> img = new Image<Rgb, Single>(StringA);
GpuImage<Rgb, Single> gpi = new GpuImage<Rgb, Single>(img);
float[,] k = {{1,2,3,1,2},
{2,4,5,4,2},
{3,5,6,5,3},
{2,4,5,4,2},
{1,2,3,2,1}};
ConvolutionKernelF kernel = new ConvolutionKernelF(k);
GpuImage<Rgb, Single> gp = gpi.Convolution(kernel, new Emgu.CV.GPU.Stream());
Image<Rgb, Single> im = gp.ToImage();
pictureBox2.Image = im.ToBitmap();