Przeglądaj źródła

Merge branch 'Release3.3' of http://36.129.169.60:30080/gogsadmin/OTS into Release3.3

zhangjiaxin 1 miesiąc temu
rodzic
commit
d6b259eb6a

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSReportMgrParam.rpf

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData systype="IncA">
   <Member RegName="Scale" strValue="1000" />
-  <Member RegName="DefaultComputedColName" strValue="ParticleCoordinate,Area,EquivalentCircleDiameter,MaxDiameter,MinDiameter,DiameterRatio,FerretDiameter,PERP,PERI,INSCR,MEAN,ELONG,ASPECT_ELONG,Orientation,XRayDataCount" />
+  <Member RegName="DefaultComputedColName" strValue="ParticleImage,FieldId,ParticleId,FieldPos,ParticleCoordinate,Area,EquivalentCircleDiameter,MaxDiameter,MinDiameter,DiameterRatio,FerretDiameter,PERP,PERI,INSCR,MEAN,ELONG,ASPECT_ELONG,Orientation,XRayDataCount" />
   <Member RegName="ElementsColName" strValue="C,N,O,Na,Si,Br,Al,S,Ca,Ni,Fe,P,Mg,Cr,Cl,K,Ti" />
   <Member RegName="PartSizeFile" name="ljInclusionLevel" />
   <Member RegName="TRIO_CHART_TYPE" strValue="CaO.SiO₂.Al₂O₃" />

+ 30 - 12
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSField.cs

@@ -6,6 +6,7 @@ using System;
 using System.Collections.Generic;
 using System.Drawing;
 using System.Drawing.Imaging;
+using System.Reflection;
 using System.Xml;
 
 namespace OTSDataType
@@ -483,10 +484,10 @@ namespace OTSDataType
                         p1.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
                         COTSRect p1rec = new COTSRect(p1left, p1top, p1right, p1bottom);
                         PointF p1Center = p1rec.GetCenterPoint();
