Commit d888db92 张东亮

ocr整张图识别

1 个父辈 9d168cb9
......@@ -112,6 +112,7 @@
<Compile Include="MaterialEdit.cs" />
<Compile Include="PrintLabelShow.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Setting_Str.cs" />
<Compile Include="TextBlock.cs" />
<Compile Include="UsersLogin.cs" />
</ItemGroup>
......
......@@ -163,15 +163,6 @@ namespace BLL
}
/// <summary>
/// 启用OCR识别
/// </summary>
public bool EnabledOCR
{
get => config.Read(ENABLED_OCR, true);
set => config.Write(ENABLED_OCR, value);
}
/// <summary>
/// IO模块IP地址
/// </summary>
public string IOIPAddress
......@@ -332,8 +323,9 @@ namespace BLL
public static MyConfig<string> DataSource_DataTitle;
[MyConfigComment("遍历数据源目录")]
public static MyConfig<bool> DataSource_Recursive;
[MyConfigComment("是否启用OCR")]
public static MyConfig<bool> Func_EnabledOCR;
public void Save()
{
......@@ -365,7 +357,6 @@ namespace BLL
private const string PROMPT_AFTER_PRINTING = "PromptAfterPrinting";
private const string ENABLED_IO = "EnabledIO";
private const string ENABLED_CAMERA = "EnabledCamera";
private const string ENABLED_OCR = "EnabledOCR";
private const string IO_IP = "IOIP";
private const string IO_TOUCH = "IOTouch";
private const string IO_LIGHT = "IOLight";
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class Setting_Str
{
}
}
......@@ -47,10 +47,9 @@ namespace SmartScan
LogNet.log.Info($"加载IO模块,IP地址:{ip},iomodule:{Common.config.iomodule}");
}
if (Common.config.EnabledOCR)
if (Config.Func_EnabledOCR)
{
//Common.ocr = new();
LogNet.log.Info("加载OCR模块");
LogNet.log.Info("启用OCR模块");
}
Common.lightSource = new();
......
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Asa.FaceControl;
using BLL;
using Model;
namespace SmartScan
......@@ -17,7 +18,7 @@ namespace SmartScan
public UsrMaterialTemplate()
{
InitializeComponent();
BtnOcrCode.Enabled = Common.config.EnabledOCR;
BtnOcrCode.Enabled = Config.Func_EnabledOCR;
LstMate.Items.AddRange(Common.mateEdit.Name);
mateCopy = Common.mateEdit.ToCopy();
Language.SetLanguage(this);
......
此文件的差异太大,无法显示。
此文件的差异太大,无法显示。
......@@ -28,107 +28,81 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Paddle));
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button4 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(11, 11);
this.textBox1.Margin = new System.Windows.Forms.Padding(2);
this.textBox1.Location = new System.Drawing.Point(15, 14);
this.textBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(569, 21);
this.textBox1.Size = new System.Drawing.Size(757, 25);
this.textBox1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(594, 11);
this.button1.Margin = new System.Windows.Forms.Padding(2);
this.button1.Location = new System.Drawing.Point(792, 14);
this.button1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(105, 29);
this.button1.Size = new System.Drawing.Size(140, 36);
this.button1.TabIndex = 1;
this.button1.Text = "打开";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(119, 68);
this.button2.Margin = new System.Windows.Forms.Padding(2);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(112, 39);
this.button2.TabIndex = 2;
this.button2.Text = "python识别";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.pictureBox1.Location = new System.Drawing.Point(0, 213);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(745, 470);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// textBox2
//
this.textBox2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.textBox2.Location = new System.Drawing.Point(0, 118);
this.textBox2.Margin = new System.Windows.Forms.Padding(2);
this.textBox2.Location = new System.Drawing.Point(0, 153);
this.textBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.textBox2.Multiline = true;
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(745, 95);
this.textBox2.Size = new System.Drawing.Size(993, 409);
this.textBox2.TabIndex = 4;
this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(494, 81);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Location = new System.Drawing.Point(401, 84);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(49, 13);
this.label1.Size = new System.Drawing.Size(55, 15);
this.label1.TabIndex = 7;
this.label1.Text = "label1";
//
// button4
//
this.button4.Location = new System.Drawing.Point(262, 68);
this.button4.Margin = new System.Windows.Forms.Padding(2);
this.button4.Location = new System.Drawing.Point(146, 67);
this.button4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(112, 39);
this.button4.Size = new System.Drawing.Size(149, 49);
this.button4.TabIndex = 8;
this.button4.Text = "c++识别";
this.button4.Text = "ocr识别";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// Paddle
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(745, 683);
this.ClientSize = new System.Drawing.Size(993, 562);
this.Controls.Add(this.button4);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.Margin = new System.Windows.Forms.Padding(2);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Name = "Paddle";
this.Text = "PaddleOcr";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Paddle_FormClosed);
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
......@@ -138,8 +112,6 @@
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button4;
......
......@@ -56,7 +56,7 @@ namespace paddleOCR
try
{
Stream s = File.Open(System.Windows.Forms.Application.StartupPath + @"\ocr_result.jpg", FileMode.Open);
pictureBox1.Image = Bitmap.FromStream(s);
// pictureBox1.Image = Bitmap.FromStream(s);
s.Close();
s.Dispose();
}
......@@ -91,7 +91,7 @@ namespace paddleOCR
try
{
Stream s = File.Open(System.Windows.Forms.Application.StartupPath + @"\ocr_result.jpg", FileMode.Open);
pictureBox1.Image = Bitmap.FromStream(s);
// pictureBox1.Image = Bitmap.FromStream(s);
s.Close();
s.Dispose();
}
......@@ -129,7 +129,7 @@ namespace paddleOCR
try
{
Stream s = File.Open(System.Windows.Forms.Application.StartupPath + @"\ocr_result.jpg", FileMode.Open);
pictureBox1.Image = Bitmap.FromStream(s);
// pictureBox1.Image = Bitmap.FromStream(s);
s.Close();
s.Dispose();
}
......
......@@ -117,4 +117,81 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAACMuAAAjLgAAAAAAAAAA
AADlPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/N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Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+VCOf/jMij/7Xlz///////74eD/5UA3/+U+Nf/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPDL/+tnX///////ugnz/4zIp/+VCOf/lPzb/5T82/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPjX/+t3c///////ugHr/4zMp/+VC
Of/lPzb/5T82/+U/Nv/lPzb/5UI5/+MxKP/vioT///////nU0v/kOjH/5UA3/+U/Nv/lPzb/5T82/+U/
Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+U/Nv/lQTj/5kU8/+M0Kv/wjYj///////nS
0P/kOTD/5UE4/+VCOf/lQTj/5UE4/+VBOP/lQjn/5T82/+ZGPf/86ej//////+xya//kNCv/5kM6/+VB
Of/lQTj/5UE4/+VBOP/lQTj/5UA3/+U/Nv/lPzb/5T82/+U/Nv/lPzb/5T82/+Q2LP/kNSz/4zMp/+U8
M//75eT//////+xxav/jMij/5DYt/+Q1K//kNSv/5DUr/+Q0K//kOjH/4zEn//KdmP//////98XC/+Q2
LP/kOTD/5DQr/+Q1K//kNSv/5DUr/+Q1K//kOzL/5UI5/+U/Nv/lPzb/5T82/+U/Nv/lPzb/62xl/+xv
af/scGr/6mNc//a5tv//////98K//+ZDOv/sdW//621m/+tuZ//rbWf/629o/+plXv/kOC//50pC//74
9///////6mFZ/+leVv/scmz/621m/+tuZ//rbmf/625n/+dQR//jNCr/5UA3/+U/Nv/lPzb/5UI5/+Q0
Kv/3wL3//////////////////////////////v7/7HFr//719f////////////////////////////rc
2v/nSkL/86Wh///////zp6P/8p2Y//////////////////////////////z7//GWkf/kNy7/5UA3/+U/
Nv/lQTj/5Dgv/+lbVP/3xcL/9sC9//fCv//2vbr/+tzb///////zqqb/7Xdx//fBvv/1s7D/9bay//Wz
r//509H///////ra2P/pX1j///////739//qZ2D/9LCs//W3s//1tbL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