使用 emgu 图像读取 PNG 图像

本文关键字:图像 PNG 读取 使用 emgu | 更新日期: 2023-09-27 18:37:02

使用

bitmap.save(filename, ImageFormat.PNG)

我现在尝试阅读相同的图像

Image<Rgb, Byte> inpImage = new Image<Rgb, Byte>(dir + fn_only + "_ms.png")使用emgu图像。在运行时,我得到一个

System.TypeInitializationException 发生在 Emgu.CV.dll

例外:

System.TypeInitializationException: 'Emgu.CV.CvInvoke' 的类型初始值设定项 抛出了一个例外。---> System.DllNotFoundException: 无法加载 DLL 'opencv _core242':找不到指定的模块。(HRESULT的例外情况:0x8 007007E) at Emgu.CV.CvInvoke.cvRedirectError(CvErrorCallback errorHandler, IntPtr user data, IntPtr prevUserdata) at Emgu.CV.CvInvoke..cctor() ---内部异常堆栈跟踪结束--- at Emgu.CV.Image'2..ctor(String fileName)

当opencv_242存在时。在依赖关系检查中,它说NVCUDA丢失。我没有 GPU,在这种情况下不会有 NVCUDA。

我尝试了颜色类型RGB和BGR。

使用 emgu 图像读取 PNG 图像

//a way is first open the PNG in a bitmap
Bitmap bitmap = new Bitmap(dir + fn_only + "_ms.png");
//and read the bitman how image
Image<Rgb, Byte> inpImage = new Image<Rgb, Byte>(bitmap);

参考: http://www.emgu.com/wiki/index.php/Working_with_Images从位图创建图像