7 Replies - 5933 Views - Last Post: 24 May 2011 - 01:26 PM Rate Topic: -----

#1 madmorgan  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 104
  • Joined: 07-May 10

problem with tessnet2

Posted 24 May 2011 - 12:31 PM

Hello all,

Im having problems with Tessnet2. I got it working friday and made some chages to day and broke the hole dam thing. so I have gone back to basic here is my code.


using tessnet2;

            if (File.Exists(@"c:\temp\test.jpg") == true)
            {
                Bitmap image = new Bitmap(@"c:\temp\test.jpg");
                tessnet2.Tesseract ocr = new tessnet2.Tesseract();
                ocr.Init(@"c:\temp\tessdata", "eng", false); // Problem here
                List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
                foreach (tessnet2.Word word in result)
                    Console.WriteLine(word.Text);
            }



I have created a Application Config file to help support .net 2 files which works fine, also I have enabled debugging of unmanged code and I have have installed C++ Runtime 2008.

Appconfig File
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
</configuration>



help is reaily needed now please.

Is This A Good Question/Topic? 0
  • +

Replies To: problem with tessnet2

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9220
  • View blog
  • Posts: 34,628
  • Joined: 12-June 08

Re: problem with tessnet2

Posted 24 May 2011 - 12:35 PM

What's the problem? Thankfully you tell us 'where', but what is it? Is there an exception? If so what does the text say? Is the output not right? If so what should it be and what is it now?

Remember - we can't compile your code nor see what is on your screen. If you take the time to explain to us, in detail, what is going on we can attempt to satisfy your privileged declaration of "help is reaily needed now please. ".
Was This Post Helpful? 1
  • +
  • -

#3 madmorgan  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 104
  • Joined: 07-May 10

Re: problem with tessnet2

Posted 24 May 2011 - 12:38 PM

Sorry the problem is when it get down to line 7 the application just stops and comes out of debugging mode (F5) back into visual studio and no error's nothing.

I have checked the paths and all the files are currect and in the right location.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9220
  • View blog
  • Posts: 34,628
  • Joined: 12-June 08

Re: problem with tessnet2

Posted 24 May 2011 - 12:42 PM

Try putting a try/catch around it and examining any exception that might be caught. Do you have a link to the documentation for this open source third party dll?
Was This Post Helpful? 0
  • +
  • -

#5 madmorgan  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 104
  • Joined: 07-May 10

Re: problem with tessnet2

Posted 24 May 2011 - 12:49 PM

WOW not even the try catch could help. DLL Web site http://www.pixel-tec...eware/tessnet2/

I am using .Net 4 and VS 2010 and building my apps in .Net 4

Code
            if (File.Exists(@"c:\temp\test.jpg") == true)
            {
                try
                {
                    image = new Bitmap(@"c:\temp\test.jpg");
                    ocr = new tessnet2.Tesseract();
                    ocr.Init(@"c:\temp\tessdata", "eng", false);
                    List<tessnet2.Word> result = ocr.DoOCR(image, Rectangle.Empty);
                    foreach (tessnet2.Word word in result)
                        Console.WriteLine(word.Text);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }



my console output

'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\john\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Deployment\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The thread 'vshost.NotifyLoad' (0x1a0) has exited with code 0 (0x0).
The thread '<No Name>' (0x16a4) has exited with code 0 (0x0).
The thread '<No Name>' (0x1714) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x15c0) has exited with code 0 (0x0).
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\john\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe', Symbols loaded.
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'c:\users\john\documents\visual studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\tessnet2_32.dll'
'WindowsFormsApplication1.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.5570_none_509463cabcb6ef2a\msvcm90.dll'
The program '[5100] WindowsFormsApplication1.vshost.exe: Managed (v4.0.30319)' has exited with code 1 (0x1).
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9220
  • View blog
  • Posts: 34,628
  • Joined: 12-June 08

Re: problem with tessnet2

Posted 24 May 2011 - 12:51 PM

Sure.. but where's the documentation page of what's in the dll?
Was This Post Helpful? 0
  • +
  • -

#7 madmorgan  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 104
  • Joined: 07-May 10

Re: problem with tessnet2

Posted 24 May 2011 - 12:54 PM

the web site is the documentation that's it
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9220
  • View blog
  • Posts: 34,628
  • Joined: 12-June 08

Re: problem with tessnet2

Posted 24 May 2011 - 01:26 PM

Just to be clear - you want someone to figure out why some abandoned open source project from 2009 is not working - sans documentation? Good luck with that.

Did you get the english downloaded pack installed?

You might be better off talking to the people in their recommended google groups forum.

http://groups.google...ract-ocr/topics

This post has been edited by modi123_1: 24 May 2011 - 01:26 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1