hoecki / tesseractdotnet

Automatically exported from code.google.com/p/tesseractdotnet
0 stars 0 forks source link

R552 small errors and solitions #21

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
1. Error
1bppIndexed image -> AccessViolationException
Solution  in ccmain->output.cpp->

void Tesseract::write_results(                    //write output
                  ETEXT_DESC *monitor,
                  WERD_RES *word,     //word to do
                  BLOCK *block,       //block it is from
                  ROW_RES *row,       //row it is from
                  const STRING &text, //text to write
                  const STRING &text_lengths) {.....}

this function calls for 3 times "ocr_append_char" function but use pix_grey_
if you change it "pix_grey_" to "pix_binary_", the error improves

2. Error
large image(greater than 127*100 chars in image) -> AccessViolationException
First solution
tesseract->tesseractenginewrapper.cpp->void 
TesseractProcessor::InitializeMonitor(){..}
this function change "fixed_buffer_factor" variable value 
forexample Increase  from 100 to 1000, 

Second solution
you can write function in api for request from .net users "fixed_buffer_factor" 
value

Third solution
"monitor" varriable is array, if change such as "linked-list" dynamic varriable 

3. Error Encoding problem
spare time, I want to look at this event to c++ code, but easy soliton on .net 
platform
 string k= Encoding.UTF8.GetString(Encoding.Default.GetBytes(tesseractProcessor.Apply(bmp)));

i think safer RetriveResultDetail funtion than 590's layout manager

Original issue reported on code.google.com by azizalkurt@gmail.com on 10 Jun 2012 at 10:42