zty vor 2 Jahren
Ursprung
Commit
43e31f4d59
1 geänderte Dateien mit 64 neuen und 11 gelöschten Zeilen
  1. 64 11
      OTSIncAMeasureApp/ServiceCenter/CImageHandler.cs

+ 64 - 11
OTSIncAMeasureApp/ServiceCenter/CImageHandler.cs

@@ -470,40 +470,93 @@ namespace OTSModelSharp.ServiceInterface
             if (style == "left_right")
             {
                 //寻找左帧图的右侧区域颗粒
-                foreach (var leftParticles in left_upField.GetListAnalysisParticles())
+                double left_upField_sum = 0;
+                double right_downField_sum = 0;
+                foreach (var upParticles in left_upField.GetListAnalysisParticles())
                 {
-                    Rectangle leftRectangle = (Rectangle)leftParticles.GetParticleRect();
-                    if (leftRectangle.Left > resolutionSize.Width - overlap)//未跨界
+                    Rectangle upRectangle = (Rectangle)upParticles.GetParticleRect();
+                    if (upRectangle.Top > resolutionSize.Height - overlap / 2)//未跨界
                     {
-                        if (leftRectangle.Right == resolutionSize.Width)//颗粒右侧在边界处截断
-                        {
+                        left_upField_sum += upParticles.GetActualArea();
+                    }
+                }
+                foreach (var downParticles in right_downField.GetListAnalysisParticles())
+                {
+                    Rectangle downRectangle = (Rectangle)downParticles.GetParticleRect();
+                    if (downRectangle.Top > resolutionSize.Height - overlap / 2)//未跨界
+                    {
+                        right_downField_sum += downParticles.GetActualArea();
+                    }
+                }
 
-                        }
-                        else
+                if (left_upField_sum < right_downField_sum)
+                {
+                    foreach (var leftParticles in left_upField.GetListAnalysisParticles())
+                    {
+                        Rectangle leftRectangle = (Rectangle)leftParticles.GetParticleRect();
+                        if (leftRectangle.Left > resolutionSize.Width - overlap)//未跨界
                         {
                             particleClrs.Add(leftParticles);
                         }
                     }
                 }
+                else
+                {
+                    foreach (var downParticles in right_downField.GetListAnalysisParticles())
+                    {
+                        Rectangle downRectangle = (Rectangle)downParticles.GetParticleRect();
+                        if (downRectangle.Right < overlap / 2)//未跨界
+                        {
+                            particleClrs.Add(downParticles);
+                        }
+                    }
+                }
             }
             else
             {
                 //寻找上帧图的下侧区域颗粒
+                double left_upField_sum = 0;
+                double right_downField_sum = 0;
                 foreach (var upParticles in left_upField.GetListAnalysisParticles())
                 {
                     Rectangle upRectangle = (Rectangle)upParticles.GetParticleRect();
                     if (upRectangle.Top > resolutionSize.Height - overlap / 2)//未跨界
                     {
-                        if (upRectangle.Bottom == resolutionSize.Height)//颗粒下方在边界处截断
-                        {
+                        left_upField_sum += upParticles.GetActualArea();
+                    }
+                }
+                foreach (var downParticles in right_downField.GetListAnalysisParticles())
+                {
+                    Rectangle downRectangle = (Rectangle)downParticles.GetParticleRect();
+                    if (downRectangle.Top > resolutionSize.Height - overlap / 2)//未跨界
+                    {
+                        right_downField_sum += downParticles.GetActualArea();
+                    }
+                }
 
-                        }
-                        else
+                if (left_upField_sum < right_downField_sum)
+                {
+                    foreach (var upParticles in left_upField.GetListAnalysisParticles())
+                    {
+                        Rectangle upRectangle = (Rectangle)upParticles.GetParticleRect();
+                        if (upRectangle.Top > resolutionSize.Height - overlap / 2)//未跨界
                         {
                             particleClrs.Add(upParticles);
                         }
                     }
                 }
+                else
+                {
+                    foreach (var downParticles in right_downField.GetListAnalysisParticles())
+                    {
+                        Rectangle downRectangle = (Rectangle)downParticles.GetParticleRect();
+                        if (downRectangle.Bottom < overlap / 2)//未跨界
+                        {
+                            particleClrs.Add(downParticles);
+                        }
+                    }
+                }
+
             }
 
             return particleClrs;