Tesseract Example for Iphone

前端 未结 2 720
情歌与酒
情歌与酒 2020-12-23 18:36

I have compiled tesseract for using it in xcode following: http://iphone.olipion.com/cross-compilation/tesseract-ocr

I obtain the .a file, import it as framework in

相关标签:
2条回答
  • 2020-12-23 18:58

    http://github.com/nolanbrown/Tesseract-iPhone-Demo

    OCRDemo is a demo application that utilizes the Tesseract library (http://code.google.com/p/tesseract-ocr/) as a static library compiled under Mac OS 10.6 using the shell script found at http://robertcarlsen.net/2009/07/15/cross-compiling-for-iphone-dev-884.

    The program is only meant to provide a demonstration of the OCR library and it’s abilities on the iPhone, the program is not optimized in any way...

    0 讨论(0)
  • 2020-12-23 18:59

    you'll need to update SDKROOT, CPPFLAGS and CXX variables. For example, here's the relevant part of my build script, modified to work with 4.0:

    export SDKROOT=$DEVROOT/SDKs/iPhoneOS4.0.sdk
    export PATH=$DEVROOT/usr/bin:$PATH
    # Set up relevant environment variables
    export CPPFLAGS="-I$SDKROOT/usr/lib/gcc/arm-apple-darwin10/4.0.1/
    include/ -I$SDKROOT/usr/include/ -miphoneos-version-min=4.0"
    export CFLAGS="$CPPFLAGS -arch armv6 -pipe -no-cpp-precomp -isysroot
    $SDKROOT"
    export CPP="$DEVROOT/usr/bin/cpp $CPPFLAGS"
    export CXXFLAGS="$CFLAGS"
    

    Dynamic library location generated by the Unix package

     LIBPATH=$LIBFILE.dylib
        LIBNAME=`basename $LIBPATH`
    
    export LDFLAGS="-L$SDKROOT/usr/lib/ -Wl,-
    dylib_install_name,@executable_path/$LIBNAME"
    

    Static library that will be generated for ARM

    LIBPATH_static=$LIBFILE.a
    LIBNAME_static=`basename $LIBPATH_static`
    # TODO: add custom flags as necessary for package
    ./configure CXX=$DEVROOT/usr/bin/arm-apple-darwin10-g++-4.0.1 CC=
    $DEVROOT/usr/bin/arm-apple-darwin10-gcc-4.0.1 LD=$DEVROOT/usr/bin/ld --host=arm-apple-darwin
    
    0 讨论(0)
提交回复
热议问题