运行环境
操作系统WIN11
CPU类型:Intel Celeron N5105
控件版本:
PaddleOCRSharp(2.2.0)
代码:
Dim tScreenRect As Rectangle = New Rectangle(aRect.left + 8, aRect.top, (aRect.right - 8) - (aRect.left + 8), aRect.bottom - aRect.top - 8)
Dim tSrcBmp As Bitmap = New Bitmap(tScreenRect.Width, tScreenRect.Height)
Dim gp As Graphics = Graphics.FromImage(tSrcBmp)
gp.CopyFromScreen(aRect.left + 8, aRect.top, 0, 0, tScreenRect.Size)
tSrcBmp.Save(Application.StartupPath & "\ocr.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Dim imagebyte = File.ReadAllBytes(Application.StartupPath & "\ocr.jpg")
Dim Bitmap As New Bitmap(New MemoryStream(imagebyte))
Dim config As OCRModelConfig
Dim OCRParameter As New OCRParameter()
Dim OCRResult As New OCRResult()
Try
Dim engine As New PaddleOCREngine(config, OCRParameter)
OCRResult = engine.DetectText(Bitmap)
engine.Dispose()
Catch ex As Exception
MsgBox("ex.msg:" & vbCrLf & ex.Message)
End Try
'File.WriteAllText(Application.StartupPath & "file\" & Replace(Replace(写入时间, " ", ""), ":", "") & ".txt", OCRResult.Text)
Return OCRResult.Text
代码在其他电脑运行正常,但在此笔记本上运行报错,请问是此CPU本身不支持,还是因为设置问题呢?如果是后者,请问需要如何设置呢?非常感谢。
某台笔记本运行报错:The CPU instruction set is not support PaddleOCR