【图像识别】 图像处理和图像分析(leptonica)leptonica-1.68安装配置 (vs2008)
Leptonica is a pedagogically-oriented open source site containing software that is broadly useful for image processing and image analysis applications.
http://www.leptonica.com/
Featured operations are
- Rasterop (a.k.a. bitblt)Affine transformations (scaling, translation, rotation, shear) on images of arbitrary pixel depthBinary and grayscale morphology, rank order, and convolutionSeedfill and connected componentsImage transformations combining changes in scale and pixel depthPixelwise masking, blending, enhancement, arithmetic ops, etc.
Ancillary operations include
- I/O for standard image formatsUtilities to handle arrays of image-related data typesUtilities for generic stacks, queues, heaps and lists; and for byte queues and arrays of numbers and strings
Example applications include
- Octcube-based color quantization, with and without ditheringModified median-cut color quantization, with and without ditheringSkew determination of text imagesSegmentation of page images with mixed text and imagesjbig2 unsupervised classifierBorder representations of 1 bit/pixel images and raster conversion for SVGPostScript generation (levels 1, 2, 3) of images for device-independent outputPDF generation (levels 1, 2) of images for device-independent outputDewarping images of text taken with a cameraRendering text on an imageConnectivity-preserving thinning and thickening of 1 bit/pixel imagesLine removal from a grayscale sketchSearch for least-cost paths on binary and grayscale images————————————————————————————————————————————————————————
最近做个图像识别的东西,需要将图片中的文字识别出来。
使用tesseract ORC,又发现tesseract ORC依赖leptonica,于是,干脆把leptonica也弄弄好了。
http://www.leptonica.com/
可以下载:
leptonica-1.68.tar.gz //源码 linux
vs2008-1.68.zip ///源码 Windows vs2008
leptonica-1.68-win32-lib-include-dirs.zip //头文件和lib
安装gnuplot
环境变量PATH加入 C:\gnuplot\bin(安装路径\bin,可能也是binary)
创建新环境变量GDFONTPATH 值为C:\WINDOWS\Fonts
创建新环境变量GNUPLOT_FONTPATH值为C:\WINDOWS\Fonts
安装IrfanView
环境变量PATH加入C:\Program Files\IrfanView (安装路径)
解压 leptonica-1.68-win32-lib-include-dirs.zip //头文件和lib
环境变量PATH加入D:\share\leptonica-1.68\lib (解压路径), 这里如果不加的话,需要将dll放到你的工程目录下。因为运行过程中需要调用liblept168.dll这个动态链接库。否刚的话,肯定会报这个“liblept168.dll找不到”的。
xxx..vcproj 同一个目录
新建一个工程,设置Include files路径和lib库路径
即你解压后的Include
导入lib库
建立link到leptonica的新的空工程,工程配置里linker->input里加入leptonica的lib
link动态库的release版:leptonlib168.dll
ink动态库的debug版:leptonlib168d.dll(168是版本号)
link静态库的release版:
giflib$(GIFLIB_VERSION)-static-mtdll.lib
libjpeg$(LIBJPEG_VERSION)-static-mtdll.lib
libpng$(LIBPNG_VERSION)-static-mtdll.lib
libtiff$(LIBTIFF_VERSION)-static-mtdll.lib
zlib$(ZLIB_VERSION)-static-mtdll.lib
liblept$(LIBLEPT_VERSION)-static-mtdll.lib
link静态库的debug版:
......
如果你找不到GIFLIB_VERSION 类似这些变量的话,写死也行的。就是解压的那些库
giflib416-static-mtdll.lib
giflib416-static-mtdll-debug.lib
libjpeg8c-static-mtdll.lib
libjpeg8c-static-mtdll-debug.lib
libpng143-static-mtdll.lib
libpng143-static-mtdll-debug.lib
libtiff394-static-mtdll.lib
libtiff394-static-mtdll-debug.lib
zlib125-static-mtdll.lib
zlib125-static-mtdll-debug.lib
liblept168.lib
liblept168d.lib
相对来说代码都相当简单了。