打开VSIDE,新建Windows窗体应用(.NETFramework)类型的项目,选择一个.NET框架,如.NETFramework 4.0,右键点击项目,选择属性》生成,目标平台设置成X64.
安装nuget包
搜索PaddleOCRSharp 安装最新版本
代码
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter ="*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png";
if (ofd.ShowDialog() != true) return;
var imagebyte =File.ReadAllBytes(ofd.FileName);
Bitmap bitmap = newBitmap(new MemoryStream(imagebyte));
OCRModelConfig config =null;
OCRParameter oCRParameter = new OCRParameter ();
OCRResult ocrResult =new OCRResult();
using (PaddleOCREngine engine = new PaddleOCREngine(config, oCRParameter))
{
ocrResult =e

该文章演示了如何在VSIDE中创建一个基于.NETFramework的Windows窗体应用,利用PaddleOCRSharp库进行图像文字识别。通过设置目标平台为X64,安装NuGet包,配置OCR参数,实现对不同图像格式的处理。文章还提到了内存管理和线程并发的设置,以及识别结果的展示。
最低0.47元/天 解锁文章
1376

被折叠的 条评论
为什么被折叠?



