Explorar el Código

improve the DMax calculation method

GSP hace 6 días
padre
commit
0536d69665

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

@@ -30,7 +30,7 @@ namespace OTSClassifyEngine
 	// key element
 	const long INC_KEY_ELEMENT_MAX = 4;
 	const double INC_KEY_ELEMENT_CUT_OFF = 0.02;	// weight%
-	const double INC_KEY_ELEMENT_TOTAL_100 = 5.0;	// total molar value
+	const double INC_KEY_ELEMENT_TOTAL_100 = 3.0;	// total molar value
 	const CString INC_KEY_ELEMENT_NAMES[INC_KEY_ELEMENT_MAX] =
 	{
 		_T("S"),_T("N"),_T("O")
@@ -474,7 +474,7 @@ namespace OTSClassifyEngine
 			 sumOfCarboOxideFe = dOweight + dCarbonWeight + dFeWeight;
 		}
 		
-		if (sumOfCarboOxideFe > 95)// contain too much c o fe then classify it as invalid
+		if (sumOfCarboOxideFe > 97)// contain too much c o fe then classify it as invalid
 		{
 			a_nIncId = OTS_PARTICLE_TYPE::INVALID;
 			return TRUE;

+ 5 - 5
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 #include "stdafx.h"
 #include <opencv2/core/core.hpp>  
 #include <opencv2/highgui/highgui.hpp> 
@@ -1667,7 +1667,7 @@ namespace OTSIMGPROC
 	 BOOL COTSImageProcess::CalcuParticleImagePropertes(COTSParticlePtr a_pOTSPart, double a_PixelSize)
 	{	
 		//--------- convert this particle data to image data,construct an image only with this particle.------
-		const int nExpand_Size = 3;
+		const int nExpand_Size = 4;
 		const int nWhiteColor = 0;
 		const int nThickness = 1;
 		// lineType Type of the line
@@ -1697,9 +1697,9 @@ namespace OTSIMGPROC
 		COTSSegmentsList listSegment = a_pOTSPart->GetFeature()->GetSegmentsList();
 		for (auto pSegment : listSegment)
 		{
-			int nStart = pSegment->GetStart() - rect.left + nExpand_Size;
-			int nEnd = pSegment->GetStart() + pSegment->GetLength() - rect.left - 1 + nExpand_Size;
-			int nHeight = pSegment->GetHeight() - rect.top + nExpand_Size;
+			int nStart = pSegment->GetStart() - rect.left+ nExpand_Size/2;
+			int nEnd = nStart + pSegment->GetLength() ; 
+			int nHeight = pSegment->GetHeight() - rect.top+ nExpand_Size/2;
 			line(particleImage, Point(nStart, nHeight), Point(nEnd, nHeight), Scalar(nBlackColor), nThickness, nLineType);
 		}		
 	//--------abstract the contour of the particle.