From 2db802c89936cb1cad2d88fda1fe4e604b114331 Mon Sep 17 00:00:00 2001 From: "xhm\\HP" <1173131411@qq.com> Date: Thu, 27 Jun 2024 16:25:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2=20?= =?UTF-8?q?=E5=92=8C=E9=81=AE=E6=8C=A1=E7=AC=AC=E4=B8=80=E5=9D=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BANG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HisenceYoloDetection/MainForm.Designer.cs | 149 +++++++++++++--------- HisenceYoloDetection/MainForm.cs | 111 +++++++++------- 2 files changed, 148 insertions(+), 112 deletions(-) diff --git a/HisenceYoloDetection/MainForm.Designer.cs b/HisenceYoloDetection/MainForm.Designer.cs index c244e44..fe114a9 100644 --- a/HisenceYoloDetection/MainForm.Designer.cs +++ b/HisenceYoloDetection/MainForm.Designer.cs @@ -31,11 +31,13 @@ components = new System.ComponentModel.Container(); OpenCvSharp.Mat mat1 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat2 = new OpenCvSharp.Mat(); - OpenCvSharp.Mat mat3 = new OpenCvSharp.Mat(); - OpenCvSharp.Mat mat4 = new OpenCvSharp.Mat(); - OpenCvSharp.Mat mat5 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat6 = new OpenCvSharp.Mat(); OpenCvSharp.Mat mat7 = new OpenCvSharp.Mat(); + OpenCvSharp.Mat mat8 = new OpenCvSharp.Mat(); + OpenCvSharp.Mat mat5 = new OpenCvSharp.Mat(); + OpenCvSharp.Mat mat9 = new OpenCvSharp.Mat(); + OpenCvSharp.Mat mat4 = new OpenCvSharp.Mat(); + OpenCvSharp.Mat mat3 = new OpenCvSharp.Mat(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); tabPage2 = new TabPage(); panel1 = new Panel(); @@ -128,7 +130,6 @@ panel5 = new Panel(); DefetShow5 = new XKRS.UI.Canvas(); panel8 = new Panel(); - RefeshData = new Button(); 实时显示 = new Label(); OKOrNGShow = new PictureBox(); OKDNum = new TextBox(); @@ -137,7 +138,6 @@ label19 = new Label(); AllDSum = new TextBox(); label18 = new Label(); - InsertSqlBtn = new Button(); StartDecBtn = new Button(); ScanDevList = new Button(); DevNameCombo = new ComboBox(); @@ -198,6 +198,8 @@ richTextBox1 = new RichTextBox(); contextMenuStrip1 = new ContextMenuStrip(components); backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); + DefetShow6 = new XKRS.UI.Canvas(); + DefetShow7 = new XKRS.UI.Canvas(); tabPage2.SuspendLayout(); panel1.SuspendLayout(); groupBox5.SuspendLayout(); @@ -1129,8 +1131,10 @@ // // panel5 // - panel5.Controls.Add(DefetShow5); + panel5.Controls.Add(DefetShow7); + panel5.Controls.Add(DefetShow6); panel5.Controls.Add(panel8); + panel5.Controls.Add(DefetShow2); panel5.Controls.Add(panel6); panel5.Dock = DockStyle.Top; panel5.Location = new Point(0, 0); @@ -1143,15 +1147,15 @@ DefetShow5.AllowSelectDefect = true; DefetShow5.BrushColor = null; DefetShow5.ImagePath = ""; - mat3.IsEnabledDispose = true; - DefetShow5.ImaMAt = mat3; + mat6.IsEnabledDispose = true; + DefetShow5.ImaMAt = mat6; DefetShow5.ImgData = null; - DefetShow5.Location = new Point(853, 464); + DefetShow5.Location = new Point(537, 460); DefetShow5.MoveStep = 5F; DefetShow5.Name = "DefetShow5"; DefetShow5.Route = 0D; DefetShow5.Scale = 1D; - DefetShow5.Size = new Size(254, 196); + DefetShow5.Size = new Size(209, 196); DefetShow5.TabIndex = 10; DefetShow5.WholeScale = 0F; DefetShow5.XMove = 0F; @@ -1161,7 +1165,6 @@ // // panel8 // - panel8.Controls.Add(RefeshData); panel8.Controls.Add(实时显示); panel8.Controls.Add(OKOrNGShow); panel8.Controls.Add(OKDNum); @@ -1170,31 +1173,20 @@ panel8.Controls.Add(label19); panel8.Controls.Add(AllDSum); panel8.Controls.Add(label18); - panel8.Controls.Add(InsertSqlBtn); panel8.Controls.Add(StartDecBtn); panel8.Controls.Add(ScanDevList); panel8.Controls.Add(DevNameCombo); panel8.Controls.Add(InitMachine); panel8.Location = new Point(853, 0); panel8.Name = "panel8"; - panel8.Size = new Size(440, 458); + panel8.Size = new Size(440, 244); panel8.TabIndex = 2; panel8.Paint += panel8_Paint; // - // RefeshData - // - RefeshData.Location = new Point(24, 340); - RefeshData.Name = "RefeshData"; - RefeshData.Size = new Size(94, 43); - RefeshData.TabIndex = 13; - RefeshData.Text = "刷新"; - RefeshData.UseVisualStyleBackColor = true; - RefeshData.Click += RefeshData_Click; - // // 实时显示 // 实时显示.AutoSize = true; - 实时显示.Location = new Point(326, 175); + 实时显示.Location = new Point(332, 26); 实时显示.Name = "实时显示"; 实时显示.Size = new Size(56, 17); 实时显示.TabIndex = 12; @@ -1202,7 +1194,7 @@ // // OKOrNGShow // - OKOrNGShow.Location = new Point(254, 204); + OKOrNGShow.Location = new Point(254, 60); OKOrNGShow.Name = "OKOrNGShow"; OKOrNGShow.Size = new Size(183, 179); OKOrNGShow.SizeMode = PictureBoxSizeMode.CenterImage; @@ -1211,7 +1203,7 @@ // // OKDNum // - OKDNum.Location = new Point(125, 296); + OKDNum.Location = new Point(132, 207); OKDNum.Name = "OKDNum"; OKDNum.ReadOnly = true; OKDNum.Size = new Size(100, 23); @@ -1220,7 +1212,7 @@ // label20 // label20.AutoSize = true; - label20.Location = new Point(49, 300); + label20.Location = new Point(56, 211); label20.Name = "label20"; label20.Size = new Size(50, 17); label20.TabIndex = 9; @@ -1228,7 +1220,7 @@ // // NGDNum // - NGDNum.Location = new Point(125, 249); + NGDNum.Location = new Point(132, 160); NGDNum.Name = "NGDNum"; NGDNum.ReadOnly = true; NGDNum.Size = new Size(100, 23); @@ -1237,7 +1229,7 @@ // label19 // label19.AutoSize = true; - label19.Location = new Point(49, 253); + label19.Location = new Point(56, 164); label19.Name = "label19"; label19.Size = new Size(51, 17); label19.TabIndex = 7; @@ -1245,7 +1237,7 @@ // // AllDSum // - AllDSum.Location = new Point(125, 204); + AllDSum.Location = new Point(132, 115); AllDSum.Name = "AllDSum"; AllDSum.ReadOnly = true; AllDSum.Size = new Size(100, 23); @@ -1254,26 +1246,15 @@ // label18 // label18.AutoSize = true; - label18.Location = new Point(49, 208); + label18.Location = new Point(56, 119); label18.Name = "label18"; label18.Size = new Size(44, 17); label18.TabIndex = 5; label18.Text = "总个数"; // - // InsertSqlBtn - // - InsertSqlBtn.Location = new Point(54, 56); - InsertSqlBtn.Name = "InsertSqlBtn"; - InsertSqlBtn.Size = new Size(92, 48); - InsertSqlBtn.TabIndex = 4; - InsertSqlBtn.Text = "型号录入"; - InsertSqlBtn.UseVisualStyleBackColor = true; - InsertSqlBtn.Visible = false; - InsertSqlBtn.Click += InsertSqlBtn_Click; - // // StartDecBtn // - StartDecBtn.Location = new Point(160, 127); + StartDecBtn.Location = new Point(131, 60); StartDecBtn.Name = "StartDecBtn"; StartDecBtn.Size = new Size(94, 43); StartDecBtn.TabIndex = 3; @@ -1283,7 +1264,7 @@ // // ScanDevList // - ScanDevList.Location = new Point(272, 25); + ScanDevList.Location = new Point(231, 23); ScanDevList.Name = "ScanDevList"; ScanDevList.Size = new Size(75, 23); ScanDevList.TabIndex = 2; @@ -1294,14 +1275,14 @@ // DevNameCombo // DevNameCombo.FormattingEnabled = true; - DevNameCombo.Location = new Point(54, 25); + DevNameCombo.Location = new Point(25, 23); DevNameCombo.Name = "DevNameCombo"; DevNameCombo.Size = new Size(200, 25); DevNameCombo.TabIndex = 1; // // InitMachine // - InitMachine.Location = new Point(54, 127); + InitMachine.Location = new Point(24, 60); InitMachine.Name = "InitMachine"; InitMachine.Size = new Size(94, 43); InitMachine.TabIndex = 0; @@ -1320,9 +1301,9 @@ // groupBox2 // groupBox2.AutoSize = true; + groupBox2.Controls.Add(DefetShow5); groupBox2.Controls.Add(DefetShow4); groupBox2.Controls.Add(DefetShow3); - groupBox2.Controls.Add(DefetShow2); groupBox2.Controls.Add(originMat2Show); groupBox2.Controls.Add(DefetShow1); groupBox2.Controls.Add(ResultMatShow2); @@ -1342,15 +1323,15 @@ DefetShow4.AllowSelectDefect = true; DefetShow4.BrushColor = null; DefetShow4.ImagePath = ""; - mat4.IsEnabledDispose = true; - DefetShow4.ImaMAt = mat4; + mat7.IsEnabledDispose = true; + DefetShow4.ImaMAt = mat7; DefetShow4.ImgData = null; - DefetShow4.Location = new Point(574, 460); + DefetShow4.Location = new Point(297, 460); DefetShow4.MoveStep = 5F; DefetShow4.Name = "DefetShow4"; DefetShow4.Route = 0D; DefetShow4.Scale = 1D; - DefetShow4.Size = new Size(265, 196); + DefetShow4.Size = new Size(220, 196); DefetShow4.TabIndex = 11; DefetShow4.WholeScale = 0F; DefetShow4.XMove = 0F; @@ -1363,15 +1344,15 @@ DefetShow3.AllowSelectDefect = true; DefetShow3.BrushColor = null; DefetShow3.ImagePath = ""; - mat5.IsEnabledDispose = true; - DefetShow3.ImaMAt = mat5; + mat8.IsEnabledDispose = true; + DefetShow3.ImaMAt = mat8; DefetShow3.ImgData = null; - DefetShow3.Location = new Point(303, 460); + DefetShow3.Location = new Point(6, 460); DefetShow3.MoveStep = 5F; DefetShow3.Name = "DefetShow3"; DefetShow3.Route = 0D; DefetShow3.Scale = 1D; - DefetShow3.Size = new Size(265, 196); + DefetShow3.Size = new Size(285, 196); DefetShow3.TabIndex = 10; DefetShow3.WholeScale = 0F; DefetShow3.XMove = 0F; @@ -1384,10 +1365,10 @@ DefetShow2.AllowSelectDefect = true; DefetShow2.BrushColor = null; DefetShow2.ImagePath = ""; - mat6.IsEnabledDispose = true; - DefetShow2.ImaMAt = mat6; + mat5.IsEnabledDispose = true; + DefetShow2.ImaMAt = mat5; DefetShow2.ImgData = null; - DefetShow2.Location = new Point(6, 460); + DefetShow2.Location = new Point(850, 249); DefetShow2.MoveStep = 5F; DefetShow2.Name = "DefetShow2"; DefetShow2.Route = 0D; @@ -1414,15 +1395,15 @@ DefetShow1.AllowSelectDefect = true; DefetShow1.BrushColor = null; DefetShow1.ImagePath = ""; - mat7.IsEnabledDispose = true; - DefetShow1.ImaMAt = mat7; + mat9.IsEnabledDispose = true; + DefetShow1.ImaMAt = mat9; DefetShow1.ImgData = null; DefetShow1.Location = new Point(574, 245); DefetShow1.MoveStep = 5F; DefetShow1.Name = "DefetShow1"; DefetShow1.Route = 0D; DefetShow1.Scale = 1D; - DefetShow1.Size = new Size(262, 209); + DefetShow1.Size = new Size(254, 209); DefetShow1.TabIndex = 7; DefetShow1.WholeScale = 0F; DefetShow1.XMove = 0F; @@ -1836,6 +1817,48 @@ contextMenuStrip1.Name = "contextMenuStrip1"; contextMenuStrip1.Size = new Size(61, 4); // + // DefetShow6 + // + DefetShow6.AllowSelectDefect = true; + DefetShow6.BrushColor = null; + DefetShow6.ImagePath = ""; + mat4.IsEnabledDispose = true; + DefetShow6.ImaMAt = mat4; + DefetShow6.ImgData = null; + DefetShow6.Location = new Point(751, 464); + DefetShow6.MoveStep = 5F; + DefetShow6.Name = "DefetShow6"; + DefetShow6.Route = 0D; + DefetShow6.Scale = 1D; + DefetShow6.Size = new Size(209, 196); + DefetShow6.TabIndex = 11; + DefetShow6.WholeScale = 0F; + DefetShow6.XMove = 0F; + DefetShow6.XScale = 0F; + DefetShow6.YMove = 0F; + DefetShow6.YScale = 0F; + // + // DefetShow7 + // + DefetShow7.AllowSelectDefect = true; + DefetShow7.BrushColor = null; + DefetShow7.ImagePath = ""; + mat3.IsEnabledDispose = true; + DefetShow7.ImaMAt = mat3; + DefetShow7.ImgData = null; + DefetShow7.Location = new Point(1021, 464); + DefetShow7.MoveStep = 5F; + DefetShow7.Name = "DefetShow7"; + DefetShow7.Route = 0D; + DefetShow7.Scale = 1D; + DefetShow7.Size = new Size(209, 196); + DefetShow7.TabIndex = 12; + DefetShow7.WholeScale = 0F; + DefetShow7.XMove = 0F; + DefetShow7.XScale = 0F; + DefetShow7.YMove = 0F; + DefetShow7.YScale = 0F; + // // MainForm // AutoScaleDimensions = new SizeF(7F, 17F); @@ -1957,7 +1980,6 @@ private Label label15; private Button StartDecBtn; private ContextMenuStrip contextMenuStrip1; - private Button InsertSqlBtn; private PictureBox ResultMatShow2; private PictureBox originMatShow2; private TextBox OKDNum; @@ -1968,7 +1990,6 @@ private Label label18; private Label 实时显示; private PictureBox OKOrNGShow; - private Button RefeshData; private GroupBox groupBox3; private Button SnapshotCam2; private Button button3; @@ -2046,5 +2067,7 @@ private XKRS.UI.Canvas DefetShow3; private XKRS.UI.Canvas DefetShow2; private PictureBox originMat2Show; + private XKRS.UI.Canvas DefetShow7; + private XKRS.UI.Canvas DefetShow6; } } diff --git a/HisenceYoloDetection/MainForm.cs b/HisenceYoloDetection/MainForm.cs index 29f18a3..da57d3e 100644 --- a/HisenceYoloDetection/MainForm.cs +++ b/HisenceYoloDetection/MainForm.cs @@ -5,6 +5,7 @@ using OpenCvSharp; using OpenCvSharp.Dnn; using OpenCvSharp.Extensions; using OpenCvSharp.XFeatures2D; +using Sunny.UI; using System; using System.ComponentModel; using System.Data; @@ -549,6 +550,7 @@ namespace HisenceYoloDetection Bitmap NGbitmap = new Bitmap("NG.jpg"); Mat OKMat = Cv2.ImRead("OK.jpg"); Mat NGMat = Cv2.ImRead("OK.jpg"); + Mat whiteMat = Cv2.ImRead("white.jpg"); /// /// ̵߳ /// @@ -1168,7 +1170,7 @@ namespace HisenceYoloDetection // Thread.Sleep(500); Cam1.SnapshotCount = 0; Cam1.Snapshot(); - + // Cam2.SnapshotCount = 0; //Cam2.Snapshot(); IfCam2Triger = true; @@ -1179,7 +1181,7 @@ namespace HisenceYoloDetection //} //currentXP = 54964; Thread.Sleep(2000);//ɾ - + //MoveToP(51043, YPos, ZPos + (int)(dismove)); Cam1.Snapshot(); //MoveToP(5815, YPos, ZPos); @@ -1257,8 +1259,8 @@ namespace HisenceYoloDetection { - // Cam1ImgOne = Cv2.ImRead("D:\\Hisence\\\\1\\202461817464661.jpg"); ; - Cam1ImgOne = cameraMat; + //Cam1ImgOne = Cv2.ImRead("D:\\Hisence\\\\1\\001.jpg"); ; + Cam1ImgOne = cameraMat; IfCam1OneTriger = true; originMatShow.Image = cameraMat.ToBitmap(); //pictureBox1.Image = cameraMat.ToBitmap(); @@ -1268,9 +1270,9 @@ namespace HisenceYoloDetection //ڶ if (SnapshotCount == 2) { - //Mat mat = Cv2.ImRead("D:\\Hisence\\\\1\\002.jpg"); - //Cam1ImgTwo = mat; - Cam1ImgTwo = cameraMat; + // Mat mat = Cv2.ImRead("D:\\Hisence\\\\1\\002.jpg"); + // Cam1ImgTwo = mat; + Cam1ImgTwo = cameraMat; IfCam1TwoTriger = true; originMatShow2.Image = cameraMat.ToBitmap(); @@ -1314,7 +1316,7 @@ namespace HisenceYoloDetection /// public void ReadyDetect() { - Task.Run((Action)(() => + _ = Task.Run((Action)(() => { Thread.CurrentThread.Priority = ThreadPriority.Highest; while (true) @@ -1340,7 +1342,7 @@ namespace HisenceYoloDetection sw.WriteLine(IOcrBAr + "\n"); sw.Flush(); } - IOcrBAr = "BatchW96c0ModelWNHB6X2SDSP"; + IOcrBAr = "W821PWMS27106WD2"; //ݿȶ xKNow = GetModeFromBar(IOcrBAr);//ݿвѯֵ List xkWordList = ManagerModelHelper.GetModeWordFromBar(IOcrBAr); @@ -1381,12 +1383,22 @@ namespace HisenceYoloDetection //ݿƥſԽģƶ //ͺźϴεͺһ Ͳûʶģll - + } //1ڶ if (IfCam1TwoTriger && bBarTriger) { + //ʼ + Defet_OnDetectionDone(whiteMat, 1); + Defet_OnDetectionDone(whiteMat, 2); + Defet_OnDetectionDone(whiteMat, 3); + Defet_OnDetectionDone(whiteMat, 4); + Defet_OnDetectionDone(whiteMat, 5); + Defet_OnDetectionDone(whiteMat, 6); + Defet_OnDetectionDone(whiteMat, 7); + + XK_HisenceWord xK_MatchDet = new XK_HisenceWord(); xK_MatchDet.TwoIFWhile = xK_HisenceSQLWord.TwoIFWhile; AllDsums++; @@ -1466,29 +1478,27 @@ namespace HisenceYoloDetection detstr += RealLabels[i]; } + } + //ȶԿ + HashSet set1 = new HashSet(listLabels); + HashSet set2 = new HashSet(RealLabels); + bool MatchStr = set1.SetEquals(set2); + + if (MatchStr) + { + //жϿֵǷкƥfalse + bool containsFalseValue = keyValueResult.ContainsValue(false); + bool containsFalseValue2 = keyValueResult2.ContainsValue(false); + if (containsFalseValue || containsFalseValue2) + MatchStr = false; + + } ///ִбȶ Сͼ //bool MatchStr = ManagerModelHelper.IsMatchSQLText(ref mCut, ref xK_HisenceSQLWord, ref xK_MatchDet); - bool MatchStr = true; - keyValueResult.ForEach(x => - { - if (x.Value == false) - { - MatchStr = false; - return; - } - }); - keyValueResult2.ForEach(x => - { - if (x.Value == false) - { - MatchStr = false; - return; - - } - }); + // int sqlblocksum= IfCam1TwoTriger = false; bBarTriger = false; @@ -1791,11 +1801,6 @@ namespace HisenceYoloDetection myLog("̳ɹ", DateTime.Now); } - private void InsertSqlBtn_Click(object sender, EventArgs e) - { - - } - private void RefeshData_Click(object sender, EventArgs e) { DataSet dataSet = SQLiteHelper.Query("select * from XK_HisenceDet"); @@ -1849,7 +1854,7 @@ namespace HisenceYoloDetection } //״̬ʶ private bool m_btnState; - + private void YZerorbx_Click(object sender, EventArgs e) { @@ -2619,17 +2624,17 @@ namespace HisenceYoloDetection break; case 6: { - // DefetShow6.ImaMAt = detectionImage; + DefetShow6.ImaMAt = detectionImage; } break; case 7: { - // DefetShow7.ImaMAt = detectionImage; + DefetShow7.ImaMAt = detectionImage; } break; case 8: { - // DefetShow8.ImaMAt = detectionImage; + //DefetShow8.ImaMAt = detectionImage; } break; @@ -2659,7 +2664,13 @@ namespace HisenceYoloDetection #if true //try //{ - + string filename = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString(); + string txtLog = "D://Hisence//" + filename + "logsMatch.log"; + using (StreamWriter sw = new StreamWriter(txtLog, true)) + { + sw.WriteLine(filename + "\n"); + sw.Flush(); + } Mat mResultCut = currentMatC.Clone(); Rect areaBlack = new Rect(); //ťλ @@ -2673,9 +2684,9 @@ namespace HisenceYoloDetection areaBlack = new Rect(rectsx, rectsy, rectsWidth, rectsHeight); } - - for (int i = 0; i < cam1TwoML.ResultDetails.Count; i++) + + for (int i = 0; i < cam1TwoML.ResultDetails.Count; i++) { Mat mResultCuti = mResultCut.Clone(); int rectsx = cam1TwoML.ResultDetails[i].Rect.X; @@ -2684,16 +2695,16 @@ namespace HisenceYoloDetection int rectsHeight = cam1TwoML.ResultDetails[i].Rect.Height; string blockIndex = cam1TwoML.ResultDetails[i].LabelDisplay; - if(keyValueResult.Keys.Contains(blockIndex)) + if (keyValueResult.Keys.Contains(blockIndex)) { int indexof = keyValueResult.Keys.ToList().IndexOf(blockIndex); int rectsxof = cam1TwoML.ResultDetails[indexof].Rect.X; - if(rectsx> rectsxof) + if (rectsx > rectsxof) { blockIndex = "3"; } - + } Rect area2 = new Rect(0, 0, 0, 0); Mat matCut = new Mat(); @@ -2727,7 +2738,7 @@ namespace HisenceYoloDetection myLog("ÿҪʱ" + sw.ElapsedMilliseconds, DateTime.Now); keyValueResult.Add(blockIndex, blockMatchI); - + } @@ -2881,7 +2892,7 @@ namespace HisenceYoloDetection if (!saveimage) { SQLStr = SQlxK_HisenceWord.TwoblockMainWord; - bool OneIF1 = ManagerModelHelper.StrMatch2(xK_HisenceWord.TwoblockMainWord, SQlxK_HisenceWord.TwoblockMainWord); + bool OneIF1 = ManagerModelHelper.StrMatch2(xK_HisenceWord.TwoblockMainWord, SQlxK_HisenceWord.TwoblockMainWord); OneIF1 = true; //ڶ ƥ string PathSql = SQlxK_HisenceWord.TwoblockPath; @@ -2890,7 +2901,7 @@ namespace HisenceYoloDetection Rect rectsql = CheckDiffSciHelper.strChangeRect(SQlxK_HisenceWord.TwoRect); Rect rectDet = CheckDiffSciHelper.strChangeRect(xK_HisenceWord.TwoRect); juanjiMatch = CheckDiffSciHelper.CheckDiffSci(PathSql, CutBlockMat, rectsql, rectDet, (bool)SQlxK_HisenceWord.TwoIFWhile, "D://Hisence//Test"); - // juanjiMatch = true; + // juanjiMatch = true; if (!OneIF1 || !juanjiMatch) { @@ -3050,10 +3061,12 @@ namespace HisenceYoloDetection } break; } - using (StreamWriter sw = new StreamWriter("D://Hisence//logsMatch.log", true)) + string filename = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString(); + string txtLog = "D://Hisence//" + filename + "logsMatch.log"; + + using (StreamWriter sw = new StreamWriter(txtLog, true)) { - string filename = dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Millisecond.ToString(); - sw.WriteLine(filename + "\n"); + if (blockIndex == "2") { sw.WriteLine("ƥ" + juanjiMatch);