Emgu 在windows server 2008系统使用时报错
一 错误说明
Emgu 在windows server 2008系统使用时报如下错误:
System.TypeInitializationException: The type initializer for ‘Emgu.CV.CvInvoke’ threw an exception. —> System.DllNotFoundException: Unable to load DLL ‘cvextern’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Emgu.CV.CvInvoke.RedirectError(CvErrorCallback errorHandler, IntPtr userdata, IntPtr prevUserdata)\r\n at Emgu.CV.CvInvoke…cctor()
— End of inner exception stack trace —
at Emgu.CV.CvInvoke.cvCreateImageHeader(Size size, IplDepth depth, Int32 channels)
at Emgu.CV.Image2.AllocateData(Int32 rows, Int32 cols, Int32 numberOfChannels) at Emgu.CV.Image
2.set_Bitmap(Bitmap value)
at VerifyID.Managers.ImageTreatmentsManager.ExtractDocumentFromImage(Bitmap bitmap)
at VerifyID.VerifyWorker.ExecuteOCR(BigIdRequest request, BigIdEvent bigIdEvent)
注意点
我在 x86 和 x64 文件夹下有下面库文件
concrt140.dll* liblept172.dll* msvcp140.dll* vcruntime140.dll*
cvextern.dll* libtesseract304.dll* opencv_ffmpeg320.dll*
二 解决方法
1 安装相应系统的 Desktop Experience Overview
2 将程序对应 emgu x86 或 x64目录 文件拷贝出来
备注: 在windows server 2012 一切正常, 但 windows server 2008 需要拷贝出来,不然会出现异常, 很困惑,如果后面明白为什么,也会贴出来
window server 2008的Desktop Experience Overview安装方法:
https://jingyan.baidu.com/article/ce09321b976c202bff858f17.html
三 方法出处:
https://github.com/emgucv/emgucv/issues/58