-                        if (Math.Abs(pcenter.X - p1Center.X) < 2 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 2 * overlap)
+                        if (Math.Abs(pcenter.X - p1Center.X) < 1 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 1 * overlap)
                         {
-                            var sim = p.CalculateSimilarity(p1);
-                            if (sim > 0.95)
+                            double sim = 0;
+                            if (judgeParticlesAreDuplicate(p, pcenter, p1, p1Center, out sim))
                             {
                                 log.Warn("remove left side duplicate particle,similarity:" + sim.ToString("F3"));
                                 log.Warn("P1:" + p.GetImgPortraitString());
@@ -526,10 +527,10 @@ namespace OTSDataType
                         p1.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
                         COTSRect p1rec = new COTSRect(p1left, p1top, p1right, p1bottom);
                         PointF p1Center = p1rec.GetCenterPoint();
-                        if (Math.Abs(pcenter.X - p1Center.X) < 2 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 2 * overlap)
+                        if (Math.Abs(pcenter.X - p1Center.X) < 1 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 1 * overlap)
                         {
-                            var sim = p.CalculateSimilarity(p1);
-                            if (sim > 0.95)
+                            double sim = 0;
+                            if (judgeParticlesAreDuplicate(p, pcenter, p1, p1Center, out sim))
                             {
                                 log.Warn("remove upside duplicate particle,similarity:" + sim.ToString("F3"));
                                 log.Warn("P1:" + p.GetImgPortraitString());
@@ -579,10 +580,10 @@ namespace OTSDataType
                         p1.GetOTSRect(ref p1left, ref p1top, ref p1right, ref p1bottom);
                         COTSRect p1rec = new COTSRect(p1left, p1top, p1right, p1bottom);
                         PointF p1Center = p1rec.GetCenterPoint();
-                        if (Math.Abs(pcenter.X - p1Center.X) < 2 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 2 * overlap)
+                        if (Math.Abs(pcenter.X - p1Center.X) < 1 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 1 * overlap)
                         {
-                            var sim = p.CalculateSimilarity(p1);
-                            if (sim > 0.95)
+                            double sim = 0; 
+                            if (judgeParticlesAreDuplicate(p, pcenter, p1, p1Center, out sim))
                             {
                                 log.Warn("remove right side duplicate particle,similarity:" + sim.ToString("F3"));
                                 log.Warn("P1:" + p.GetImgPortraitString());
@@ -621,16 +622,16 @@ namespace OTSDataType
                         PointF p1Center = p1rec.GetCenterPoint();
                         if (Math.Abs(pcenter.X - p1Center.X) < 1 * overlap && Math.Abs(pcenter.Y - p1Center.Y) < 1 * overlap)
                         {
-                            var sim = p.CalculateSimilarity(p1);
-                            if (sim > 0.90)
+                            double sim = 0;
+                            if(judgeParticlesAreDuplicate(p, pcenter, p1, p1Center,out sim))
                             {
                                 log.Warn("remove down side duplicate particle,similarity:" + sim.ToString("F3"));
                                 log.Warn("P1:" + p.GetImgPortraitString());
                                 log.Warn("P2:" + p1.GetImgPortraitString());
                                 duplicateparts.Add(p);
-
                                 break;
                             }
+                           
                         }
 
                     }
@@ -696,6 +697,23 @@ namespace OTSDataType
             this.SetListAnalysisParticles(finalparts);
             log.Info("removing duplicate particles result:" + finalparts.Count);
         }
+        private bool judgeParticlesAreDuplicate( COTSParticleClr p,PointF pCenter,COTSParticleClr p1,PointF p1Center,out double sim)
+        {
+             sim = p.CalculateSimilarity(p1);
+            double d = Math.Sqrt(Math.Pow(pCenter.X - p1Center.X, 2) + Math.Pow(pCenter.Y - p1Center.Y, 2));
+            double d1 = p.GetFeretDiameter() / 2;
+            double d2 = p1.GetFeretDiameter() / 2;
+            if (d <= (d1 + d2) && sim > 0.90)
+            {
+
+                return true;
+            }
+            else if (d > (d1 + d2) && sim > 0.97)
+            {
+                return true;
+            }
+            return false;
+        }
         private List<COTSParticleClr> GetSideParticlesByOverlap(SORTING_DIRECTION direction, int overlap)
         {
             List<COTSParticleClr> sideparts = new List<COTSParticleClr>();

+ 19 - 3
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -2640,16 +2640,32 @@ namespace OTSIncAReportGraph.Controls
                 foreach (var otherP in a_field.List_DParticle)
                 {
                     var partPos = otherP.OTSRect.GetCenterPoint();
-                    if ((Math.Abs(partPos.X - selpartPos.X) < (float)overlap * 2) && (Math.Abs(partPos.Y - selpartPos.Y) < 2 * (float)overlap))
+                    if ((Math.Abs(partPos.X - selpartPos.X) < (float)overlap * 1) && (Math.Abs(partPos.Y - selpartPos.Y) < 1 * (float)overlap))
                     {
 
                         var otherpartclrObj = GetParticleclrObjFromParticleData(otherP);
-
+                        var selpartclrObj = GetParticleclrObjFromParticleData(selpart);
+                        double d = Math.Sqrt(Math.Pow(selpartPos.X - partPos.X, 2) + Math.Pow(selpartPos.Y - partPos.Y, 2));
+                        double d1 = otherpartclrObj.GetFeretDiameter() / 2;
+                        double d2 = selpartclrObj.GetFeretDiameter() / 2;
                         var sim = selpartclrobj.CalculateSimilarity(otherpartclrObj);
-                        if (sim > 0.95)
+                        bool issimilar = false;
+                        if (d <= (d1 + d2) && sim > 0.90)
+                        {
+
+                            issimilar= true;
+                            otherP.IsSelect = true;
+                        }
+                        else if (d > (d1 + d2) && sim > 0.97)
                         {
+                            issimilar =  true;
                             otherP.IsSelect = true;
                         }
+                       
+                        //if (sim > 0.97)
+                        //{
+                        //    otherP.IsSelect = true;
+                        //}
                     }
                 }
             }

+ 14 - 9
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage/ParticlesGridDevidePageShowConfig.Designer.cs

@@ -93,6 +93,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             this.groupBox2.Controls.Add(this.cb_PERP);
             this.groupBox2.Controls.Add(this.cb_MEAN);
             this.groupBox2.Controls.Add(this.cb_INSCR);
+            this.groupBox2.Enabled = false;
             this.groupBox2.Location = new System.Drawing.Point(11, 10);
             this.groupBox2.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.groupBox2.Name = "groupBox2";
@@ -105,7 +106,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cB_fieldPos
             // 
             this.cB_fieldPos.AutoSize = true;
-            this.cB_fieldPos.Location = new System.Drawing.Point(248, 173);
+            this.cB_fieldPos.Location = new System.Drawing.Point(97, 172);
             this.cB_fieldPos.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_fieldPos.Name = "cB_fieldPos";
             this.cB_fieldPos.Size = new System.Drawing.Size(72, 16);
@@ -116,8 +117,10 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cB_particleImage
             // 
             this.cB_particleImage.AutoSize = true;
+            this.cB_particleImage.Checked = true;
+            this.cB_particleImage.CheckState = System.Windows.Forms.CheckState.Checked;
             this.cB_particleImage.Enabled = false;
-            this.cB_particleImage.Location = new System.Drawing.Point(97, 172);
+            this.cB_particleImage.Location = new System.Drawing.Point(97, 226);
             this.cB_particleImage.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_particleImage.Name = "cB_particleImage";
             this.cB_particleImage.Size = new System.Drawing.Size(84, 16);
@@ -128,28 +131,30 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cB_particleid
             // 
             this.cB_particleid.AutoSize = true;
+            this.cB_particleid.Checked = true;
+            this.cB_particleid.CheckState = System.Windows.Forms.CheckState.Checked;
             this.cB_particleid.Enabled = false;
-            this.cB_particleid.Location = new System.Drawing.Point(248, 226);
+            this.cB_particleid.Location = new System.Drawing.Point(377, 197);
             this.cB_particleid.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_particleid.Name = "cB_particleid";
             this.cB_particleid.Size = new System.Drawing.Size(60, 16);
             this.cB_particleid.TabIndex = 134;
             this.cB_particleid.Text = "颗粒id";
             this.cB_particleid.UseVisualStyleBackColor = true;
-            this.cB_particleid.Visible = false;
             // 
             // cB_fieldid
             // 
             this.cB_fieldid.AutoSize = true;
+            this.cB_fieldid.Checked = true;
+            this.cB_fieldid.CheckState = System.Windows.Forms.CheckState.Checked;
             this.cB_fieldid.Enabled = false;
-            this.cB_fieldid.Location = new System.Drawing.Point(97, 226);
+            this.cB_fieldid.Location = new System.Drawing.Point(248, 197);
             this.cB_fieldid.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_fieldid.Name = "cB_fieldid";
             this.cB_fieldid.Size = new System.Drawing.Size(60, 16);
             this.cB_fieldid.TabIndex = 133;
             this.cB_fieldid.Text = "帧图id";
             this.cB_fieldid.UseVisualStyleBackColor = true;
-            this.cB_fieldid.Visible = false;
             // 
             // btn_auto
             // 
@@ -220,7 +225,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cB_Electrical_conductivity
             // 
             this.cB_Electrical_conductivity.AutoSize = true;
-            this.cB_Electrical_conductivity.Location = new System.Drawing.Point(377, 172);
+            this.cB_Electrical_conductivity.Location = new System.Drawing.Point(248, 172);
             this.cB_Electrical_conductivity.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_Electrical_conductivity.Name = "cB_Electrical_conductivity";
             this.cB_Electrical_conductivity.Size = new System.Drawing.Size(60, 16);
@@ -241,7 +246,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cB_Density
             // 
             this.cB_Density.AutoSize = true;
-            this.cB_Density.Location = new System.Drawing.Point(248, 199);
+            this.cB_Density.Location = new System.Drawing.Point(97, 197);
             this.cB_Density.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_Density.Name = "cB_Density";
             this.cB_Density.Size = new System.Drawing.Size(48, 16);
@@ -260,7 +265,7 @@ namespace OTSIncAReportApp._1_UI.Control_Grids.ParticlesGridDevidePage
             // cB_Hardness
             // 
             this.cB_Hardness.AutoSize = true;
-            this.cB_Hardness.Location = new System.Drawing.Point(97, 199);
+            this.cB_Hardness.Location = new System.Drawing.Point(377, 172);
             this.cB_Hardness.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
             this.cB_Hardness.Name = "cB_Hardness";
             this.cB_Hardness.Size = new System.Drawing.Size(48, 16);