update paddle ocr 6.0.0
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props" Condition="Exists('..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -12,6 +13,8 @@
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -49,14 +52,84 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\BouncyCastle.Cryptography.2.7.0-beta.98\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Enums.NET, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7ea1c1650d506225, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Enums.NET.5.0.0\lib\net461\Enums.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ExtendedNumerics.BigDecimal, Version=3003.0.0.346, Culture=neutral, PublicKeyToken=65f1315a45ad8949, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ExtendedNumerics.BigDecimal.3003.0.0.346\lib\net472\ExtendedNumerics.BigDecimal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.4.2.13, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpZipLib.1.4.2\lib\netstandard2.0\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MathNet.Numerics, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MathNet.Numerics.Signed.5.0.0\lib\net461\MathNet.Numerics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.Cryptography, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.Cryptography.10.0.1\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.3.0.1\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI.Core, Version=2.7.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.7.5\lib\net472\NPOI.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI.OOXML, Version=2.7.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.7.5\lib\net472\NPOI.OOXML.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI.OpenXml4Net, Version=2.7.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.7.5\lib\net472\NPOI.OpenXml4Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI.OpenXmlFormats, Version=2.7.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.7.5\lib\net472\NPOI.OpenXmlFormats.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NSax, Version=1.0.2.0, Culture=neutral, PublicKeyToken=0b3d9671cbd3c8d0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NSax.1.0.2\lib\net472\NSax.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SixLabors.Fonts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d998eea7b14cab13, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SixLabors.Fonts.1.0.1\lib\netstandard2.0\SixLabors.Fonts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Formats.Asn1, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Formats.Asn1.10.0.1\lib\net462\System.Formats.Asn1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Memory.4.6.3\lib\net462\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Security.Cryptography.Xml, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Xml.10.0.1\lib\net462\System.Security.Cryptography.Xml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encoding.CodePages, Version=10.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encoding.CodePages.10.0.1\lib\net462\System.Text.Encoding.CodePages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.6.3\lib\net462\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="ZString, Version=2.6.0.0, Culture=neutral, PublicKeyToken=df4c250b14d82627, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ZString.2.6.0\lib\netstandard2.0\ZString.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
@@ -68,5 +141,17 @@
|
||||
<Name>LibDataBase</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props'))" />
|
||||
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" />
|
||||
</Project>
|
||||
31
LibReadTetraExcel/app.config
Normal file
31
LibReadTetraExcel/app.config
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.6.0" newVersion="4.1.6.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.5.0" newVersion="4.0.5.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.4.0" newVersion="4.2.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="ExtendedNumerics.BigDecimal" publicKeyToken="65f1315a45ad8949" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3003.0.0.346" newVersion="3003.0.0.346" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
24
LibReadTetraExcel/packages.config
Normal file
24
LibReadTetraExcel/packages.config
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="BouncyCastle.Cryptography" version="2.7.0-beta.98" targetFramework="net472" />
|
||||
<package id="Enums.NET" version="5.0.0" targetFramework="net472" />
|
||||
<package id="ExtendedNumerics.BigDecimal" version="3003.0.0.346" targetFramework="net472" />
|
||||
<package id="MathNet.Numerics.Signed" version="5.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.Cryptography" version="10.0.1" targetFramework="net472" />
|
||||
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net472" />
|
||||
<package id="NPOI" version="2.7.5" targetFramework="net472" />
|
||||
<package id="NSax" version="1.0.2" targetFramework="net472" />
|
||||
<package id="SharpZipLib" version="1.4.2" targetFramework="net472" />
|
||||
<package id="SixLabors.Fonts" version="1.0.1" targetFramework="net472" />
|
||||
<package id="SixLabors.ImageSharp" version="3.1.12" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
|
||||
<package id="System.Formats.Asn1" version="10.0.1" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.6.3" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.Xml" version="10.0.1" targetFramework="net472" />
|
||||
<package id="System.Text.Encoding.CodePages" version="10.0.1" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.6.1" targetFramework="net472" />
|
||||
<package id="ZString" version="2.6.0" targetFramework="net472" />
|
||||
</packages>
|
||||
@@ -47,7 +47,7 @@
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="ExtendedNumerics.BigDecimal" publicKeyToken="65f1315a45ad8949" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3001.1.0.233" newVersion="3001.1.0.233" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3003.0.0.346" newVersion="3003.0.0.346" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Drawing.Common" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
|
||||
@@ -563,30 +563,9 @@ namespace TetraPackOCR
|
||||
try
|
||||
{
|
||||
//模型初始化
|
||||
OCRModelConfig config = new OCRModelConfig(); //创建一个模型参数设置对象
|
||||
string rootPath = System.IO.Path.GetDirectoryName(typeof(OCRModelConfig).Assembly.Location); //程序的根目录
|
||||
config.det_infer = rootPath + @"\Data\OCRModel\det_infer"; //文字检测模型路径
|
||||
config.cls_infer = rootPath + @"\Data\OCRModel\cls_infer"; //文本角度模型路径
|
||||
config.rec_infer = rootPath + @"\Data\OCRModel\rec_infer"; //文字内容识别模型路径
|
||||
//以上三个模型参数的文件路径只需要写到存放的文件夹名称
|
||||
//对于字典来说需要写全加上后缀
|
||||
config.keys = rootPath + @"\Data\OCRModel\keys\ppocr_keys.txt"; //词典路径
|
||||
|
||||
//OCR参数设置
|
||||
OCRParameter OcrParameter = new OCRParameter(); //创建一个检测参数设置对象
|
||||
|
||||
OcrParameter.cpu_math_library_num_threads = 8;//预测并发线程数
|
||||
OcrParameter.enable_mkldnn = true;//web部署该值建议设置为0,否则出错,内存如果使用很大,建议该值也设置为0.
|
||||
OcrParameter.cls = true; //是否执行文字方向分类;默认false
|
||||
OcrParameter.det = true;//是否开启方向检测,用于检测识别180旋转
|
||||
OcrParameter.rec = true;
|
||||
OcrParameter.use_angle_cls = true;//是否开启方向检测,用于检测识别180旋转
|
||||
OcrParameter.det_db_score_mode = true;//是否使用多段线,即文字区域是用多段线还是用矩形,
|
||||
OcrParameter.det_db_unclip_ratio = 1.6f;
|
||||
OcrParameter.max_side_len = 4600;
|
||||
|
||||
OCRModelConfig config = null;
|
||||
//初始化OCR
|
||||
Engine = new PaddleOCREngine(config, OcrParameter);
|
||||
Engine = new PaddleOCREngine(config, "");
|
||||
log.Info("OCR模型初始化完成");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -1341,67 +1320,91 @@ namespace TetraPackOCR
|
||||
NoticePLCCompleteOCR();
|
||||
return;
|
||||
}
|
||||
Mat hsv = new Mat();
|
||||
Cv2.CvtColor(bgr, hsv, ColorConversionCodes.BGR2HSV); // 1. 转 HSV
|
||||
Mat[] channels = Cv2.Split(hsv); // 2. 拆通道
|
||||
Mat h = channels[0]; // Hue 0-180
|
||||
Mat s = channels[1]; // Saturation 0-255
|
||||
Mat v = channels[2]; // Value 0-255
|
||||
bool matchOK = false;
|
||||
OCRTextResult rgbResult = null;
|
||||
List<PointF[]> pointRGB = null;
|
||||
rgbResult = OCRBytes(bgr.ToBytes());
|
||||
if (rgbResult == null)
|
||||
{
|
||||
log.Error("彩色通道,OCR字符识别失败");
|
||||
NoticePLCCompleteOCR();
|
||||
return;
|
||||
}
|
||||
txt_readOcrResultShow.Text = rgbResult.text;
|
||||
log.Info("彩色通道字符读取结果:" + rgbResult.text);
|
||||
matchOK = rgbResult.match;
|
||||
pointRGB = rgbResult.points;
|
||||
|
||||
Mat hsv = null;
|
||||
OCRTextResult hResult = null;
|
||||
OCRTextResult sResult = null;
|
||||
OCRTextResult vResult = null;
|
||||
|
||||
bool matchOK = false;
|
||||
List<PointF[]> pointS = null;
|
||||
List<PointF[]> pointH = null;
|
||||
List<PointF[]> pointV = null;
|
||||
sResult = OCRBytes(s.ImEncode(".png"));
|
||||
if (sResult == null)
|
||||
if (!matchOK)
|
||||
{
|
||||
log.Error("s通道,OCR字符识别失败");
|
||||
NoticePLCCompleteOCR();
|
||||
return;
|
||||
}
|
||||
txt_readOcrResultShow.Text = sResult.text;
|
||||
log.Info("s通道字符读取结果:" + sResult.text);
|
||||
matchOK = sResult.match;
|
||||
pointS = sResult.points;
|
||||
hsv = new Mat();
|
||||
Cv2.CvtColor(bgr, hsv, ColorConversionCodes.BGR2HSV); // 1. 转 HSV
|
||||
Mat[] channels = Cv2.Split(hsv); // 2. 拆通道
|
||||
Mat h = channels[0]; // Hue 0-180
|
||||
Mat s = channels[1]; // Saturation 0-255
|
||||
Mat v = channels[2]; // Value 0-255
|
||||
|
||||
if (!matchOK)
|
||||
{
|
||||
hResult = OCRBytes(h.ImEncode(".png"));
|
||||
if (hResult == null)
|
||||
sResult = OCRBytes(s.ImEncode(".png"));
|
||||
if (sResult == null)
|
||||
{
|
||||
log.Error("h通道,OCR字符识别失败");
|
||||
log.Error("s通道,OCR字符识别失败");
|
||||
NoticePLCCompleteOCR();
|
||||
return;
|
||||
}
|
||||
txt_readOcrResultShow.Text += "\n" + hResult.text;
|
||||
log.Info("h通道字符读取结果:" + hResult.text);
|
||||
matchOK = hResult.match;
|
||||
pointH = hResult.points;
|
||||
}
|
||||
if (!matchOK)
|
||||
{
|
||||
vResult = OCRBytes(v.ImEncode(".png"));
|
||||
if (vResult == null)
|
||||
txt_readOcrResultShow.Text = "\n" + sResult.text;
|
||||
log.Info("s通道字符读取结果:" + sResult.text);
|
||||
matchOK = sResult.match;
|
||||
pointS = sResult.points;
|
||||
|
||||
if (!matchOK)
|
||||
{
|
||||
log.Error("v通道,OCR字符识别失败");
|
||||
NoticePLCCompleteOCR();
|
||||
return;
|
||||
hResult = OCRBytes(h.ImEncode(".png"));
|
||||
if (hResult == null)
|
||||
{
|
||||
log.Error("h通道,OCR字符识别失败");
|
||||
NoticePLCCompleteOCR();
|
||||
return;
|
||||
}
|
||||
txt_readOcrResultShow.Text += "\n" + hResult.text;
|
||||
log.Info("h通道字符读取结果:" + hResult.text);
|
||||
matchOK = hResult.match;
|
||||
pointH = hResult.points;
|
||||
}
|
||||
if (!matchOK)
|
||||
{
|
||||
vResult = OCRBytes(v.ImEncode(".png"));
|
||||
if (vResult == null)
|
||||
{
|
||||
log.Error("v通道,OCR字符识别失败");
|
||||
NoticePLCCompleteOCR();
|
||||
return;
|
||||
}
|
||||
txt_readOcrResultShow.Text += "\n" + vResult.text;
|
||||
log.Info("v通道字符读取结果:" + vResult.text);
|
||||
matchOK = vResult.match;
|
||||
pointV = vResult.points;
|
||||
}
|
||||
txt_readOcrResultShow.Text += "\n" + vResult.text;
|
||||
log.Info("v通道字符读取结果:" + vResult.text);
|
||||
matchOK = vResult.match;
|
||||
pointV = vResult.points;
|
||||
}
|
||||
|
||||
byte[] ocrimagebyte = File.ReadAllBytes(file.FileName);
|
||||
Bitmap Bmp = new Bitmap(new MemoryStream(ocrimagebyte));
|
||||
if ((pointS != null && pointS.Count > 0) || (pointH != null && pointH.Count > 0) || (pointV != null && pointV.Count > 0))
|
||||
if ((pointRGB != null && pointRGB.Count > 0) || (pointS != null && pointS.Count > 0) || (pointH != null && pointH.Count > 0) || (pointV != null && pointV.Count > 0))
|
||||
{
|
||||
using (Graphics g = Graphics.FromImage(Bmp))
|
||||
{
|
||||
if (pointRGB != null && pointRGB.Count > 0)
|
||||
{
|
||||
foreach (var item in pointRGB)
|
||||
g.DrawPolygon(new Pen(Brushes.Red, 2), item.Select(x => new PointF() { X = x.X, Y = x.Y }).ToArray());
|
||||
}
|
||||
if (pointS != null && pointS.Count > 0)
|
||||
{
|
||||
foreach (var item in pointS)
|
||||
@@ -1556,6 +1559,7 @@ namespace TetraPackOCR
|
||||
{
|
||||
readOCR[i] = readOCR[i].Replace("_", "");
|
||||
readOCR[i] = readOCR[i].Replace(" ", "");
|
||||
readOCR[i] = readOCR[i].Replace(".", "");
|
||||
}
|
||||
MatchCollection matchResults;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props" Condition="Exists('..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props')" />
|
||||
<Import Project="..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props" Condition="Exists('..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props')" />
|
||||
<Import Project="..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props" Condition="Exists('..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -128,17 +128,17 @@
|
||||
<Reference Include="Enums.NET, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7ea1c1650d506225, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Enums.NET.5.0.0\lib\net461\Enums.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EPPlus, Version=8.2.1.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EPPlus.8.2.1\lib\net462\EPPlus.dll</HintPath>
|
||||
<Reference Include="EPPlus, Version=8.4.0.0, Culture=neutral, PublicKeyToken=ea159fdaa78159a1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EPPlus.8.4.0\lib\net462\EPPlus.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EPPlus.Interfaces, Version=8.1.0.0, Culture=neutral, PublicKeyToken=a694d7f3b0907a61, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EPPlus.Interfaces.8.1.0\lib\net462\EPPlus.Interfaces.dll</HintPath>
|
||||
<Reference Include="EPPlus.Interfaces, Version=8.4.0.0, Culture=neutral, PublicKeyToken=a694d7f3b0907a61, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EPPlus.Interfaces.8.4.0\lib\net462\EPPlus.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="EPPlus.System.Drawing, Version=8.1.0.0, Culture=neutral, PublicKeyToken=2308d35469c9bac0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EPPlus.System.Drawing.8.1.0\lib\net462\EPPlus.System.Drawing.dll</HintPath>
|
||||
<Reference Include="EPPlus.System.Drawing, Version=8.4.0.0, Culture=neutral, PublicKeyToken=2308d35469c9bac0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\EPPlus.System.Drawing.8.4.0\lib\net462\EPPlus.System.Drawing.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ExtendedNumerics.BigDecimal, Version=3001.1.0.233, Culture=neutral, PublicKeyToken=65f1315a45ad8949, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ExtendedNumerics.BigDecimal.3001.1.0.233\lib\net472\ExtendedNumerics.BigDecimal.dll</HintPath>
|
||||
<Reference Include="ExtendedNumerics.BigDecimal, Version=3003.0.0.346, Culture=neutral, PublicKeyToken=65f1315a45ad8949, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\ExtendedNumerics.BigDecimal.3003.0.0.346\lib\net472\ExtendedNumerics.BigDecimal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.4.2.13, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpZipLib.1.4.2\lib\netstandard2.0\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
@@ -153,8 +153,8 @@
|
||||
<Reference Include="MathNet.Numerics, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cd8b63ad3d691a37, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MathNet.Numerics.Signed.5.0.0\lib\net461\MathNet.Numerics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.Cryptography, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.Cryptography.10.0.0-rc.2.25502.107\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
|
||||
<Reference Include="Microsoft.Bcl.Cryptography, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Bcl.Cryptography.10.0.1\lib\net462\Microsoft.Bcl.Cryptography.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IO.RecyclableMemoryStream, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IO.RecyclableMemoryStream.3.0.1\lib\netstandard2.0\Microsoft.IO.RecyclableMemoryStream.dll</HintPath>
|
||||
@@ -183,8 +183,8 @@
|
||||
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\OpenCvSharp4.Extensions.4.11.0.20250507\lib\netstandard2.0\OpenCvSharp.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PaddleOCRSharp, Version=5.1.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\packages\PaddleOCRSharp.5.1.0\lib\net47\PaddleOCRSharp.dll</HintPath>
|
||||
<Reference Include="PaddleOCRSharp, Version=6.0.0.0, Culture=neutral, processorArchitecture=AMD64">
|
||||
<HintPath>..\packages\PaddleOCRSharp.6.0.0\lib\net47\PaddleOCRSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
@@ -206,10 +206,10 @@
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Drawing.Common.10.0.0-rc.2.25502.107\lib\net462\System.Drawing.Common.dll</HintPath>
|
||||
<HintPath>..\packages\System.Drawing.Common.10.0.1\lib\net462\System.Drawing.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Formats.Asn1, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Formats.Asn1.10.0.0-rc.2.25502.107\lib\net462\System.Formats.Asn1.dll</HintPath>
|
||||
<Reference Include="System.Formats.Asn1, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Formats.Asn1.10.0.1\lib\net462\System.Formats.Asn1.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
|
||||
@@ -238,11 +238,11 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Security.Cryptography.Xml, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Xml.10.0.0-rc.2.25502.107\lib\net462\System.Security.Cryptography.Xml.dll</HintPath>
|
||||
<Reference Include="System.Security.Cryptography.Xml, Version=10.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Security.Cryptography.Xml.10.0.1\lib\net462\System.Security.Cryptography.Xml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encoding.CodePages, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encoding.CodePages.10.0.0-rc.2.25502.107\lib\net462\System.Text.Encoding.CodePages.dll</HintPath>
|
||||
<Reference Include="System.Text.Encoding.CodePages, Version=10.0.0.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Text.Encoding.CodePages.10.0.1\lib\net462\System.Text.Encoding.CodePages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks" />
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.4.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
@@ -340,13 +340,13 @@
|
||||
<PropertyGroup>
|
||||
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\Paddle.Runtime.win_x64.3.1.0.1\build\Paddle.Runtime.win_x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Paddle.Runtime.win_x64.3.1.0.1\build\Paddle.Runtime.win_x64.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SixLabors.ImageSharp.3.1.11\build\SixLabors.ImageSharp.props'))" />
|
||||
<Error Condition="!Exists('..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\OpenCvSharp4.runtime.win.4.11.0.20250507\build\netstandard\OpenCvSharp4.runtime.win.props'))" />
|
||||
<Error Condition="!Exists('..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\PaddleOCRSharp.6.0.0\build\PaddleOCRSharp.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PaddleOCRSharp.6.0.0\build\PaddleOCRSharp.targets'))" />
|
||||
<Error Condition="!Exists('..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SixLabors.ImageSharp.3.1.12\build\SixLabors.ImageSharp.props'))" />
|
||||
</Target>
|
||||
<Import Project="..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets" Condition="Exists('..\packages\PaddleOCRSharp.5.1.0\build\PaddleOCRSharp.targets')" />
|
||||
<Import Project="..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets" Condition="Exists('..\packages\System.ValueTuple.4.6.1\build\net471\System.ValueTuple.targets')" />
|
||||
<Import Project="..\packages\Paddle.Runtime.win_x64.3.1.0.1\build\Paddle.Runtime.win_x64.targets" Condition="Exists('..\packages\Paddle.Runtime.win_x64.3.1.0.1\build\Paddle.Runtime.win_x64.targets')" />
|
||||
<Import Project="..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets" Condition="Exists('..\packages\Paddle.Runtime.win_x64.3.2.2\build\Paddle.Runtime.win_x64.targets')" />
|
||||
<Import Project="..\packages\PaddleOCRSharp.6.0.0\build\PaddleOCRSharp.targets" Condition="Exists('..\packages\PaddleOCRSharp.6.0.0\build\PaddleOCRSharp.targets')" />
|
||||
</Project>
|
||||
@@ -2,12 +2,12 @@
|
||||
<packages>
|
||||
<package id="BouncyCastle.Cryptography" version="2.7.0-beta.98" targetFramework="net472" />
|
||||
<package id="Enums.NET" version="5.0.0" targetFramework="net472" />
|
||||
<package id="EPPlus" version="8.2.1" targetFramework="net472" />
|
||||
<package id="EPPlus.Interfaces" version="8.1.0" targetFramework="net472" />
|
||||
<package id="EPPlus.System.Drawing" version="8.1.0" targetFramework="net472" />
|
||||
<package id="ExtendedNumerics.BigDecimal" version="3001.1.0.233" targetFramework="net472" />
|
||||
<package id="EPPlus" version="8.4.0" targetFramework="net472" />
|
||||
<package id="EPPlus.Interfaces" version="8.4.0" targetFramework="net472" />
|
||||
<package id="EPPlus.System.Drawing" version="8.4.0" targetFramework="net472" />
|
||||
<package id="ExtendedNumerics.BigDecimal" version="3003.0.0.346" targetFramework="net472" />
|
||||
<package id="MathNet.Numerics.Signed" version="5.0.0" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.Cryptography" version="10.0.0-rc.2.25502.107" targetFramework="net472" />
|
||||
<package id="Microsoft.Bcl.Cryptography" version="10.0.1" targetFramework="net472" />
|
||||
<package id="Microsoft.IO.RecyclableMemoryStream" version="3.0.1" targetFramework="net472" />
|
||||
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net472" />
|
||||
<package id="NPOI" version="2.7.5" targetFramework="net472" />
|
||||
@@ -15,24 +15,24 @@
|
||||
<package id="OpenCvSharp4" version="4.11.0.20250507" targetFramework="net472" />
|
||||
<package id="OpenCvSharp4.Extensions" version="4.11.0.20250507" targetFramework="net472" />
|
||||
<package id="OpenCvSharp4.runtime.win" version="4.11.0.20250507" targetFramework="net472" />
|
||||
<package id="Paddle.Runtime.win_x64" version="3.1.0.1" targetFramework="net472" />
|
||||
<package id="PaddleOCRSharp" version="5.1.0" targetFramework="net472" />
|
||||
<package id="Paddle.Runtime.win_x64" version="3.2.2" targetFramework="net472" />
|
||||
<package id="PaddleOCRSharp" version="6.0.0" targetFramework="net472" />
|
||||
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
|
||||
<package id="SharpZipLib" version="1.4.2" targetFramework="net472" />
|
||||
<package id="SixLabors.Fonts" version="1.0.1" targetFramework="net472" />
|
||||
<package id="SixLabors.ImageSharp" version="3.1.11" targetFramework="net472" />
|
||||
<package id="SixLabors.ImageSharp" version="3.1.12" targetFramework="net472" />
|
||||
<package id="System.Buffers" version="4.6.1" targetFramework="net472" />
|
||||
<package id="System.ComponentModel.Annotations" version="5.0.0" targetFramework="net472" />
|
||||
<package id="System.Drawing.Common" version="10.0.0-rc.2.25502.107" targetFramework="net472" />
|
||||
<package id="System.Formats.Asn1" version="10.0.0-rc.2.25502.107" targetFramework="net472" />
|
||||
<package id="System.Drawing.Common" version="10.0.1" targetFramework="net472" />
|
||||
<package id="System.Formats.Asn1" version="10.0.1" targetFramework="net472" />
|
||||
<package id="System.IO.Compression" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.IO.UnmanagedMemoryStream" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.Memory" version="4.6.3" targetFramework="net472" />
|
||||
<package id="System.Numerics.Vectors" version="4.6.1" targetFramework="net472" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="6.1.2" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.Xml" version="10.0.0-rc.2.25502.107" targetFramework="net472" />
|
||||
<package id="System.Text.Encoding.CodePages" version="10.0.0-rc.2.25502.107" targetFramework="net472" />
|
||||
<package id="System.Security.Cryptography.Xml" version="10.0.1" targetFramework="net472" />
|
||||
<package id="System.Text.Encoding.CodePages" version="10.0.1" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.6.3" targetFramework="net472" />
|
||||
<package id="System.Threading.Tasks.Parallel" version="4.3.0" targetFramework="net472" />
|
||||
<package id="System.ValueTuple" version="4.6.1" targetFramework="net472" />
|
||||
|
||||
Reference in New Issue
Block a user