瀏覽代碼

optimize the bc automation function

gaoshipeng 1 月之前
父節點
當前提交
d7f5128658

+ 2 - 2
Bin/x64/Debug/Config/ProData/HardwareConfig.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData PathName="HardwareConfig.xml" ID="1">
-  <Member RegName="SemControllerName" Value="Oxford" ImageInputSources="SE" />
-  <Member RegName="EDSName" Value="Oxford" WeightPercentageToAtomicPercentage="false" />
+  <Member RegName="SemControllerName" Value="OffLine" ImageInputSources="SE" />
+  <Member RegName="EDSName" Value="OffLine" WeightPercentageToAtomicPercentage="false" />
   <Member RegName="BrukerDllVersion" Version="Bruker.API.Esprit64.dll" />
   <Member RegName="FEIIP" Value="192.168.0.1" />
   <Member RegName="FEIPORT" Value="7520" />

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="IncA">
-  <Member RegName="BrightnessContrastRegulateParam" BrightPhaseElement="Cu" BrightPhaseValue="180" DarkPhaseElement="C" DarkPhaseValue="5" InitialBrightness="50" InitialContrast="50" mag="100" StdMaterialOTSPos="-37833,28061" ToRun="true" />
+  <Member RegName="BrightnessContrastRegulateParam" BrightPhaseElement="Cu" BrightPhaseValue="65" DarkPhaseElement="C" DarkPhaseValue="4" InitialBrightness="43.8028364" InitialContrast="45.89065707" mag="100" StdMaterialOTSPos="-36212,6775" ToRun="true" />
   <Member RegName="GenParam" DefaultArea="1400" DefaultSampleName="Sample" DefaultShape="0" EngineType="0:InclustionEngine" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="NoSTDDB" SteelTechnology="0" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="1:MANUAL" MatrixStep="0" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="255" start="175" />

+ 1 - 1
OTSCPP/OTSClassifyEngine/InclutionEngine/OTSClassifyEng.cpp

@@ -148,7 +148,7 @@ namespace OTSClassifyEngine
 	const double NITRIDE_MOLAR_CUTOFF = 5.0;
 	const CString NITRIDE_STR = _T("Nitride");
 
-#pragma region ÐÂÌí¼ÓµÄ̼ÄÚÈÝ
+#pragma region 
 	// carbon classification
 	const long INC_CAR_SUB_ELEMENT_MAX = 1;
 	const CString INC_CAR_SUB_ELEMENT_NAMES[INC_CAR_SUB_ELEMENT_MAX] =

+ 6 - 6
OTSCPP/OTSClrInterface/ImageProClr/ImageProForClr.cpp

@@ -83,13 +83,13 @@ namespace OTSCLRINTERFACE
 		foundedPixelNum = num;
 	}
 
-    bool ImageProForClr::CalcuBrightPhaseDarkPhaseGrayByOtsu(CBSEImgClr^ m_pBSEImg, int% gray1, int% gray2)  
+    bool ImageProForClr::CalcuBrightPhaseDarkPhaseGrayByOtsu(CBSEImgClr^ m_pBSEImg, int% bright, int% dark)  
     {  
-       int nativeGray1 = gray1;  
-       int nativeGray2 = gray2;  
-       BOOL result = imgProEngine->CalcuBrightPhaseDarkPhaseGrayByOtsu(m_pBSEImg->GetBSEImgPtr(), nativeGray1, nativeGray2);  
-       gray1 = nativeGray1;  
-       gray2 = nativeGray2;  
+       int nativebr = bright;  
+       int nativedark = dark;  
+       BOOL result = imgProEngine->CalcuBrightPhaseDarkPhaseGrayByOtsu(m_pBSEImg->GetBSEImgPtr(), nativebr, nativedark);
+       bright = nativebr;  
+       dark = nativedark;
        return result;  
     }
 

