Tesseract 识别 Tiff 格式文件——alpha通道干扰
来源:互联网 发布:stm32编程环境 编辑:程序博客网 时间:2024/05/18 01:46
Problem with Tesseract and tiff format
安装Tesseract后进行OCR验证测试,在使用imagemagick将一幅PNG图像转换为TIF图像
PNG图像
因TIF图像CSDN不支持上传,所以未上传;
convert a.png a.tif
执行下述conmmand :
tesseract a.tif a
显示如下错误:
主要错误为spp not in set {1,3,4}
参考:
It probably means your TIFF image has an alpha channel and therefore the underlying Leptonica library used by Tesseract doesn't support it. If you're using Imagemagick then be aware that operations such as-draw
can cause alpha channels to be added. If you're using convert
in your workflow and want to remove the channel again immediately, flatten the image before writing by adding -background white -flatten +matte
before the output filename, e.g.:
可能因为TIFF图像中包含alpha通道,而Tesseract 使用的库Leptonicabu不支持alpha;
在使用Imagemagick进行图像格式转换时,若加上选项-draw,则会加入alpha,(经验证即使不加该选项也会默认加入alpha);
所以可以在输出文件前加入-background white -flatten +matte,以消除alpha通道!比如:
convert input.tiff -fill white -draw 'rectangle 10,10 20,20' -background white -flatten +matte output.tiff
那么再次对该TIFF图像进行OCR识别后,则不会出现上述提示!
参考及翻译文件地址:
http://stackoverflow.com/questions/5083492/problem-with-tesseract-and-tiff-format
- Tesseract 识别 Tiff 格式文件——alpha通道干扰
- 专业术语——Alpha 通道
- 图片识别——Tesseract
- Matlab读写TIFF格式文件
- Alpha通道
- alpha通道
- Tesseract——OCR图像识别 入门篇
- Tesseract-OCR 字符识别——样本训练 [转]
- 什么是Alpha通道(Alpha Channel)
- java-BufferedImage 图片验证码去除干扰线的方法( 用于OCR tesseract图像智能字符识别)
- 【Unity Shaders】Transparency —— 使用alpha通道创建透明效果
- [3D理论] 【Unity Shaders】Transparency —— 使用alpha通道创建透
- 转载-Alpha通道实现
- 图片的alpha 通道
- DirectX11 Alpha通道
- 图像中Alpha通道
- 四通道图像中的alpha通道
- tesseract-ocr识别字符
- poj3259Wormholes
- 神、上帝以及老天爷
- IOS开发常用函数
- 广播和广播接受者知识点分类
- leetcode: Linked List Cycle II
- Tesseract 识别 Tiff 格式文件——alpha通道干扰
- Android界面——Button按钮的一些事
- XCode快捷键
- C++复数运算符重载(+与<<)
- IBM联合CSDN发布Power Linux开发测试云平台
- Android 和 js 互相调用
- 此功能分公司与城市运营产看本部门的套餐
- 黑马程序员------毕老师视频笔记第八天------面向对象(接口多态的应用示例)
- Android开发点点滴滴——一些基础的但有用的知识(3)