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.21k stars 948 forks source link

Does not detects images 100% #419

Open hazhayder opened 4 years ago

hazhayder commented 4 years ago

Hello, I am using a very short code preview to detect text from a bill which is in german language. I have placed deu.traineddate file but yet It stuck after reading the text Datum. I though this might be the problem with my image so I uploaded the image into an online OCR ocronline.net and it worked like a charm. I am sharing the code and the image your help is really appreciated `import UIKit import TesseractOCR class ViewController: UIViewController, G8TesseractDelegate {

@IBOutlet weak var textView: UITextView!
override func viewDidLoad() {
    super.viewDidLoad()
    let myImage = UIImage(named: "demoText")

    if let tesseract = G8Tesseract(language: "deu") {
        tesseract.pageSegmentationMode = .singleChar
        tesseract.biner
        tesseract.delegate = self
        tesseract.image = UIImage(named: "demoText")
        tesseract.engineMode = .lstmOnly
        print(tesseract.recognizedText)
        print(tesseract.recognizedHOCR(forPageNumber: 1))
        textView.text = tesseract.recognizedText

    }

}

func progressImageRecognition(for tesseract: G8Tesseract!) {
    print("Recognition Progress \(tesseract.progress) %")
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

} `

image