gali8 / Tesseract-OCR-iOS

Tesseract OCR iOS is a Framework for iOS7+, compiled also for armv7s and arm64.
http://www.nexor.it
MIT License
4.22k stars 949 forks source link

Tess Data Problem #336

Closed codingiswhyicry closed 7 years ago

codingiswhyicry commented 7 years ago

Hi, everyone! I imported Tesseract into my project using CocoaPods, and upon opening, it is crashing.

I'm running Xcode Beta 9, on iOS 11, beta 4. This may be part of the problem. I've read that the Xcode Beta doesn't support referenced folders, and as a work around, I added the folder through Xcode 8, and then opened in beta 9. I have a folder full of fonts and training data, which is a referenced folder within my project. The error leads me to believe I'm setting it up incorrectly.

Here's the error: "actual_tessdata_numentries <= TESSDATA_NUM_ENTRIES:Error:Assert failed:in file tessdatamanager.cpp, line 53 (lldb) "

Here's where it crashes: " int returnCode = _tesseract->Init(self.absoluteDataPath.UTF8String, self.language.UTF8String, (tesseract::OcrEngineMode)self.engineMode, (char **)configs, count, &tessKeys, &tessValues, false);"

Here's my code:

import UIKit import TesseractOCR

class ViewController: UIViewController, G8TesseractDelegate {

func recognizeText(image: UIImage) {

    tesseract?.image = UIImage(image: image)

}

override func viewDidLoad() {
    super.viewDidLoad()

    tesseract?.delegate = self

}

func shouldCancelImageRecognition(for tesseract: G8Tesseract!) -> Bool {

    return false
}

var tesseract = G8Tesseract(language: "eng")

@IBOutlet weak var imageView: UIImageView!

@IBOutlet weak var textLabel: UILabel!

}

Here's the the repo I'm working in, in case anyone can replicate the problem.

https://github.com/thecodingone/tesseract-starter

Thank you in advance!

wangela commented 7 years ago

I get the same error when building in Xcode 8.3.3 for iOS 10.3. My repo is at: https://github.com/wangela/gratiptude

gali8 commented 7 years ago

https://github.com/gali8/Tesseract-OCR-iOS/issues/300

Jatinharish commented 7 years ago

Hi I implement tesseract library , everything is fine but i want to add all language files i.e all 101 traindata files but these files are so heavy more than 2 GB. So can you please give me some solution to resolve this problem. Thanks

zhuozhuo commented 4 years ago

With the same training library, my friends' android and Windows platforms work well. Compared to the OCR version they used version 3.0.5, I tried to recompile the Submodule dependency library, but encountered many problems. Has anyone tried this before?