+ 12 - 12
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -132,7 +132,7 @@ namespace OTSIMGPROC
 			{
 				int center_x = centroids.at<double>(i, 0);
 				  int center_y = centroids.at<double>(i, 1);
-				  //矩形边框
+				  //锟斤拷锟轿边匡拷
 				  int x = stats.at<int>(i, CC_STAT_LEFT);
 				  int y = stats.at<int>(i, CC_STAT_TOP);
 				  int w = stats.at<int>(i, CC_STAT_WIDTH);
@@ -320,7 +320,7 @@ namespace OTSIMGPROC
 			{
 				int center_x = centroids.at<double>(i, 0);
 				int center_y = centroids.at<double>(i, 1);
-				//矩形边框
+				//锟斤拷锟轿边匡拷
 				int x = stats.at<int>(i, CC_STAT_LEFT);
 				int y = stats.at<int>(i, CC_STAT_TOP);
 				int w = stats.at<int>(i, CC_STAT_WIDTH);
@@ -567,7 +567,7 @@ namespace OTSIMGPROC
 		Mat imageGray3;
 
 	
-		cv::cvtColor(matImg, imageGray3, cv::COLOR_GRAY2RGB);//灰度转换 opencv4
+		cv::cvtColor(matImg, imageGray3, cv::COLOR_GRAY2RGB);//锟揭讹拷转锟斤拷 opencv4
 		cv::watershed(imageGray3, marks);
 
 
@@ -1322,7 +1322,7 @@ namespace OTSIMGPROC
 		{
 			int center_x = centroids.at<double>(i, 0);
 			int center_y = centroids.at<double>(i, 1);
-			//矩形边框
+			//锟斤拷锟轿边匡拷
 			int x = stats.at<int>(i, CC_STAT_LEFT);
 			int y = stats.at<int>(i, CC_STAT_TOP);
 			int w = stats.at<int>(i, CC_STAT_WIDTH);
@@ -1386,7 +1386,7 @@ namespace OTSIMGPROC
 	void  COTSImageProcess::findPeakAndValley(const vector<int>& v, vector<int>& peakPositions, vector<int>& valleyPositions)
 	{
 		vector<int> diff_v(v.size() - 1, 0);
-		// 计算V的一阶差分和符号函数trend
+		// 锟斤拷锟斤拷V锟斤拷一锟阶诧拷趾头锟斤拷藕锟斤拷锟絫rend
 		for (vector<int>::size_type i = 0; i != diff_v.size(); i++)
 		{
 			if (v[i + 1] - v[i] > 0)
@@ -1396,7 +1396,7 @@ namespace OTSIMGPROC
 			else
 				diff_v[i] = 0;
 		}
-		// 对Trend作了一个遍历
+		// 锟斤拷Trend锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷
 		for (int i = diff_v.size() - 1; i >= 0; i--)
 		{
 			if (diff_v[i] == 0 && i == diff_v.size() - 1)
@@ -1856,10 +1856,10 @@ namespace OTSIMGPROC
 
 		a_pOTSPart->SetDInscr(r * 2 * a_PixelSize);
 		//---------------calculate the image other caracater: length/width  realArea/minRectangeArea etc. we can use these propertes to do forward process.
-		double minRectArea = D_MIN * D_MinRecLen*a_PixelSize*a_PixelSize;//最小外接矩形面积
-		double fillRatio = a_pOTSPart->GetActualArea() / minRectArea;//实际面积与最小外接矩形面积比,that's the fill rate.
+		double minRectArea = D_MIN * D_MinRecLen*a_PixelSize*a_PixelSize;//锟斤拷小锟斤拷泳锟斤拷锟斤拷锟斤拷
+		double fillRatio = a_pOTSPart->GetActualArea() / minRectArea;//实锟斤拷锟斤拷锟斤拷锟斤拷锟叫★拷锟接撅拷锟斤拷锟斤拷锟斤拷锟�,that's the fill rate.
 		double lengthWidthRatio;
-		lengthWidthRatio = (double)D_MinRecLen / D_MIN;//长宽比
+		lengthWidthRatio = (double)D_MinRecLen / D_MIN;//锟斤拷锟斤拷锟�
 
 	
 		 //decide if this shape is a strip shape :if the lenthWidthRatio>2 then it is. if the lengthWidthRatio<2 and  the areaRatio<0.5 then it is.
@@ -2348,7 +2348,7 @@ namespace OTSIMGPROC
 		return true;
 	}
 
-	BOOL COTSImageProcess::CalcuBrightPhaseDarkPhaseGrayByOtsu(CBSEImgPtr a_pImgIn, int& gray1, int& gray2)
+	BOOL COTSImageProcess::CalcuBrightPhaseDarkPhaseGrayByOtsu(CBSEImgPtr a_pImgIn, int& bright, int& dark)
 	{
 		Mat srcImgMat = GetMatDataFromBseImg(a_pImgIn);
 		Mat brightPhaseMat, darkPhaseMat;			
@@ -2359,8 +2359,8 @@ namespace OTSIMGPROC
 		cv::Scalar mean2, std2;
 		cv::meanStdDev(brightPhaseMat, mean1, std1);
 		cv::meanStdDev(darkPhaseMat, mean2, std2);
-		gray1 = (int)mean2[0];
-		gray2 = (int)mean1[0];	
+		bright = (int)mean1[0];
+		dark = (int)mean2[0];	
 		return TRUE;
 	}
 	

+ 4 - 4
OTSIncAMeasureApp/ServiceCenter/CImageHandler.cs

@@ -696,17 +696,17 @@ namespace OTSModelSharp.ServiceCenter
 
             return prmclr;
         }
-        public  bool CalculateBrightnessDarkGrayByOtsu(CBSEImgClr bseimg, ref int gray1, ref int gray2)
+        public  bool CalculateBrightnessDarkGrayByOtsu(CBSEImgClr bseimg, ref int bright, ref int dark)
         {
             if (bseimg == null || bseimg.GetImageDataPtr() == null)
             {
-                gray1 = 0;
-                gray2 = 0;
+                bright = 0;
+                dark = 0;
                 return false;
             }
        
           
-            return imgProEngine.CalcuBrightPhaseDarkPhaseGrayByOtsu(bseimg, ref gray1, ref gray2);
+            return imgProEngine.CalcuBrightPhaseDarkPhaseGrayByOtsu(bseimg, ref bright, ref dark);
         }   
 
         public bool MergeBigBoundaryParticles(List<COTSField> allFields, double pixelSize, int scanFieldSize, System.Drawing.Size ResolutionSize, ref List<COTSParticleClr> mergedParts)