jacklicn / tesseract-ocr

Automatically exported from code.google.com/p/tesseract-ocr
Other
0 stars 0 forks source link

tesseract.exe parameter -psm don't work #518

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi
First of all, sorry for my poor english...

What steps will reproduce the problem?
1.
I compile the entire tesseract project in VS2008. I launch the tesseract.exe 
application with the following parameters:

"invoice.tiff -l spa -psm 3 invoicehocrout hocr"

If I launch the app with another -psm value (for example, 3), and i get the 
same result.

The attach file is a phone invoice with visible layout (it has many colums).

What is the expected output? What do you see instead?

With -psm 3, I expect a layout result. With -psm 6, a full-text result.

What version of the product are you using? On what operating system?
I use the source code from svn trunk, revision 590. The operating system is 
Windows 7 Home 64 bits

Please provide any additional information below.

Debugging the code, i can see this:

api.SetPageSegMode(pagesegmode);
api.Init(argv[0], lang, tesseract::OEM_DEFAULT,
           &(argv[arg]), argc - arg, NULL, NULL, false);

"SetPageSegMode()" method  creates a tesseract objects is no exists, and set 
the pagesegmode value in this object.

"Init()" method destroys any existing tesseract object, and creates and init 
new tesseract object, with default psm (6, only a text block)

Reversing the two code lines, the problem is solved, and I get diferents 
results using -psm 3 and -psm 6.

Original issue reported on code.google.com by Skek...@gmail.com on 15 Jul 2011 at 11:53

Attachments:

GoogleCodeExporter commented 9 years ago
thank! Confirmed.

Original comment by zde...@gmail.com on 15 Jul 2011 at 2:54

GoogleCodeExporter commented 9 years ago
fixed in r596

Original comment by zde...@gmail.com on 27 Jul 2011 at 8:57