Tesseract.SetImage Method Not working

Post your iOS related question here.
Post Reply
david.a.angel
Posts: 4
Joined: Mon Oct 22, 2018 12:10 pm

Tesseract.SetImage Method Not working

Post by david.a.angel » Mon Oct 22, 2018 12:23 pm

I've just recently purchased the license. When trying to incorporate Emgu.CV Library into my existing project I had issues right away. My project was already referencing a library that used Tesseract and this was producing a "Duplicate" compile error. So I removed my original Tesseract Library and went about incorporating Emgu.CV Tesseract. I'm able to initialize the Tesseract but when I go to .SetImage(myImage) and then run .Recognize() and then try to extract the text with Tesseract.GetUtf8Text() It throws a critical error.
I've already check if the image is null and it isn't.
Here is my code.

try
{
tesseract.SetImage(finalImage);
tesseract.Recognize();
ttsTextView.Text += tesseract.GetUTF8Text();
}
catch(Exception ex)
{
Console.WriteLine(ex);
}

Below is the Application Output.

Please call SetImage before attempting recognition.
Please call SetImage before attempting recognition.
2018-10-22 10:17:53.268 TTSTestApp[6150:1393342] critical: Stacktrace:

2018-10-22 10:17:53.268 TTSTestApp[6150:1393342] critical: at <unknown> <0xffffffff>
2018-10-22 10:17:53.268 TTSTestApp[6150:1393342] critical: at (wrapper managed-to-native) Emgu.CV.OCR.OcrInvoke.TessBaseAPIGetUTF8Text (intptr,intptr) <0x00007>
2018-10-22 10:17:53.268 TTSTestApp[6150:1393342] critical: at Emgu.CV.OCR.Tesseract.GetUTF8Text () [0x00012] in <72f036fa1b354df3b1b99d6815e6bca0#29F85DD3-57ED-6F33-346E-A8BF8CA73FB5>:0
2018-10-22 10:17:53.268 TTSTestApp[6150:1393342] critical: at TTSTestApp.ViewController/<>c__DisplayClass57_0.<PrepareImageForTesseract>b__0 () [0x00046] in /Users/mariakostina/Desktop/Outloud App/TTSTestApp/TTSTestApp/ViewController.cs:581
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at CoreFoundation.DispatchQueue.static_dispatcher_to_managed (intptr) [0x00038] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/CoreFoundation/Dispatch.cs:344
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at (wrapper native-to-managed) CoreFoundation.DispatchQueue.static_dispatcher_to_managed (intptr) <0x000a7>
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at <unknown> <0xffffffff>
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <0x00007>
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:79
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at UIKit.UIApplication.Main (string[],string,string) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:63
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at TTSTestApp.Application.Main (string[]) [0x00001] in /Users/mariakostina/Desktop/Outloud App/TTSTestApp/TTSTestApp/Main.cs:12
2018-10-22 10:17:53.269 TTSTestApp[6150:1393342] critical: at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <7d5a05cfcb09432d8cc656b9d781e54b#29F85DD3-57ED-6F33-346E-A8BF8CA73FB5>:0
2018-10-22 10:17:53.270 TTSTestApp[6150:1393342] critical:
Native stacktrace:

2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 0 TTSTestApp 0x0000000106e8a880 mono_handle_native_crash + 224
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 1 TTSTestApp 0x0000000106e97ac0 mono_sigsegv_signal_handler + 316
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 2 libsystem_platform.dylib 0x00000001ddc4aa20 <redacted> + 56
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 3 TTSTestApp 0x00000001048e5c38 TessBaseAPIGetUTF8Text + 32
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 4 TTSTestApp 0x0000000106c8bb98 wrapper_managed_to_native_Emgu_CV_OCR_OcrInvoke_TessBaseAPIGetUTF8Text_intptr_intptr + 216
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 5 TTSTestApp 0x00000001068f4b0c Emgu_CV_OCR_Tesseract_GetUTF8Text + 252
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 6 TTSTestApp 0x0000000105c6ee90 TTSTestApp_ViewController__c__DisplayClass57_0__PrepareImageForTesseractb__0 + 464
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 7 TTSTestApp 0x00000001063485b0 CoreFoundation_DispatchQueue_static_dispatcher_to_managed_intptr + 224
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 8 TTSTestApp 0x0000000106374be8 wrapper_native_to_managed_CoreFoundation_DispatchQueue_static_dispatcher_to_managed_intptr + 168
2018-10-22 10:17:53.348 TTSTestApp[6150:1393342] critical: 9 libdispatch.dylib 0x00000001dda78484 <redacted> + 16
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 10 libdispatch.dylib 0x00000001dda57b44 <redacted> + 1012
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 11 CoreFoundation 0x00000001ddfce1bc <redacted> + 12
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 12 CoreFoundation 0x00000001ddfc9084 <redacted> + 1964
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 13 CoreFoundation 0x00000001ddfc85b8 CFRunLoopRunSpecific + 436
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 14 GraphicsServices 0x00000001e023c584 GSEventRunModal + 100
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 15 UIKitCore 0x000000020af8cbc8 UIApplicationMain + 212
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 16 TTSTestApp 0x00000001063702f4 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 324
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 17 TTSTestApp 0x00000001063337ec UIKit_UIApplication_Main_string___intptr_intptr + 44
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 18 TTSTestApp 0x00000001063337ac UIKit_UIApplication_Main_string___string_string + 172
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 19 TTSTestApp 0x0000000105c56390 TTSTestApp_Application_Main_string__ + 128
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 20 TTSTestApp 0x00000001062912f8 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 248
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 21 TTSTestApp 0x0000000106e9ac3c mono_jit_runtime_invoke + 904
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 22 TTSTestApp 0x0000000106f1f594 mono_runtime_invoke_checked + 148
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 23 TTSTestApp 0x0000000106f254dc mono_runtime_exec_main_checked + 120
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 24 TTSTestApp 0x0000000106e7bce4 mono_jit_exec + 268
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 25 TTSTestApp 0x0000000106fecc48 xamarin_main + 2220
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 26 TTSTestApp 0x0000000105c3f7fc main + 96
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical: 27 libdyld.dylib 0x00000001dda88b94 <redacted> + 4
2018-10-22 10:17:53.349 TTSTestApp[6150:1393342] critical:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

I've searched everywhere for a solution...To no avail.
Please Help!

Post Reply