没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|产品更新|编辑:李显亮|2020-06-18 09:54:00.507|阅读 337 次
概述:Aspose.OCR for .NET更新至最新版v20.6,添加了对使用流的API支持,添加了指定字符以进行识别的功能,改善了识别质量,欢迎下载体验。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
Aspose.OCR for .NET是一款字符识别组件,它使得开发人员可以添加OCR功能到他们的ASP.NET Web应用程序、web服务和windows应用程序中。它提供了一个简单的类集用于控制字符识别。
Aspose.OCR for .NET迎来2020年v20.6最新版更新,添加了对使用流的API支持,添加了指定字符以进行识别的功能,改善了识别质量。(点击下方按钮即可下载)
space | ! | " | # | $ | % | & | ' | ( | ) |
* | + | , | - | . | / | 0 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = |
---|---|---|---|---|---|---|---|---|---|
> | ? | @ | [ | \ | ] | _ | ` | { | | |
} | ~ | A | B | C | D | E | F | G | H |
I | J | K | L | M | N | O | P | Q | R |
S | T | U | V | W | X | Y | Z | a | b |
c | d | e | f | g | h | i | j | k | l |
m | n | o | p | q | r | s | t | u | v |
w | x | y | z | Â | À | Á | Ã | Ä | Æ |
Ç | È | É | Ê | Ë | Ì | Í | Î | Ï | Ñ |
Ò | Ó | Ô | Õ | Ö | Ù | Ú | Û | Ü | ẞ |
ß | à | á | â | ã | ä | æ | ç | è | é |
ê | ë | ì | í | î | ï | ñ | ò | ó | ô |
õ | ö | ù | ú | û | ü | ÿ | Œ | œ | Ÿ |
方法
|
描述
|
---|---|
string RecognizeImage(MemoryStream stream) | 通过自动检测文本区域来识别图像,并检测,纠正文本偏斜。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。stream-图像的MemoryStream。 |
string RecognizeImage(string fullPath) | 通过自动检测文本区域来识别图像,并检测,纠正文本偏斜。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。fullPath-图像的路径。 |
List RecognizeImage(MemoryStream stream, List rects) | 识别指定矩形中的文本。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。不会发生歪斜对齐。stream-图像的MemoryStream。rects-用于识别的以像素为单位的矩形列表。 |
string RecognizeImage(MemoryStream stream, Rectangle rects) | 识别指定矩形中的文本。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。不会发生歪斜对齐。stream-图像的MemoryStream。rects-以像素为单位的矩形,用于识别。 |
List RecognizeImage(string fullPath, List rects) | 识别指定矩形中的文本。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。不会发生歪斜对齐。fullPath-图像的路径。rects-用于识别的以像素为单位的矩形列表。 |
string RecognizeImage(string fullPath, Rectangle rects) | 识别指定矩形中的文本。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。不会发生歪斜对齐。fullPath-图像的路径。rects-以像素为单位的矩形,用于识别。 |
string RecognizeImage(MemoryStream stream, bool detectAreas, bool autoSkew = true) | 识别带有或不带有自动检测文本区域的图像,并根据参数校正文本的偏斜。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。stream-图像的MemoryStream。detectAreas-自动检测文本区域。如果为假,则图像被视为一个文本块。autoSkew-删除歪斜图像。默认值-true。 |
string RecognizeImage(string fullPath, bool detectAreas, bool autoSkew = true) | 识别带有或不带有自动检测文本区域的图像,并根据参数校正文本的偏斜。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。fullPath-图像的路径。detectAreas-自动检测文本区域。如果为假,则图像被视为一个文本块。autoSkew-删除歪斜图像。默认值-true。 |
string RecognizeLine(MemoryStream stream) | 识别仅包含一行文本的图像。不会发生歪斜对齐。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。stream-图像的MemoryStream。 |
string RecognizeLine(string fullPath) | 识别仅包含一行文本的图像。不会发生歪斜对齐。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。fullPath-图像的路径。 |
float CalculateSkew(MemoryStream image) | 计算图像中文本的倾斜角(以度为单位)。image-图像的MemoryStream。 |
float CalculateSkew(string fullPath) | 计算图像中文本的倾斜角(以度为单位)。fullPath-图像的路径。 |
List GetRectangles(MemoryStream stream) | 获取带有文本区域的检测矩形。不会发生歪斜对齐。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。stream-图像的MemoryStream。 |
List GetRectangles(string fullPath) | 获取带有文本区域的检测矩形。不会发生歪斜对齐。支持GIF,PNG,JPEG,BMP,TIFF和WBMP。fullPath-图像的路径 |
License() | 构造函数。创建一个许可证实例。 |
AsposeOcr(string alphabet) | 构造函数。创建一个API实例,并在字母表中设置允许的字符集。 |
AsposeOCR() | 构造函数。创建一个API实例。 |
void SetLicense(string licenseName) | licenseName-xml许可证文件的路径。 |
using System; using System.Collections.Generic; using System.Drawing; using System.IO; using Aspose.OCR; namespace ProgramOCR { class Program { static void Main(string[] args) { // Get API AsposeOcr api = new AsposeOcr(); // Create license License lic = new License(); // Set license lic.SetLicense("Aspose.Total.lic"); // Get image for recognize string imgPath = "test_ocr.png"; /* Recognize image from file*/ // Recognize image string result = api.RecognizeImage(imgPath); // Print result Console.WriteLine(result); /* Recognize image from stream*/ using (MemoryStream ms = new MemoryStream()) using (FileStream file = new FileStream(imgPath, FileMode.Open, FileAccess.Read)) { file.CopyTo(ms); result = api.RecognizeImage(ms); } Console.WriteLine(result); /*Recognize image from file without detected texts areas and remove skew (all image is a text area) */ result = api.RecognizeImage(imgPath, false); Console.WriteLine(result); /*Recognize image from file with detected texts areas and without remove skew text*/ result = api.RecognizeImage(imgPath, true, false); Console.WriteLine(result); /* Recognize image in the specified rectangles */ List<Rectangle> rects = new List<Rectangle>() { new Rectangle(138, 352, 2033, 537), new Rectangle(147, 890, 2033, 1157), new Rectangle(923, 2045, 465, 102), new Rectangle(104, 2147, 2076, 819) }; List<string> listResult = api.RecognizeImage(imgPath, rects); foreach (string s in listResult) { Console.WriteLine(s); } /* Recognize image in the specified rectangle */ result = api.RecognizeImage(imgPath, rects[0]); Console.WriteLine(result); /* With allowed symbols*/ // Create api instance with allowed symbols. api = new AsposeOcr("0123456789"); // Get image line for recognize imgPath = "0002240177.Jpeg"; // Recognize line result = api.RecognizeLine(imgPath); Console.WriteLine(result); /* Calculate skew image from stream */ imgPath = "skew_image.png"; float angle = 0; using (MemoryStream ms = new MemoryStream()) using (FileStream file = new FileStream(imgPath, FileMode.Open, FileAccess.Read)) { file.CopyTo(ms); angle = api.CalculateSkew(ms); } Console.WriteLine(angle); /* Calculate skew image from path to image */ angle = api.CalculateSkew(imgPath); Console.WriteLine(angle); } } }
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com
商业智能软件Wyn Enterprise v8.0 Update1全新发布,新版本深度融合AI技术、工业物联网与数据工程能力等,欢迎下载最新版体验!
DevExpress JS & ASP.NET Core v25.1已全新发布,新版本发布了全新的CardView组件等,欢迎下载最新版组件体验!
本文将介绍MFC界面开发组件BCGControlBar Professional for MFC v36.2的一些亮点,欢迎下载相关产品体验~
界面开发组件Xtreme Toolkit Pro v24.2.0已正式发布,新版本新增现代化的Windows 11支持等,欢迎下载官方正式版体验!
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@evget.com
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
慧都科技 版权所有 Copyright 2003-
2025 渝ICP备12000582号-13 渝公网安备
50010702500608号