gpt4 book ai didi

c# - 错误 'Emgu.CV.CvInvoke' 的类型初始值设定项引发了 C#、Opencv 和 EmguCv 的异常

转载 作者:行者123 更新时间:2023-11-30 18:34:11 32 4
gpt4 key购买 nike

我已经使用 EmguCV 在 C# 中编写了一个简单的程序来面对检测到的 VS 2010,但我收到以下异常:

The type initializer for 'Emgu.CV.CvInvoke' threw an exception.

我正在尝试修复此链接:http://www.emgu.com/wiki/index.php/Download_And_Installation#The_type_initializer_for_.27Emgu.CV.CvInvoke.27_threw_an_exception

我复制了所有的dll,但仍然出错。

我使用 window 7 pro x86、VS 2010、EmguCV2.4.2 并遵循本教程:http://www.youtube.com/watch?v=vdjoutNR2DQ

帮帮我!

最佳答案

@Marc Gravell:这是我的问题

    See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'opencv_core242': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Emgu.CV.CvInvoke.cvRedirectError(CvErrorCallback errorHandler, IntPtr userdata, IntPtr prevUserdata)
at Emgu.CV.CvInvoke..cctor()
--- End of inner exception stack trace ---
at Emgu.CV.CvInvoke.cvCreateCameraCapture(Int32 index)
at Emgu.CV.Capture..ctor(Int32 camIndex)
at Emgu.CV.Capture..ctor()
at WindowsFormsApplication2.Form1.Form1_Load(Object sender, EventArgs e) in D:\khtn\new\do an\project\WindowsFormsApplication2\WindowsFormsApplication2\Form1.cs:line 45
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///G:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
WindowsFormsApplication2
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/WindowsFormsApplication2.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Emgu.CV
Assembly Version: 2.4.2.1777
Win32 Version: 2.4.2.1777
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/Emgu.CV.DLL
----------------------------------------
Emgu.Util
Assembly Version: 2.4.2.1777
Win32 Version: 2.4.2.1777
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/Emgu.Util.DLL
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 built by: RTMRel
CodeBase: file:///G:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Emgu.CV.UI
Assembly Version: 2.4.2.1777
Win32 Version: 2.4.2.1777
CodeBase: file:///D:/khtn/new/do%20an/project/WindowsFormsApplication2/WindowsFormsApplication2/bin/Debug/Emgu.CV.UI.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

关于c# - 错误 'Emgu.CV.CvInvoke' 的类型初始值设定项引发了 C#、Opencv 和 EmguCv 的异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16416036/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com