Commit 41cd7bbc authored by 簡碩辰's avatar 簡碩辰

重新上傳

parent e9cd9f92
......@@ -130,9 +130,12 @@ namespace ETC_App1
string k = kcell != null && HasHead ? (kcell.CellType == CellType.Numeric ? kcell.NumericCellValue.ToString() : kcell.StringCellValue) : "C" + m;
string v = vcell != null ? (vcell.CellType == CellType.Numeric ? vcell.NumericCellValue.ToString() : vcell.StringCellValue) : "";
string v = vcell != null ? (vcell.CellType == CellType.Numeric ? vcell.NumericCellValue.ToString() : vcell.CellType == CellType.String ? vcell.StringCellValue : "") : "";
item.Add(k, v);
if (!item.ContainsKey(k))
item.Add(k, v);
else
item[k] = v;
}
value.Add(item);
......
......@@ -12,6 +12,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using DuoVia.FuzzyStrings;
/// <summary>
/// 功能: 建立檢查資料檔與影像的背景程序。
/// 維護:
......@@ -89,6 +90,8 @@ namespace ETC_App1
int start = Convert.ToInt32(e.Argument);
StreamWriter sw = new StreamWriter("output.txt");
for (int i = start; i < data.Count && !CancellationPending; i++)
{
Stopwatch stopwatch = Stopwatch.StartNew();
......@@ -128,6 +131,8 @@ namespace ETC_App1
}
}
if (json.result != null && json.result.Count > 0)
{
json.lost1 = json.lost2 = false;
......@@ -142,8 +147,14 @@ namespace ETC_App1
{
string result = json.result[j].plate[k];
if (json.result[j].plate[k].Length > 0)
if (result.Length > 0)
{
double fuzzy = StringExtensions.FuzzyMatch(result, data[i]["車牌號碼"]);
sw.WriteLine(string.Format("{0}. {1} fuzzy {2} = {3}", i, data[i]["車牌號碼"], result, fuzzy));
sw.Flush();
if (result == plate || plate.Contains(result))
{
// 辨識成功,比對正確
......@@ -157,7 +168,7 @@ namespace ETC_App1
break;
}
else
else if (fuzzy > 0.1)
{
// 辨識成功,比對錯誤
json.message1 = data[i]["車牌號碼"];
......@@ -172,6 +183,16 @@ namespace ETC_App1
//json.message2 = (json.message2 == null ? "資料異常" : json.message2) + "[" + result + "]";
}
else
{
json.success = false;
json.failed = true;
json.tickoff = true;
json.lost1 = false;
json.lost2 = false;
json.message1 = data[i]["車牌號碼"];
json.message2 = "車牌定位無結果";
}
}
else { json.message2 = "車牌辨識無結果"; }
}
......@@ -202,6 +223,8 @@ namespace ETC_App1
stopwatch.Restart();
e.Result = i + 1;
Thread.Sleep(100);
}
foreach (string key in Images.Keys)
......@@ -218,6 +241,7 @@ namespace ETC_App1
}
else { break; }
}
sw.Close();
}
else // 一維條碼模式
{
......
......@@ -47,6 +47,7 @@
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
this.toolStripStatusLabel4 = new System.Windows.Forms.ToolStripStatusLabel();
this.textBox1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
......@@ -127,10 +128,10 @@
this.etcPictureBox1.BackColor = System.Drawing.Color.Transparent;
this.etcPictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.etcPictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.etcPictureBox1.Location = new System.Drawing.Point(8, 24);
this.etcPictureBox1.Location = new System.Drawing.Point(8, 20);
this.etcPictureBox1.Margin = new System.Windows.Forms.Padding(0);
this.etcPictureBox1.Name = "etcPictureBox1";
this.etcPictureBox1.Size = new System.Drawing.Size(736, 395);
this.etcPictureBox1.Size = new System.Drawing.Size(736, 399);
this.etcPictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.etcPictureBox1.TabIndex = 0;
this.etcPictureBox1.TabStop = false;
......@@ -158,11 +159,11 @@
this.listBox2.ForeColor = System.Drawing.SystemColors.ControlText;
this.listBox2.FormattingEnabled = true;
this.listBox2.IntegralHeight = false;
this.listBox2.ItemHeight = 40;
this.listBox2.Location = new System.Drawing.Point(8, 24);
this.listBox2.ItemHeight = 32;
this.listBox2.Location = new System.Drawing.Point(8, 20);
this.listBox2.Margin = new System.Windows.Forms.Padding(0);
this.listBox2.Name = "listBox2";
this.listBox2.Size = new System.Drawing.Size(740, 111);
this.listBox2.Size = new System.Drawing.Size(740, 115);
this.listBox2.TabIndex = 0;
this.listBox2.SelectedIndexChanged += new System.EventHandler(this.ListBox2_SelectedIndexChanged);
//
......@@ -189,6 +190,7 @@
// groupBox2
//
this.groupBox2.Controls.Add(this.listBox1);
this.groupBox2.Controls.Add(this.textBox1);
this.groupBox2.Controls.Add(this.button1);
this.groupBox2.Controls.Add(this.button2);
this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
......@@ -213,10 +215,10 @@
this.listBox1.FormattingEnabled = true;
this.listBox1.IntegralHeight = false;
this.listBox1.ItemHeight = 48;
this.listBox1.Location = new System.Drawing.Point(8, 24);
this.listBox1.Location = new System.Drawing.Point(8, 20);
this.listBox1.Margin = new System.Windows.Forms.Padding(0);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(238, 315);
this.listBox1.Size = new System.Drawing.Size(238, 286);
this.listBox1.TabIndex = 0;
this.listBox1.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.ListBox1_DrawItem);
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.ListBox1_SelectedIndexChanged);
......@@ -268,10 +270,10 @@
this.etcPictureBox2.BackColor = System.Drawing.Color.Transparent;
this.etcPictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.etcPictureBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.etcPictureBox2.Location = new System.Drawing.Point(8, 24);
this.etcPictureBox2.Location = new System.Drawing.Point(8, 20);
this.etcPictureBox2.Margin = new System.Windows.Forms.Padding(0);
this.etcPictureBox2.Name = "etcPictureBox2";
this.etcPictureBox2.Size = new System.Drawing.Size(238, 111);
this.etcPictureBox2.Size = new System.Drawing.Size(238, 115);
this.etcPictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.etcPictureBox2.TabIndex = 0;
this.etcPictureBox2.TabStop = false;
......@@ -307,7 +309,7 @@
this.toolStripStatusLabel1.Font = new System.Drawing.Font("標楷體", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.toolStripStatusLabel1.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(219, 20);
this.toolStripStatusLabel1.Size = new System.Drawing.Size(176, 20);
this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
this.toolStripStatusLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
......@@ -316,7 +318,7 @@
this.toolStripStatusLabel2.Font = new System.Drawing.Font("標楷體", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.toolStripStatusLabel2.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
this.toolStripStatusLabel2.Size = new System.Drawing.Size(219, 20);
this.toolStripStatusLabel2.Size = new System.Drawing.Size(176, 20);
this.toolStripStatusLabel2.Text = "toolStripStatusLabel2";
this.toolStripStatusLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
......@@ -325,7 +327,7 @@
this.toolStripStatusLabel3.Font = new System.Drawing.Font("標楷體", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.toolStripStatusLabel3.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
this.toolStripStatusLabel3.Size = new System.Drawing.Size(219, 20);
this.toolStripStatusLabel3.Size = new System.Drawing.Size(176, 20);
this.toolStripStatusLabel3.Text = "toolStripStatusLabel3";
this.toolStripStatusLabel3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
......@@ -334,13 +336,25 @@
this.toolStripStatusLabel4.Font = new System.Drawing.Font("標楷體", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.toolStripStatusLabel4.Margin = new System.Windows.Forms.Padding(0, 3, 0, 3);
this.toolStripStatusLabel4.Name = "toolStripStatusLabel4";
this.toolStripStatusLabel4.Size = new System.Drawing.Size(219, 20);
this.toolStripStatusLabel4.Size = new System.Drawing.Size(176, 20);
this.toolStripStatusLabel4.Text = "toolStripStatusLabel4";
this.toolStripStatusLabel4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// textBox1
//
this.textBox1.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.textBox1.Font = new System.Drawing.Font("標楷體", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(136)));
this.textBox1.Location = new System.Drawing.Point(8, 306);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(238, 33);
this.textBox1.TabIndex = 3;
this.textBox1.TextChanged += new System.EventHandler(this.TextBox1_TextChanged);
//
// ETCPictureCheckBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(11F, 23F);
this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 19F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.Controls.Add(this.splitContainer1);
......@@ -397,5 +411,6 @@
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel4;
private System.Windows.Forms.TextBox textBox1;
}
}
......@@ -164,6 +164,8 @@ namespace ETC_App1
{
Json json = Data[listBox1.SelectedIndex];
textBox1.Text = json.message1;
if ((json.success || json.failed || json.lost2) && json.content && File.Exists(json.filename))
{
MemoryStream memory = new MemoryStream();
......@@ -226,7 +228,7 @@ namespace ETC_App1
button1.ForeColor = json.success ? Color.Green : button1.ForeColor;
button1.Text = json.failed ? "第 " + json.index + " 筆資料異常!" : button1.Text;
button1.Text = json.failed ? "第 " + json.index + " 筆資料檢查異常!" : button1.Text;
button1.ForeColor = json.failed ? WarningColor : button1.ForeColor;
......@@ -395,5 +397,10 @@ namespace ETC_App1
file2003.Close();
workbook2003.Close();
}
private void TextBox1_TextChanged(object sender, EventArgs e)
{
Data[SelectedIndex].message1 = textBox1.Text;
}
}
}
......@@ -59,6 +59,9 @@
<Reference Include="Aspose.BarCode, Version=19.4.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56, processorArchitecture=MSIL">
<HintPath>..\packages\Aspose.BarCode.19.4.0\lib\net45\Aspose.BarCode.dll</HintPath>
</Reference>
<Reference Include="DuoVia.FuzzyStrings, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DuoVia.FuzzyStrings.2.0.1\lib\net462\DuoVia.FuzzyStrings.dll</HintPath>
</Reference>
<Reference Include="Emgu.CV.UI, Version=4.0.1.3373, Culture=neutral, PublicKeyToken=7281126722ab4438, processorArchitecture=MSIL">
<HintPath>..\packages\EMGU.CV.4.0.1.3373\lib\net35\Emgu.CV.UI.dll</HintPath>
</Reference>
......
This diff is collapsed.
This diff is collapsed.
de48493c4e47c17f1d3fb9ea7de587584520d94e
e0043c7e390cd0b592b3be354e86de0f9dd09bd3
......@@ -299,3 +299,65 @@ D:\e-eye\ETC_App1\obj\Debug\ETC_App1.csproj.CoreCompileInputs.cache
D:\e-eye\ETC_App1\obj\Debug\ETC_App1.csproj.CopyComplete
D:\e-eye\ETC_App1\obj\Debug\ETC_App1.exe
D:\e-eye\ETC_App1\obj\Debug\ETC_App1.pdb
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x64\concrt140.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x64\cvextern.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x64\msvcp140.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x64\opencv_ffmpeg401_64.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x64\vcruntime140.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x86\concrt140.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x86\cvextern.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x86\msvcp140.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x86\opencv_ffmpeg401.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\x86\vcruntime140.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ETC_App1.exe.config
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ETC_App1.exe
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ETC_App1.pdb
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Aspose.BarCode.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\DuoVia.FuzzyStrings.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Emgu.CV.UI.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Emgu.CV.World.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ICSharpCode.SharpZipLib.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\MySql.Data.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Newtonsoft.Json.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\NPOI.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\NPOI.OOXML.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\NPOI.OpenXml4Net.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\NPOI.OpenXmlFormats.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\RestSharp.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ZedGraph.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Aspose.BarCode.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Emgu.CV.UI.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Emgu.CV.World.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ICSharpCode.SharpZipLib.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\MySql.Data.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\Newtonsoft.Json.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\RestSharp.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ZedGraph.xml
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\de\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\es\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\fr\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\hu\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\it\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ja\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\pt\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\ru\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\sk\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\sv\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\tr\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\zh-cn\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\bin\Debug\zh-tw\ZedGraph.resources.dll
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.csprojAssemblyReference.cache
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.ETCBackgroundWorker1.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.ETCBackgroundWorker2.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.ETCBackgroundWorker3.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.ETCPictureBox.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.ETCPictureCheckBox.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.ETCStatusStrip.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.ETCToolStrip.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.Form1.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.Properties.Resources.resources
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.csproj.GenerateResource.cache
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.csproj.CoreCompileInputs.cache
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.csproj.CopyComplete
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.exe
C:\Users\ECOM\source\repos\e-eye\ETC_App1\obj\Debug\ETC_App1.pdb
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Aspose.BarCode" version="19.4.0" targetFramework="net472" />
<package id="DuoVia.FuzzyStrings" version="2.0.1" targetFramework="net472" />
<package id="EMGU.CV" version="4.0.1.3373" targetFramework="net472" />
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net472" />
<package id="NPOI" version="2.4.1" targetFramework="net472" />
......
68b17283f877db405cc276ee20cdb836bc8420b7
217508568aff3bd7bdefc962f8a7d71120078a49
26237647b74ccd9c962a1be50bd84e9a9d74becf
387b73e12b51b39f51b5998ffccff5d1c53fc88d
aa4c1c0c43c2733a95130f18a90549e96879dddb
96977e901f77dff536ebcf202b9b1a482a81f5e1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment