Tesseract.exe from command line defaults Page Segmentation Mode to 3 while from API it defaults to 6. PSM of 3 yields much better results for the type of documents I'm processing but changing to PSM 3 causes API function TessBaseAPIRecognize to freeze program execution.
Is anyone changing PSM to 3 or 1 from API while successfully executing API Recognize later down the road?
handle := TessBaseAPICreate()
IF TessBaseAPIInit3( handle, NIL, "eng" ) == 0 //abort if english traindata file can't be found
//change PSM to 3 =Fully automatic Page Seg but no OSD.
TessBaseAPISetPageSegMode( handle, 3 )
img := pixRead( ALLTRIM( cPath )+cFile )
TessBaseAPISetImage2( handle, img )
//program execution freezes right when calling next line
//but only when PageSegMode is set to 3. If I comment line above
//where PageSegMode is set to 3 then program execution flows
//without freezing on the next line.
IF TessBaseAPIRecognize( handle, Nil ) <> 0 ; LOOP ;ENDIF
cText := TessBaseAPIGetUTF8Text( handle )
....
Please help, thank you.