C# - Emgu cv如何使用CvInvoke.cvLoadImage("ClassPic1.jpg")作为intptr从文件夹加载图像并访问它

Sis*_*say 3 invoke intptr emgucv loadimage

如何使用Emgu cv CvInvoke.cvLoadImage(...)从特定文件夹加载图像?我试着这样做

    IntPtr inputImage = CvInvoke.cvLoadImage("C:\\Users\\...\\ClassPic1.jpg");
Run Code Online (Sandbox Code Playgroud)

这可以吗?如果是这样,我将如何作为Emgu.CV.Image文件访问它,以便我将对其进行图像处理?

Shi*_*iva 9

您应该使用以下方法加载图像:

Image<Bgr, Byte> img1 = new Image<Bgr, Byte>("..\..\MyImage.jpg");// path can be absolute or relative.
Run Code Online (Sandbox Code Playgroud)

可以稍后访问此img1变量以对其执行操作.

查看此链接了解更多详情. http://www.emgu.com/wiki/index.php/Working_with_Images