Explorar el Código

add errode and dialate operate after removebackground .

gsp hace 4 años
padre
commit
2df8ef32e6

+ 6 - 4
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -1223,12 +1223,11 @@ namespace OTSIMGPROC
 		BYTE* pTempImg2 = new BYTE[nImgSize];
 
 		BYTE* pSrcImg = a_pImgIn->GetImageDataPointer();
-		memcpy(pTempImg2, pSrcImg, nImgSize);
+		//memcpy(pTempImg2, pSrcImg, nImgSize);
 
 		//cv::blur(pSrcImg, pTempImg2, nImgSize);
 
-		/*COTSImageProcess::BErode3(pSrcImg, pTempImg, 5, nHeightImg, nWidthImg);
-		COTSImageProcess::BDilate3(pTempImg, pTempImg2, 5, nHeightImg, nWidthImg);*/
+	
 
 		
 
@@ -1259,6 +1258,8 @@ namespace OTSIMGPROC
 					nNumParticle++;
 				}
 			}
+			COTSImageProcess::BErode3(pPixel, pTempImg, 5, nHeightImg, nWidthImg);
+			COTSImageProcess::BDilate3(pTempImg, pPixel, 5, nHeightImg, nWidthImg);
 		}
 		else
 		{
@@ -1317,7 +1318,8 @@ namespace OTSIMGPROC
 			default:
 				break;
 			}
-
+			COTSImageProcess::BErode3(pPixel, pTempImg, 5, nHeightImg, nWidthImg);
+			COTSImageProcess::BDilate3(pTempImg, pPixel, 5, nHeightImg, nWidthImg);
 		}
 		a_pBinImgOut->SetImageData(pPixel,nWidthImg,nHeightImg);
 		

+ 3 - 13
OTSIncAMeasureApp/0-OTSModel/Measure/1-OTSInclution/SmplMeasureInclution.cs

@@ -173,12 +173,7 @@ namespace OTSModelSharp
             {
                 loger.Info("Begin  feature mode xray collection!AQTime:"+nXRayAQTime+" xrayNum:"+ listAnalysisparts.Count);
                 m_EDSHardwareMgr.GetXRayByFeatures(listAnalysisparts, nXRayAQTime, true);
-                //{
-                //    loger.Error("ImageProcess: call GetXRayByFeatures method.");
-                //    pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
-                //    StartSaveFileThread(curFldData);
-                //    return false;
-                //}
+    
 
             }
             else 
@@ -186,12 +181,7 @@ namespace OTSModelSharp
                 loger.Info("Begin  point mode xray collection!AQTime:" + nXRayAQTime + " xrayNum:" + listAnalysisparts.Count);
                 // get x-ray list (analysis) by points
                 m_EDSHardwareMgr.GetXRayByPoints(listAnalysisparts, nXRayAQTime, true);
-                //{ // failed to call GetXRayByPoints method
-                //    loger.Error("ImageProcess: call GetXRayByPoints method.");
-                //    pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
-                //    StartSaveFileThread(curFldData);
-                //    return false;
-                //}
+     
 
             }
          
@@ -219,7 +209,7 @@ namespace OTSModelSharp
             }
             catch (Exception e)
             {
-                loger.Info("calcu the particle image property or classify failed. " + e.Message);
+                loger.Info(" classify failed. " + e.Message);
             }
 
 

+ 1 - 5
OTSIncAMeasureApp/0-OTSModel/Measure/2-OTSCleanliness/SmplMeasureCleanliness.cs

@@ -306,11 +306,7 @@ namespace OTSModelSharp
 
             // remove BES image background
             curFldData.RemoveBSEImageBG(pImgProcessParam);
-            //{ // failed to call RemoveBSEImageBG method
-            //    loger.Error("ImageProcess: call RemoveBSEImageBG method.");
-            //    pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
-            //    return false;
-            //}
+   
 
             // check if this is an empty image
             if (curFldData.NoParticle())

+ 1 - 15
OTSIncAMeasureApp/0-OTSModel/Measure/GetBSEPic/CSmplMeasure.cs

@@ -232,21 +232,7 @@ namespace OTSModelSharp
 
             return true;
         }
-        // reset Scan
-        //bool ResetScan()
-        //{
-        //    // get scan controller
-        //    //var pScanController = m_ScanHardwareMgr;
-        //    var sem = m_SemHardwareMgr;
-
-        //    // reset Scanner 
-        //    //if (!sem.DisConnect())
-        //    //{
-        //    //    loger.Error("AcquireABSEImage: failed to call SetAndStartScan method.");
-        //    //}
-        //    loger.Warn("Reset Scan!");
-        //    return true;
-        //}
+
 
        public  void SetWorkingFolder(String a_strWorkingFolder)
         {

+ 2 - 2
OTSIncAMeasureApp/2-OTSMeasureParamManage/MeasureParam.cd

@@ -42,7 +42,7 @@
   <Class Name="OTSModelSharp.COTSDefaultParam" Collapsed="true">
     <Position X="2" Y="2.25" Width="2.5" />
     <TypeIdentifier>
-      <HashCode>ABCAgKIgAIIAgACGAEggBIAACCHFMAAAAAgCAAMABAA=</HashCode>
+      <HashCode>ABCAgKMgAIIAgACGQEggBIAACCHFMAAAAAgCAAMABAA=</HashCode>
       <FileName>0-OTSModel\Measure\GetParamData\OTSDefaultParam.cs</FileName>
     </TypeIdentifier>
   </Class>
@@ -148,7 +148,7 @@
   <Class Name="OTSModelSharp.COTSGeneralParam" Collapsed="true">
     <Position X="14.75" Y="1.75" Width="2.75" />
     <TypeIdentifier>
-      <HashCode>MAAAgEQEQhIAbYBCiAQQBIRmyGxAKAikJADGECAAAQA=</HashCode>
+      <HashCode>MAAAgEQEQhIAbYBCiAQQBIQmyGxAKAikJADGECAAAQA=</HashCode>
       <FileName>0-OTSModel\Measure\GetParamData\OTSGeneralParam.cs</FileName>
     </TypeIdentifier>
   </Class>