【发布时间】:2015-03-27 03:43:03
【问题描述】:
我对 emgu 完全陌生。我一直在寻找这个问题的解决方案,但我找不到任何解决方案。我正在尝试使用内置的自适应阈值函数对给定图像进行阈值处理,但程序无一例外地退出
代码:
public Image<Gray, byte> AdaptiveThreshold(Image<Bgr, byte> bmp, int windowSize)
{
Image<Gray, byte> gray = new Image<Gray, byte>(bmp.ToBitmap());
Image<Gray, byte> bw = gray.ThresholdAdaptive(new Gray(255), Emgu.CV.CvEnum.ADAPTIVE_THRESHOLD_TYPE.CV_ADAPTIVE_THRESH_MEAN_C, Emgu.CV.CvEnum.THRESH.CV_THRESH_OTSU, windowSize, new Gray(0.03));
return bw;
}
函数调用:
this.pictureBox1.Image = r.AdaptiveThreshold(this.bmp, 15).ToBitmap(); // here where the application exit with no error and with no output in pictureBox1
r is an object of class which contains AdaptiveThreshold defined above
我将所有未管理的二进制文件从 bin 文件夹 emgucv-windows-universal-cuda 2.9.0.1922\bin\x86 复制到我的调试文件夹中,我还将 Emgu Dlls 添加到我的项目引用 Emgu.CV、Emgu.CV.UI , Emgu.Util 我还将我的目标平台设置为 x86 我正在 windows 8 下的 Visual Studio 2013 上工作。
【问题讨论】:
-
您的问题到底是什么?当您的应用程序毫无例外地退出时,我似乎不仅仅是一个问题。我认为缺少一些细节。预期的结果是什么?还有一些调用此函数的代码可能会有所帮助
标签: c# opencv dll build emgucv