您的位置:首页 > 汽车 > 新车 > 在线绘画软件_网址转换成二维码_域名检测_如何在百度发广告推广

在线绘画软件_网址转换成二维码_域名检测_如何在百度发广告推广

2025/3/18 14:45:47 来源:https://blog.csdn.net/moonlightpeng/article/details/146321082  浏览:    关键词:在线绘画软件_网址转换成二维码_域名检测_如何在百度发广告推广
在线绘画软件_网址转换成二维码_域名检测_如何在百度发广告推广

1 安装Nuget

2 C#

using System;
using OpenCvSharp;
using Sdcb.PaddleOCR;
using Sdcb.PaddleOCR.Models.Local;
using Sdcb.PaddleOCR.Models;
using Sdcb.PaddleInference;namespace ConsoleApp1
{public class MichaelOCR{string imagePath = "D:\\BUFFER\\VS\\Text\\ConsoleApp1\\2.jpg";public static int myAdd(int x, int y){return x + y;Console.WriteLine("Hello World!");}public static string Poem(){return "heelo world" +"world----";}static void Main(string[] args){string imagePath = "D:\\BUFFER\\VS\\Text\\ConsoleApp1\\2.jpg";FullOcrModel model = LocalFullModels.ChineseV3;Console.WriteLine(PaddleConfig.Version);using (PaddleOcrAll all = new PaddleOcrAll(model, PaddleDevice.Mkldnn()){AllowRotateDetection = true, /* 允许识别有角度的文字 */Enable180Classification = false, /* 允许识别旋转角度大于90度的文字 */}){// Load local file by following code:using (Mat src2 = Cv2.ImRead(imagePath)){PaddleOcrResult result = all.Run(src2);Console.WriteLine(result.Text);}}Console.WriteLine("Hello World!");}//下面是生成C# dll的//public static string Main(string imagePath)//{//    FullOcrModel model = LocalFullModels.ChineseV3;//    //Console.WriteLine(PaddleConfig.Version);//    using (PaddleOcrAll all = new PaddleOcrAll(model, PaddleDevice.Mkldnn())//    {//        AllowRotateDetection = true, /* 允许识别有角度的文字 *///        Enable180Classification = false, /* 允许识别旋转角度大于90度的文字 *///    })//    {//        // Load local file by following code://        using (Mat src2 = Cv2.ImRead(imagePath))//        {//            PaddleOcrResult result = all.Run(src2);//            return result.Text;//            //Console.WriteLine(result.Text);//        }//    }//    //Console.WriteLine("Hello World!");//}}
}

3 官网资料

https://github.com/sdcb/PaddleSharp

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com