Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
"this type initialize for Emgu.CV.OCR.Tesseract threw an exception".

and also i saw this message at the detail
"
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: An error occurred creating the form. See Exception.InnerException for details.  The error is: The type initializer for 'Emgu.CV.OCR.Tesseract' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Emgu.CV.OCR.Tesseract' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. ---> System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   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.CV_MAKETYPE(Int32 depth, Int32 cn)
   at Emgu.CV.OCR.Tesseract..cctor()
   --- End of inner exception stack trace ---
   at Emgu.CV.OCR.Tesseract..ctor(String dataPath, String language, OcrEngineMode mode)
   at HeartClinic.FrmAddLabTestOcr..ctor() in E:\vs2005\HomePrj\ClinicManagementPrgsV3\ClinicManagementghalb\Vs2015Prj\HeartClinic\HeartClinic\Dossiers\OCR\FrmAddLabTestOcr.vb:line 58
   --- End of inner exception stack trace ---
   at HeartClinic.My.MyProject.MyForms.Create__Instance__[T](T Instance) in :line 190
   at HeartClinic.My.MyProject.MyForms.get_FrmAddLabTestOcr()
   at HeartClinic.FrmDossiers.AddLabTestClicked() in E:\vs2005\HomePrj\ClinicManagementPrgsV3\ClinicManagementghalb\Vs2015Prj\HeartClinic\HeartClinic\Dossiers\FrmDossiers.vb:line 1534
   at HeartClinic.FrmDossiers.ButtAddLabTest_Click(Object sender, EventArgs e) in E:\vs2005\HomePrj\ClinicManagementPrgsV3\ClinicManagementghalb\Vs2015Prj\HeartClinic\HeartClinic\Dossiers\FrmDossiers.vb:line 1515
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.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.7.3468.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
HeartClinic
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/HeartClinic.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3451.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3570.0 built by: NET472REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3515.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/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.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/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.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
FarsiLibrary.Win
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/FarsiLibrary.Win.DLL
----------------------------------------
FarsiLibrary.Utils
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/FarsiLibrary.Utils.DLL
----------------------------------------
FarsiLibrary.Resources
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/FarsiLibrary.Resources.DLL
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3515.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.EnterpriseServices
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll
----------------------------------------
System.Runtime.Caching
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Caching/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.Caching.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
DevExpress.XtraEditors.v17.1
    Assembly Version: 17.1.3.0
    Win32 Version: 17.1.3.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/DevExpress.XtraEditors.v17.1.DLL
----------------------------------------
DevExpress.Utils.v17.1
    Assembly Version: 17.1.3.0
    Win32 Version: 17.1.3.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/DevExpress.Utils.v17.1.DLL
----------------------------------------
DevExpress.Data.v17.1
    Assembly Version: 17.1.3.0
    Win32 Version: 17.1.3.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/DevExpress.Data.v17.1.DLL
----------------------------------------
System.Data.DataSetExtensions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.6.81.0 built by: NETFXREL2
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll
----------------------------------------
System.Management
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
Janus.Windows.GridEX.v4
    Assembly Version: 4.0.18.0
    Win32 Version: 4.0.18.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/Janus.Windows.GridEX.v4.DLL
----------------------------------------
Janus.Windows.Common.v4
    Assembly Version: 4.0.18.0
    Win32 Version: 4.0.18.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/Janus.Windows.Common.v4.DLL
----------------------------------------
Janus.Data.v4
    Assembly Version: 4.0.18.0
    Win32 Version: 4.0.18.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/Janus.Data.v4.DLL
----------------------------------------
AxInterop.AgentObjects
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/AxInterop.AgentObjects.DLL
----------------------------------------
Interop.AgentObjects
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.0.0
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/Interop.AgentObjects.DLL
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.7.3468.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
Emgu.CV.OCR
    Assembly Version: 2.4.0.1717
    Win32 Version: 2.4.0.1717
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/Emgu.CV.OCR.DLL
----------------------------------------
Emgu.Util
    Assembly Version: 2.4.0.1717
    Win32 Version: 2.4.0.1717
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/Emgu.Util.DLL
----------------------------------------
Emgu.CV
    Assembly Version: 2.4.0.1717
    Win32 Version: 2.4.0.1717
    CodeBase: file:///C:/Program%20Files/Kara%20Narmafzar/heartClinicSystem/Emgu.CV.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.
"


please help me how can i improve it.
thanks alot

What I have tried:

i have search indifferent website and youtube too but i couldnt find a good solution to solve my problem.
like this one :https://www.bl.uk/britishlibrary/~/media/bl/global/early%20indian%20printed%20books/training%20resources/installing%20and%20using%20tesseract%20ocr.pdf[^]
Posted
Updated 6-Feb-20 2:25am
Comments
Richard MacCutchan 6-Feb-20 5:22am    
This may be an attempt to mix x86 and x64 code.

1 solution

Yes the clue is in:
System.BadImageFormatException (aka Windows error code: 0x8007000B )

That is almost always a result of trying to mix 32 and 64 bit code.

Processes need to either be all 32 bit or all 64 bit (executable and dlls etc)

i.e. am seconding what Richard said.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900