Compile tesseract for iOS SDK 6.0

http://lois.di-qual.net/blog/compile-tesseract-for-ios-sdk-6-0/点击打开链接


Update 10/25/12

Added instructions to integrate an armv7s slice in liblept.a and libtesseract_all.a.

Update 09/24/12

To make the iOS integration easier, I made a Github repo containing an Objective-C wrapper for Tesseract. It relies on an other repo containing tesseract & leptonica libs. Feel free to improve them !

More informations about these repos on my next article.

Introduction

I had troubles while following the compiling guide from this blog:http://tinsuke.wordpress.com/2011/11/01/how-to-compile-and-use-tesseract-3-01-on-ios-sdk-5/. Some dependencies are missing on a fresh Mountain Lion with Xcode 4.5, and more importantly: the build_dependencies.sh won’t work.

Here is why: Xcode 4.5 and iOS SDK 6.0 don’t support armv6 anymore.

So here are the steps to build tesseract-ocr for iOS SDK 6.0.

Requirements

If you don’t have HomeBrew already, that’s a shame. Run to this website and install it.

Then, install libtool and automake:

1
$ brew install libtool automake

You should have installed ‘Command Line Tools’ after the Homebrew installation, but if you forgot: Open Xcode’s preferences, and install them from the ‘Downloads’ tab.

The build process will need libtoolize. Just make a symlink to glibtoolize:

1
$ ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize

We’re good to go.

Sources and compilation

The steps will more or less follow the tinsuke’s article, except for one thing: the build script.

Get the following sources:

Then, organize your folder with the following structure:

1
2
3
4
5
./build/
  dependencies/ 
  leptonica-1.69/
  tesseract-3.01/
  build_dependencies.sh

You might want to modify build_dependencies.sh to make LEPTON_LIB and TESSERACT_LIB match the proper folders.

Now, you can build the libraries:

1
2
$ chmod +x ./build_dependencies.sh
$ ./build_dependencies

In dependencies/lib/, you’ll find liblept.a and libtesseract_all.a, these are the only libraries you need so you can remove other ones. Both contain armv7 and i386 slices only, but many iOS 5 projects require an armv7s slice.

Just follow this Matt Galloway’s blog post to generate and put an armv7s slice into the libs.

Now you just have to copy dependencies/ in your Xcode Project, and follow my next article on how to use tesseract.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值