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

SWIFT4 recognition only numbers #388

Open AndreaIOSDeveloper opened 5 years ago

AndreaIOSDeveloper commented 5 years ago

Is it possible to recognize only the numbers within an image?

oleghnidets commented 5 years ago

Yes, it is. Use charWhitelist property.

AndreaIOSDeveloper commented 5 years ago

Yes, I tried it, I have this configuration, I'll attach it below, but it takes literal characters and turns them into numerical ones, you could help me. Thank you

if let tesseract = G8Tesseract(language:"eng+ita") {

        tesseract.delegate = self

        returnImage { (image) in

           // let imageRender = image.g8_grayScale()

            //tesseract.engineMode = .tesseractOnly

            //tesseract.pageSegmentationMode = .singleLine

            tesseract.charWhitelist = "01234567890"

            // tesseract.charBlacklist = "abcdefghilmnopqrstuvzABCDEFGHILMNOPQRSTUVZ"

            //tesseract.maximumRecognitionTime = 120.0

            tesseract.image = image.g8_blackAndWhite()

            tesseract.recognize()

            self.text?.text = tesseract.recognizedText

            return

        }

this configuration doesn't work


Da: Oleg notifications@github.com Inviato: martedì 13 novembre 2018 14:28 A: gali8/Tesseract-OCR-iOS Cc: Andrea Di Francia; Author Oggetto: Re: [gali8/Tesseract-OCR-iOS] SWIFT4 recognition only numbers (#388)

Yes, it is. Use charWhitelist property.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gali8/Tesseract-OCR-iOS/issues/388#issuecomment-438265473, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfFskKGinG25ef4b8mlDfCtYkxvK4vFkks5uuskCgaJpZM4YYIOK.

oleghnidets commented 5 years ago

Try engineMode as tesseractCubeCombined or cubeOnly.

Also read this https://stackoverflow.com/a/53281416/4869734

AndreaIOSDeveloper commented 5 years ago

doesn't work, I try in multiple way


Da: Oleg notifications@github.com Inviato: mercoledì 14 novembre 2018 17:13 A: gali8/Tesseract-OCR-iOS Cc: Andrea Di Francia; Author Oggetto: Re: [gali8/Tesseract-OCR-iOS] SWIFT4 recognition only numbers (#388)

Try engineMode as tesseractCubeCombined or cubeOnly.

Also read this https://stackoverflow.com/a/53281416/4869734

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/gali8/Tesseract-OCR-iOS/issues/388#issuecomment-438719969, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AfFskBxW6GJjYqQLHFmzy9H8c6H-f207ks5uvEEvgaJpZM4YYIOK.

IOSwift2019 commented 5 years ago

camera image can't get actual output gujarati font not get.

burcukutluay commented 4 years ago

it does not work, I tried every way. Is there anybody who find the solution?