关闭需要密码,通过按钮可直接打开图片文件路径
This commit is contained in:
parent
33fd534579
commit
df8736bcb1
@ -72,7 +72,7 @@ namespace HisenceYoloDetection
|
|||||||
/// <param name="path2">要对比的图像</param>
|
/// <param name="path2">要对比的图像</param>
|
||||||
/// <param name="IfWhiteWord"> 白板黑字为true </param>
|
/// <param name="IfWhiteWord"> 白板黑字为true </param>
|
||||||
/// <param name="saveDir">存储路径</param>
|
/// <param name="saveDir">存储路径</param>
|
||||||
public static bool CheckDiffSci(string path1, Mat MatDet, ref Mat ResultMat,Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir)
|
public static bool CheckDiffSci(string path1, Mat MatDet, ref Mat ResultMat,Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir,string SN)
|
||||||
{
|
{
|
||||||
// 读取和处理第一张图片。。
|
// 读取和处理第一张图片。。
|
||||||
Mat img1 = Cv2.ImRead(path1, ImreadModes.Color);
|
Mat img1 = Cv2.ImRead(path1, ImreadModes.Color);
|
||||||
@ -152,7 +152,7 @@ namespace HisenceYoloDetection
|
|||||||
Cv2.Resize(thr1, thr1, new Size(550, 270));
|
Cv2.Resize(thr1, thr1, new Size(550, 270));
|
||||||
Cv2.Resize(thr2, thr2, new Size(550, 270));
|
Cv2.Resize(thr2, thr2, new Size(550, 270));
|
||||||
DateTime dt = DateTime.Now;
|
DateTime dt = DateTime.Now;
|
||||||
string filename = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString();
|
string filename = SN;
|
||||||
|
|
||||||
// string savePath4 = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path1) + filename + "_thr1.png");
|
// string savePath4 = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path1) + filename + "_thr1.png");
|
||||||
// 保存结果
|
// 保存结果
|
||||||
@ -317,7 +317,7 @@ namespace HisenceYoloDetection
|
|||||||
/// <param name="path2">要对比的图像</param>
|
/// <param name="path2">要对比的图像</param>
|
||||||
/// <param name="IfWhiteWord"> 白板黑字为true </param>
|
/// <param name="IfWhiteWord"> 白板黑字为true </param>
|
||||||
/// <param name="saveDir">存储路径</param>
|
/// <param name="saveDir">存储路径</param>
|
||||||
public static bool CheckDiffSci(string path1, Mat MatDet, Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir)
|
public static bool CheckDiffSci(string path1, Mat MatDet, Rect sqlrect, Rect detrect, bool IfWhiteWord, string saveDir,string SN)
|
||||||
{
|
{
|
||||||
// 读取和处理第一张图片
|
// 读取和处理第一张图片
|
||||||
Mat img1 = Cv2.ImRead(path1, ImreadModes.Color);
|
Mat img1 = Cv2.ImRead(path1, ImreadModes.Color);
|
||||||
@ -394,7 +394,7 @@ namespace HisenceYoloDetection
|
|||||||
Cv2.Resize(thr1, thr1, new Size(845, 498));
|
Cv2.Resize(thr1, thr1, new Size(845, 498));
|
||||||
Cv2.Resize(thr2, thr2, new Size(845, 498));
|
Cv2.Resize(thr2, thr2, new Size(845, 498));
|
||||||
DateTime dt = DateTime.Now;
|
DateTime dt = DateTime.Now;
|
||||||
string filename = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString();
|
string filename = SN;
|
||||||
|
|
||||||
//string savePath4 = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path1) + filename + "_thr1.png");
|
//string savePath4 = Path.Combine(saveDir, Path.GetFileNameWithoutExtension(path1) + filename + "_thr1.png");
|
||||||
// 保存结果
|
// 保存结果
|
||||||
|
83
HisenceYoloDetection/Form2.Designer.cs
generated
Normal file
83
HisenceYoloDetection/Form2.Designer.cs
generated
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
namespace HisenceYoloDetection
|
||||||
|
{
|
||||||
|
partial class Form2
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
button1 = new Button();
|
||||||
|
textBox1 = new TextBox();
|
||||||
|
label1 = new Label();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// button1
|
||||||
|
//
|
||||||
|
button1.Location = new Point(301, 82);
|
||||||
|
button1.Name = "button1";
|
||||||
|
button1.Size = new Size(112, 34);
|
||||||
|
button1.TabIndex = 0;
|
||||||
|
button1.Text = "验证";
|
||||||
|
button1.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
|
// textBox1
|
||||||
|
//
|
||||||
|
textBox1.Location = new Point(224, 34);
|
||||||
|
textBox1.Name = "textBox1";
|
||||||
|
textBox1.Size = new Size(269, 30);
|
||||||
|
textBox1.TabIndex = 1;
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(91, 34);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(100, 24);
|
||||||
|
label1.TabIndex = 2;
|
||||||
|
label1.Text = "退出密码:";
|
||||||
|
label1.Click += label1_Click;
|
||||||
|
//
|
||||||
|
// Form2
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(11F, 24F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(674, 130);
|
||||||
|
Controls.Add(label1);
|
||||||
|
Controls.Add(textBox1);
|
||||||
|
Controls.Add(button1);
|
||||||
|
Name = "Form2";
|
||||||
|
Text = "退出验证";
|
||||||
|
Load += Form2_Load;
|
||||||
|
ResumeLayout(false);
|
||||||
|
PerformLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private Button button1;
|
||||||
|
private TextBox textBox1;
|
||||||
|
private Label label1;
|
||||||
|
}
|
||||||
|
}
|
39
HisenceYoloDetection/Form2.cs
Normal file
39
HisenceYoloDetection/Form2.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
|
||||||
|
namespace HisenceYoloDetection
|
||||||
|
{
|
||||||
|
public partial class Form2 : Form
|
||||||
|
{
|
||||||
|
public string EnteredPassword { get; private set; }
|
||||||
|
public Form2()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
button1.Click += button1_Click; // 订阅按钮点击事件
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
EnteredPassword = textBox1.Text;
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Form2_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
CenterToScreen();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void label1_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
HisenceYoloDetection/Form2.resx
Normal file
120
HisenceYoloDetection/Form2.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
66
HisenceYoloDetection/MainForm.Designer.cs
generated
66
HisenceYoloDetection/MainForm.Designer.cs
generated
@ -151,6 +151,9 @@
|
|||||||
StartDecBtn = new Button();
|
StartDecBtn = new Button();
|
||||||
CloseDecBtn = new Button();
|
CloseDecBtn = new Button();
|
||||||
groupBox6 = new GroupBox();
|
groupBox6 = new GroupBox();
|
||||||
|
button6 = new Button();
|
||||||
|
button5 = new Button();
|
||||||
|
button4 = new Button();
|
||||||
textBox2 = new TextBox();
|
textBox2 = new TextBox();
|
||||||
label37 = new Label();
|
label37 = new Label();
|
||||||
textBox3 = new TextBox();
|
textBox3 = new TextBox();
|
||||||
@ -1387,10 +1390,10 @@
|
|||||||
groupBox8.Controls.Add(label20);
|
groupBox8.Controls.Add(label20);
|
||||||
groupBox8.Controls.Add(textBox1);
|
groupBox8.Controls.Add(textBox1);
|
||||||
groupBox8.Controls.Add(label35);
|
groupBox8.Controls.Add(label35);
|
||||||
groupBox8.Location = new Point(11, 326);
|
groupBox8.Location = new Point(11, 368);
|
||||||
groupBox8.Name = "groupBox8";
|
groupBox8.Name = "groupBox8";
|
||||||
groupBox8.RightToLeft = RightToLeft.No;
|
groupBox8.RightToLeft = RightToLeft.No;
|
||||||
groupBox8.Size = new Size(596, 462);
|
groupBox8.Size = new Size(596, 420);
|
||||||
groupBox8.TabIndex = 24;
|
groupBox8.TabIndex = 24;
|
||||||
groupBox8.TabStop = false;
|
groupBox8.TabStop = false;
|
||||||
groupBox8.Text = "生产信息";
|
groupBox8.Text = "生产信息";
|
||||||
@ -1508,7 +1511,7 @@
|
|||||||
label35.Name = "label35";
|
label35.Name = "label35";
|
||||||
label35.Size = new Size(75, 25);
|
label35.Size = new Size(75, 25);
|
||||||
label35.TabIndex = 14;
|
label35.TabIndex = 14;
|
||||||
label35.Text = "误检率";
|
label35.Text = "误检数";
|
||||||
//
|
//
|
||||||
// groupBox7
|
// groupBox7
|
||||||
//
|
//
|
||||||
@ -1557,6 +1560,9 @@
|
|||||||
//
|
//
|
||||||
// groupBox6
|
// groupBox6
|
||||||
//
|
//
|
||||||
|
groupBox6.Controls.Add(button6);
|
||||||
|
groupBox6.Controls.Add(button5);
|
||||||
|
groupBox6.Controls.Add(button4);
|
||||||
groupBox6.Controls.Add(textBox2);
|
groupBox6.Controls.Add(textBox2);
|
||||||
groupBox6.Controls.Add(label37);
|
groupBox6.Controls.Add(label37);
|
||||||
groupBox6.Controls.Add(textBox3);
|
groupBox6.Controls.Add(textBox3);
|
||||||
@ -1565,14 +1571,47 @@
|
|||||||
groupBox6.Controls.Add(ScannerBox);
|
groupBox6.Controls.Add(ScannerBox);
|
||||||
groupBox6.Location = new Point(11, 120);
|
groupBox6.Location = new Point(11, 120);
|
||||||
groupBox6.Name = "groupBox6";
|
groupBox6.Name = "groupBox6";
|
||||||
groupBox6.Size = new Size(582, 191);
|
groupBox6.Size = new Size(582, 231);
|
||||||
groupBox6.TabIndex = 22;
|
groupBox6.TabIndex = 22;
|
||||||
groupBox6.TabStop = false;
|
groupBox6.TabStop = false;
|
||||||
groupBox6.Text = "基础信息";
|
groupBox6.Text = "基础信息";
|
||||||
//
|
//
|
||||||
|
// button6
|
||||||
|
//
|
||||||
|
button6.Location = new Point(438, 172);
|
||||||
|
button6.Margin = new Padding(4, 2, 4, 2);
|
||||||
|
button6.Name = "button6";
|
||||||
|
button6.Size = new Size(137, 54);
|
||||||
|
button6.TabIndex = 25;
|
||||||
|
button6.Text = "第二块NG";
|
||||||
|
button6.UseVisualStyleBackColor = true;
|
||||||
|
button6.Click += button6_Click;
|
||||||
|
//
|
||||||
|
// button5
|
||||||
|
//
|
||||||
|
button5.Location = new Point(438, 95);
|
||||||
|
button5.Margin = new Padding(4, 2, 4, 2);
|
||||||
|
button5.Name = "button5";
|
||||||
|
button5.Size = new Size(137, 54);
|
||||||
|
button5.TabIndex = 24;
|
||||||
|
button5.Text = "第一块NG";
|
||||||
|
button5.UseVisualStyleBackColor = true;
|
||||||
|
button5.Click += button5_Click;
|
||||||
|
//
|
||||||
|
// button4
|
||||||
|
//
|
||||||
|
button4.Location = new Point(438, 22);
|
||||||
|
button4.Margin = new Padding(4, 2, 4, 2);
|
||||||
|
button4.Name = "button4";
|
||||||
|
button4.Size = new Size(137, 54);
|
||||||
|
button4.TabIndex = 21;
|
||||||
|
button4.Text = "相机照片";
|
||||||
|
button4.UseVisualStyleBackColor = true;
|
||||||
|
button4.Click += button4_Click_2;
|
||||||
|
//
|
||||||
// textBox2
|
// textBox2
|
||||||
//
|
//
|
||||||
textBox2.Location = new Point(128, 146);
|
textBox2.Location = new Point(128, 169);
|
||||||
textBox2.Margin = new Padding(4, 2, 4, 2);
|
textBox2.Margin = new Padding(4, 2, 4, 2);
|
||||||
textBox2.Name = "textBox2";
|
textBox2.Name = "textBox2";
|
||||||
textBox2.ReadOnly = true;
|
textBox2.ReadOnly = true;
|
||||||
@ -1582,7 +1621,7 @@
|
|||||||
// label37
|
// label37
|
||||||
//
|
//
|
||||||
label37.AutoSize = true;
|
label37.AutoSize = true;
|
||||||
label37.Location = new Point(7, 146);
|
label37.Location = new Point(7, 172);
|
||||||
label37.Margin = new Padding(4, 0, 4, 0);
|
label37.Margin = new Padding(4, 0, 4, 0);
|
||||||
label37.Name = "label37";
|
label37.Name = "label37";
|
||||||
label37.Size = new Size(96, 25);
|
label37.Size = new Size(96, 25);
|
||||||
@ -1592,17 +1631,17 @@
|
|||||||
//
|
//
|
||||||
// textBox3
|
// textBox3
|
||||||
//
|
//
|
||||||
textBox3.Location = new Point(128, 95);
|
textBox3.Location = new Point(128, 107);
|
||||||
textBox3.Margin = new Padding(4, 2, 4, 2);
|
textBox3.Margin = new Padding(4, 2, 4, 2);
|
||||||
textBox3.Name = "textBox3";
|
textBox3.Name = "textBox3";
|
||||||
textBox3.ReadOnly = true;
|
textBox3.ReadOnly = true;
|
||||||
textBox3.Size = new Size(402, 31);
|
textBox3.Size = new Size(279, 31);
|
||||||
textBox3.TabIndex = 21;
|
textBox3.TabIndex = 21;
|
||||||
//
|
//
|
||||||
// label25
|
// label25
|
||||||
//
|
//
|
||||||
label25.AutoSize = true;
|
label25.AutoSize = true;
|
||||||
label25.Location = new Point(7, 95);
|
label25.Location = new Point(7, 110);
|
||||||
label25.Margin = new Padding(4, 0, 4, 0);
|
label25.Margin = new Padding(4, 0, 4, 0);
|
||||||
label25.Name = "label25";
|
label25.Name = "label25";
|
||||||
label25.Size = new Size(96, 25);
|
label25.Size = new Size(96, 25);
|
||||||
@ -1627,7 +1666,7 @@
|
|||||||
ScannerBox.Margin = new Padding(4, 2, 4, 2);
|
ScannerBox.Margin = new Padding(4, 2, 4, 2);
|
||||||
ScannerBox.Name = "ScannerBox";
|
ScannerBox.Name = "ScannerBox";
|
||||||
ScannerBox.ReadOnly = true;
|
ScannerBox.ReadOnly = true;
|
||||||
ScannerBox.Size = new Size(402, 31);
|
ScannerBox.Size = new Size(279, 31);
|
||||||
ScannerBox.TabIndex = 18;
|
ScannerBox.TabIndex = 18;
|
||||||
//
|
//
|
||||||
// linkLabel1
|
// linkLabel1
|
||||||
@ -1641,10 +1680,10 @@
|
|||||||
// tabPage3
|
// tabPage3
|
||||||
//
|
//
|
||||||
tabPage3.Controls.Add(panel2);
|
tabPage3.Controls.Add(panel2);
|
||||||
tabPage3.Location = new Point(4, 33);
|
tabPage3.Location = new Point(4, 34);
|
||||||
tabPage3.Margin = new Padding(4, 2, 4, 2);
|
tabPage3.Margin = new Padding(4, 2, 4, 2);
|
||||||
tabPage3.Name = "tabPage3";
|
tabPage3.Name = "tabPage3";
|
||||||
tabPage3.Size = new Size(1276, 816);
|
tabPage3.Size = new Size(1276, 815);
|
||||||
tabPage3.TabIndex = 4;
|
tabPage3.TabIndex = 4;
|
||||||
tabPage3.Text = "录入新型号";
|
tabPage3.Text = "录入新型号";
|
||||||
tabPage3.UseVisualStyleBackColor = true;
|
tabPage3.UseVisualStyleBackColor = true;
|
||||||
@ -2200,5 +2239,8 @@
|
|||||||
private Label label36;
|
private Label label36;
|
||||||
private Label label37;
|
private Label label37;
|
||||||
private PictureBox pictureBox1;
|
private PictureBox pictureBox1;
|
||||||
|
private Button button4;
|
||||||
|
private Button button5;
|
||||||
|
private Button button6;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,7 @@ namespace HisenceYoloDetection
|
|||||||
ManualResetEvent _runHandleAfter = new ManualResetEvent(false);
|
ManualResetEvent _runHandleAfter = new ManualResetEvent(false);
|
||||||
AutoResetEvent _runThreadFormtype = new AutoResetEvent(false);
|
AutoResetEvent _runThreadFormtype = new AutoResetEvent(false);
|
||||||
bool PLC545 = false;
|
bool PLC545 = false;
|
||||||
|
private const string CorrectPassword = "12345";
|
||||||
|
|
||||||
bool PLC548 = false;
|
bool PLC548 = false;
|
||||||
string m_sKEYENCEBar;
|
string m_sKEYENCEBar;
|
||||||
@ -1393,11 +1394,11 @@ namespace HisenceYoloDetection
|
|||||||
// MoveToP(51043, YPos, ZPos + (int)(dismove));
|
// MoveToP(51043, YPos, ZPos + (int)(dismove));
|
||||||
//Cam1.Snapshot();
|
//Cam1.Snapshot();
|
||||||
MoveToP(5815, YPos, ZPos);
|
MoveToP(5815, YPos, ZPos);
|
||||||
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
//melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Thread.Sleep(1000);//洗衣机可能过不去
|
//Thread.Sleep(1000);//洗衣机可能过不去
|
||||||
|
|
||||||
//if (xKNow != null)
|
//if (xKNow != null)
|
||||||
//{
|
//{
|
||||||
@ -1555,10 +1556,10 @@ namespace HisenceYoloDetection
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string pathfile = fitImageFolder + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "1.jpg";
|
string pathfile = fitImageFolder + m_sKEYENCEBar + ".jpg";
|
||||||
//CamShow1.ImaMAt = cameraMat;
|
//CamShow1.ImaMAt = cameraMat;
|
||||||
cameraMat.ImWrite(pathfile);
|
cameraMat.ImWrite(pathfile);
|
||||||
CheckDiffSciHelper1.ResizeImage(pathfile,pathfile,640,480,75);
|
CheckDiffSciHelper1.ResizeImage(pathfile, pathfile, 640, 480, 75);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -1567,7 +1568,7 @@ namespace HisenceYoloDetection
|
|||||||
/// <param name="dt"></param>
|
/// <param name="dt"></param>
|
||||||
/// <param name="cameraMat"></param>
|
/// <param name="cameraMat"></param>
|
||||||
/// <param name="SnapshotCount"></param>
|
/// <param name="SnapshotCount"></param>
|
||||||
|
|
||||||
public volatile int AllDsums = 0;
|
public volatile int AllDsums = 0;
|
||||||
public volatile int NGDsums = 0;
|
public volatile int NGDsums = 0;
|
||||||
public volatile int OKDsums = 0;
|
public volatile int OKDsums = 0;
|
||||||
@ -1626,14 +1627,14 @@ namespace HisenceYoloDetection
|
|||||||
myLog("插入模板成功!", DateTime.Now);
|
myLog("插入模板成功!", DateTime.Now);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
bool MatchStr=false;
|
bool MatchStr = false;
|
||||||
if (xKNow != null)
|
if (xKNow != null)
|
||||||
{
|
{
|
||||||
string IOcrBAr = xKNow.OcrBar;
|
string IOcrBAr = xKNow.OcrBar;
|
||||||
@ -1699,7 +1700,7 @@ namespace HisenceYoloDetection
|
|||||||
|
|
||||||
if (mL.ResultMap != null)
|
if (mL.ResultMap != null)
|
||||||
{
|
{
|
||||||
mL.ResultMap.Save("D://cam1//" + dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString() + "1result.jpg");
|
mL.ResultMap.Save("D://cam1//" + m_sKEYENCEBar + "result.jpg");
|
||||||
ResultMatShow.Image = mL.ResultMap;
|
ResultMatShow.Image = mL.ResultMap;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1733,7 +1734,7 @@ namespace HisenceYoloDetection
|
|||||||
string detstr = string.Join(",", RealCFLabels); //输出为abc-def-ghi 如果不加-,也可以省
|
string detstr = string.Join(",", RealCFLabels); //输出为abc-def-ghi 如果不加-,也可以省
|
||||||
//排序比对块
|
//排序比对块
|
||||||
|
|
||||||
MatchStr = listLabels.SequenceEqual(RealCFLabels);
|
MatchStr = listLabels.SequenceEqual(RealCFLabels);
|
||||||
if (MatchStr == false)
|
if (MatchStr == false)
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -1778,9 +1779,10 @@ namespace HisenceYoloDetection
|
|||||||
//bool MatchStr = ManagerModelHelper.IsMatchSQLText(ref mCut, ref xK_HisenceSQLWord, ref xK_MatchDet);
|
//bool MatchStr = ManagerModelHelper.IsMatchSQLText(ref mCut, ref xK_HisenceSQLWord, ref xK_MatchDet);
|
||||||
|
|
||||||
|
|
||||||
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
|
||||||
if (MatchStr)
|
if (MatchStr)
|
||||||
{
|
{
|
||||||
|
|
||||||
OKDsums++;
|
OKDsums++;
|
||||||
myLog("匹配成功", DateTime.Now);
|
myLog("匹配成功", DateTime.Now);
|
||||||
//界面显示
|
//界面显示
|
||||||
@ -1789,7 +1791,7 @@ namespace HisenceYoloDetection
|
|||||||
{
|
{
|
||||||
OKOrNGShow.Image = OKbitmap;
|
OKOrNGShow.Image = OKbitmap;
|
||||||
}));
|
}));
|
||||||
|
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1810,7 +1812,7 @@ namespace HisenceYoloDetection
|
|||||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||||
|
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||||
OKDsums++;
|
OKDsums++;
|
||||||
WUsums++;
|
WUsums++;
|
||||||
this.Invoke(new Action(() =>
|
this.Invoke(new Action(() =>
|
||||||
@ -1829,7 +1831,7 @@ namespace HisenceYoloDetection
|
|||||||
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
melsecPLCTCPDriver.WriteInt(WaringAdress, 0);//报警
|
||||||
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
melsecPLCTCPDriver.WriteInt(RedLightingAdress, 0);//红灯
|
||||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 1);//绿灯
|
||||||
|
melsecPLCTCPDriver.WriteInt("550", 0);//方行
|
||||||
|
|
||||||
this.Invoke(new Action(() =>
|
this.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
@ -2597,7 +2599,7 @@ namespace HisenceYoloDetection
|
|||||||
|
|
||||||
|
|
||||||
string detstr = "";
|
string detstr = "";
|
||||||
if (keyValueResult.Count<=1)
|
if (keyValueResult.Count <= 1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3344,7 +3346,7 @@ namespace HisenceYoloDetection
|
|||||||
string TextWoidStr = OcrFuzzyTextInsert.Join("##"); //实际的检测字
|
string TextWoidStr = OcrFuzzyTextInsert.Join("##"); //实际的检测字
|
||||||
string SQLStr = "";//日志显示数据库的关键字
|
string SQLStr = "";//日志显示数据库的关键字
|
||||||
bool juanjiMatch = false;
|
bool juanjiMatch = false;
|
||||||
string filenameone = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString();
|
string filenameone = m_sKEYENCEBar;
|
||||||
switch (blockIndex)
|
switch (blockIndex)
|
||||||
{
|
{
|
||||||
case "1"://完全匹配 重量信息
|
case "1"://完全匹配 重量信息
|
||||||
@ -3401,8 +3403,8 @@ namespace HisenceYoloDetection
|
|||||||
Rect rectsql = CheckDiffSciHelper.strChangeRect(SQlxK_HisenceWord.TwoRect);
|
Rect rectsql = CheckDiffSciHelper.strChangeRect(SQlxK_HisenceWord.TwoRect);
|
||||||
Rect rectDet = CheckDiffSciHelper.strChangeRect(xK_HisenceWord.TwoRect);
|
Rect rectDet = CheckDiffSciHelper.strChangeRect(xK_HisenceWord.TwoRect);
|
||||||
bool iswhite = IsMostlyWhite(PathSql);//判断数据库模板块背景色
|
bool iswhite = IsMostlyWhite(PathSql);//判断数据库模板块背景色
|
||||||
|
|
||||||
Mat SqlImg= Cv2.ImRead(PathSql);
|
Mat SqlImg = Cv2.ImRead(PathSql);
|
||||||
Mat SqlBtn = GetCroppedImage(SqlImg, rectsql);
|
Mat SqlBtn = GetCroppedImage(SqlImg, rectsql);
|
||||||
Mat BtnImg = GetCroppedImage(CutBlockMat, rectDet);//截取实时图像旋钮图片
|
Mat BtnImg = GetCroppedImage(CutBlockMat, rectDet);//截取实时图像旋钮图片
|
||||||
Bitmap bitmap = MatToBitmap(BtnImg);
|
Bitmap bitmap = MatToBitmap(BtnImg);
|
||||||
@ -3416,7 +3418,7 @@ namespace HisenceYoloDetection
|
|||||||
|
|
||||||
}));
|
}));
|
||||||
Mat matresult = CutBlockMat.Clone();
|
Mat matresult = CutBlockMat.Clone();
|
||||||
juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat,ref matresult, rectsql, rectDet, iswhite, "D://Hisence//Test");
|
juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat, ref matresult, rectsql, rectDet, iswhite, "D://Hisence//Test", m_sKEYENCEBar);
|
||||||
// juanjiMatch = true;
|
// juanjiMatch = true;
|
||||||
|
|
||||||
if (!OneIF1 || !juanjiMatch)
|
if (!OneIF1 || !juanjiMatch)
|
||||||
@ -3448,7 +3450,7 @@ namespace HisenceYoloDetection
|
|||||||
Rect rect = new Rect(0, 0, 0, 0);
|
Rect rect = new Rect(0, 0, 0, 0);
|
||||||
string PathSql = SQlxK_HisenceWord.ThreeblockPath;
|
string PathSql = SQlxK_HisenceWord.ThreeblockPath;
|
||||||
bool iswhite = IsMostlyWhite(PathSql);
|
bool iswhite = IsMostlyWhite(PathSql);
|
||||||
juanjiMatch = CheckDiffSciHelper1.CheckDiffSci(PathSql, CutBlockMat, rect, rect, iswhite, "D://Hisence//Test1");
|
juanjiMatch = CheckDiffSciHelper1.CheckDiffSci(PathSql, CutBlockMat, rect, rect, iswhite, "D://Hisence//Test1", m_sKEYENCEBar);
|
||||||
if (!OneIF1 || !juanjiMatch)
|
if (!OneIF1 || !juanjiMatch)
|
||||||
{
|
{
|
||||||
OneIF = true;//待修改6.28
|
OneIF = true;//待修改6.28
|
||||||
@ -3807,6 +3809,7 @@ namespace HisenceYoloDetection
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
||||||
melsecPLCTCPDriver.WriteInt("550", 0);
|
melsecPLCTCPDriver.WriteInt("550", 0);
|
||||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
|
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
|
||||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
|
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
|
||||||
@ -3839,10 +3842,24 @@ namespace HisenceYoloDetection
|
|||||||
|
|
||||||
private void CloseDecBtn_Click(object sender, EventArgs e)
|
private void CloseDecBtn_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
meachineState = MeachineState.machine_closing;
|
using (var passwordForm = new Form2())
|
||||||
melsecPLCTCPDriver.WriteInt("550", 0);
|
{
|
||||||
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
|
if (passwordForm.ShowDialog() == DialogResult.OK)
|
||||||
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
|
{
|
||||||
|
if (passwordForm.EnteredPassword == CorrectPassword)
|
||||||
|
{
|
||||||
|
// 密码正确,执行相关操作
|
||||||
|
meachineState = MeachineState.machine_closing;
|
||||||
|
melsecPLCTCPDriver.WriteInt("550", 0);
|
||||||
|
melsecPLCTCPDriver.WriteInt(YellowLightingAdress, 0);
|
||||||
|
melsecPLCTCPDriver.WriteInt(GreenLightingAdress, 0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("密码错误!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void label24_Click(object sender, EventArgs e)
|
private void label24_Click(object sender, EventArgs e)
|
||||||
@ -3884,5 +3901,71 @@ namespace HisenceYoloDetection
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void button6_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string FolderPath = "D:\\Hisence\\Test\\2\\ng";
|
||||||
|
// 确保文件夹路径存在
|
||||||
|
if (System.IO.Directory.Exists(FolderPath))
|
||||||
|
{
|
||||||
|
// 使用 Process 启动文件资源管理器并打开指定文件夹
|
||||||
|
Process.Start("explorer.exe", FolderPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("指定的文件夹不存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"无法打开文件夹: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button4_Click_2(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string FolderPath = "D:\\Hisence\\cam1";
|
||||||
|
// 确保文件夹路径存在
|
||||||
|
if (System.IO.Directory.Exists(FolderPath))
|
||||||
|
{
|
||||||
|
// 使用 Process 启动文件资源管理器并打开指定文件夹
|
||||||
|
Process.Start("explorer.exe", FolderPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("指定的文件夹不存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"无法打开文件夹: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void button5_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string FolderPath = "D:\\Hisence\\Test\\1\\ng";
|
||||||
|
// 确保文件夹路径存在
|
||||||
|
if (System.IO.Directory.Exists(FolderPath))
|
||||||
|
{
|
||||||
|
// 使用 Process 启动文件资源管理器并打开指定文件夹
|
||||||
|
Process.Start("explorer.exe", FolderPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("指定的文件夹不存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"无法打开文件夹: {ex.Message}", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user