Comments (9)
Are you using Cocoa Pods or did you add the framework manually? If you're using Cocoa Pods, are you using version 2.2 of the library or the latest from the Github repo?
from tesseract-ocr-ios.
I downloaded the zip from github and drag & dropped TesseractOCR.framework into my project. I tried using Cocoapods earlier but I haven't used cocoapods before and it didn't seem to add the framework to my project and I wasn't sure the problem was. Which would you recommend ?
from tesseract-ocr-ios.
Definitely the easiest method is to use CocoaPods (I'd recommend the development version of the Tesseract wrapper library for now since it has more functionality, just the one downside that it won't work with the iPhone 5S and newer simulators). See the README in this repo for the right line to add to your Podfile.
Also make sure after running "pod install" to install the Tesseract library you open the ".xcworkspace" file instead of the ".xcodeproject". The framework will appear in the new Pods subproject in the workspace, and it will be automatically configured so everything should just work in your project if you add #import <TesseractOCR/TesseractOCR.h>
to the header file of wherever you're trying to use the library in your project.
I highly recommend following the CocoaPods guide if you're new to CocoaPods: http://guides.cocoapods.org/using/using-cocoapods.html
If you want to manually add the framework to your project, make sure you also follow the other instructions listed in the README in this repo for manually adding the framework to the project. In particular, I believe the errors you are getting are a result of not linking in the "libstdc++.6.0.9.dylib" library. But again, see the README and make sure you've followed all of those instructions.
from tesseract-ocr-ios.
Thanks Kevin, I've been working through things. The problem with cocopods seems to be that when I run Pods Install I get this error:
Analyzing dependencies
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory - /Users/Josh/.cocoapods/repos (Errno::ENOENT)
I haven't been able to find a way to fix that - any suggestions?
from tesseract-ocr-ios.
Try following the suggestion in the comment on this Stack Overflow post: http://stackoverflow.com/questions/26990057/cocoapods-commands-fail-due-to-no-such-file-or-directory-dir-initialize-us
from tesseract-ocr-ios.
Thanks again Kevin, once I fixed up the cocoa pods specs repository issue I was able to successfully read my first image. Had to create a bridging header for swift and import the lib like this:
#import "../Pods/Headers/Public/TesseractOCRiOS/TesseractOCR.h"
which while it worked I wondered if there should had been a path added somewhere that wasn't setup correctly?
from tesseract-ocr-ios.
So #import <TesseractOCR/TesseractOCR.h>
in the bridging header doesn't work but the relative path import does work? If so, yeah that sounds like a path-related issue. I have not used Swift with CocoaPods before, but this blog post suggests that what you did is all you have to do: https://medium.com/@stigi/swift-cocoapods-da09d8ba6dd2
Now that CocoaPods is cooperating, you could try nuking your current project and starting over from a fresh project/folder (using the CocoaPod from the get-go) to see if the issue persists.
from tesseract-ocr-ios.
Yeah, the relative path worked fine. I started the project from scratch once cocoa pods was working so guess I'll just live with it how it is. Thanks for your help.
from tesseract-ocr-ios.
Okay, I'm glad you got it working. Could you close this issue when you get a chance?
from tesseract-ocr-ios.
Related Issues (20)
- .
- User-Words file not loaded: Error: failed to load user-words HOT 5
- doesn't work with 64bpp images
- pod failed HOT 1
- Does not detects images 100%
- What's means with *.cube.* ? e.g. eng.cube.fold
- Why does the testsdata folder exist in the project? HOT 2
- Why don't we upgrade to the latest Tesseract?
- cocoapods 5.0.1 error
- Xcode 12.0.1 build is failing when trying to run it on the simulator. HOT 2
- RecognitionQuestion
- Apple Silicon (arm64; M1) support HOT 2
- Thread 1: EXC_BAD_ACCESS (code=1, address=0x163940000)
- Framework not found for Mac OS HOT 1
- 你好 这句一定闪退
- PDF creation not working
- self.tesseract!.recognize() is crashing in Acuant MRZ
- How to update Tesseract version
- Target 'TesseractOCRiOS' (project 'Pods') has copy command HOT 1
- cannot load language 'eng' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tesseract-ocr-ios.