瀏覽代碼

添加重叠尺寸

zty 3 年之前
父節點
當前提交
9d8e2a7648

+ 1 - 0
Bin/x64/Debug/Resources/XMLData/AppResource_EN.xml

@@ -1022,6 +1022,7 @@
 	  <Control name="groupBox9" text="Standard library selection" />
 	  <Control name="label43" text="Background processing mode:" />
 	  <Control name="label44" text="Using X-ray" />
+	  <Control name="label50" text="ImageOverlap" />
 	  <Control name="btnok" text="Sure" />
 	  <Control name="btncancel" text="Cancel" />
 	  <Control name="button_SpPart" text="Special Gray Grain Recognition Settings" />

+ 1 - 0
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -1022,6 +1022,7 @@
 	  <Control name="groupBox9" text="标准库选择" />
 	  <Control name="label43" text="背景处理方式" />
 	  <Control name="label44" text="是否使用X-ray" />
+	  <Control name="label50" text="图像重叠像素" />
 	  <Control name="btnok" text="确  定" />
 	  <Control name="btncancel" text="取  消" />
 	  <Control name="button_SpPart" text="特殊灰度颗粒识别设置" />

+ 1 - 6
OTS.sln

@@ -21,6 +21,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OTSData", "OTSCPP\OTSData\O
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OTSControl", "OTSCPP\OTSControl\OTSControl.vcxproj", "{3737BD0B-0DBB-4C11-AAD1-6E2B9822270B}"
 	ProjectSection(ProjectDependencies) = postProject
+		{CD59EA38-9ADF-40D3-B1C0-7A66A9D2F77B} = {CD59EA38-9ADF-40D3-B1C0-7A66A9D2F77B}
 		{0FF40344-34D5-49D0-9467-1F43C81A0D31} = {0FF40344-34D5-49D0-9467-1F43C81A0D31}
 		{CEA06DD1-5CD7-4B7D-A807-785718C3A854} = {CEA06DD1-5CD7-4B7D-A807-785718C3A854}
 	EndProjectSection
@@ -467,12 +468,6 @@ Global
 		{3B7695AA-8231-45AC-B493-84390A945D02}.Debug|x64.Build.0 = Debug|x64
 		{3B7695AA-8231-45AC-B493-84390A945D02}.Debug|x86.ActiveCfg = Debug|Any CPU
 		{3B7695AA-8231-45AC-B493-84390A945D02}.Debug|x86.Build.0 = Debug|Any CPU
-		{3B7695AA-8231-45AC-B493-84390A945D02}.LithiumCleanness|Any CPU.ActiveCfg = LithiumCleanness|Any CPU
-		{3B7695AA-8231-45AC-B493-84390A945D02}.LithiumCleanness|Any CPU.Build.0 = LithiumCleanness|Any CPU
-		{3B7695AA-8231-45AC-B493-84390A945D02}.LithiumCleanness|x64.ActiveCfg = LithiumCleanness|x64
-		{3B7695AA-8231-45AC-B493-84390A945D02}.LithiumCleanness|x64.Build.0 = LithiumCleanness|x64
-		{3B7695AA-8231-45AC-B493-84390A945D02}.LithiumCleanness|x86.ActiveCfg = LithiumCleanness|Any CPU
-		{3B7695AA-8231-45AC-B493-84390A945D02}.LithiumCleanness|x86.Build.0 = LithiumCleanness|Any CPU
 		{3B7695AA-8231-45AC-B493-84390A945D02}.Release_oxford50|Any CPU.ActiveCfg = Release_oxford50|Any CPU
 		{3B7695AA-8231-45AC-B493-84390A945D02}.Release_oxford50|Any CPU.Build.0 = Release_oxford50|Any CPU
 		{3B7695AA-8231-45AC-B493-84390A945D02}.Release_oxford50|x64.ActiveCfg = Release_oxford50|x64

+ 11 - 0
OTSCPP/OTSClrInterface/ImageProClr/FieldMgrClr.cpp

@@ -310,7 +310,18 @@ namespace OTSCLRINTERFACE {
 
 	}
 
+	int CFieldMgrClr::GetOverlap()
+	{
+		return m_LpFieldMgr->get()->GetOverlap();
+	}
 
+	// measure area
+	bool CFieldMgrClr::CFieldMgrClr::SetOverlap(int a_overlap)
+	{
+		m_LpFieldMgr->get()->SetOverlap(a_overlap);
+
+		return true;
+	}
 
 
 

+ 3 - 0
OTSCPP/OTSClrInterface/ImageProClr/FieldMgrClr.h

@@ -51,6 +51,9 @@ namespace OTSCLRINTERFACE {
 		CDomainClr^ GetMeasureArea();
 		bool SetMeasureArea(CDomainClr^ a_pMeasureArea);
 
+		int GetOverlap();
+		bool SetOverlap(int a_overlap);
+
 
 	protected:
 

+ 11 - 1
OTSCPP/OTSClrInterface/ImageProClr/OTSImgProcPrmClr.cpp

@@ -147,5 +147,15 @@ namespace OTSCLRINTERFACE {
 	
 	}
 
-	
+	int COTSImgProcPrmClr::GetOverlapParam()
+	{
+		return m_LpImgProParam->get()->GetOverlapParam();
+
+
+	}
+	void COTSImgProcPrmClr::SetOverlapParam(int a_val)
+	{
+		m_LpImgProParam->get()->SetOverlapParam(a_val);
+
+	}
 }

+ 2 - 0
OTSCPP/OTSClrInterface/ImageProClr/OTSImgProcPrmClr.h

@@ -47,6 +47,8 @@ namespace OTSCLRINTERFACE {
 		int GetErrodDilateParam();
 		void SetErrodDilateParam(int a_val);
 		
+		int GetOverlapParam();
+		void SetOverlapParam(int a_val);
 
 	protected:
 

+ 27 - 15
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -5,9 +5,14 @@
 #include "BrukerSPXFileMgr.h"
 #include "ControllerHelper.h"
 #include <COTSUtilityDllFunExport.h>
+#include "OTSImageProcess.h"
+
+
 
 namespace OTSController {
 
+	using namespace OTSIMGPROC;
+
 	unsigned int DEFAULT_MAX_WAIT_TIME_COLLECT_COUNTS = 5000;
 
 	const CString DllXMLFileName = "./Config/ProData/HardwareConfig.xml";
@@ -2998,7 +3003,28 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXraysList& a_listXrayPois, const DWORD a_
 		// cleanup data storage
 		memset(nChannelData, 0, sizeof(DWORD) * (int)BRUKER_PARAM::RT_SPECTRUM_CHANNELS);
 
-		if (m_bDoQuantification)
+		// get spectrum data of a point
+		bool success = GetPointListSpectrum(i, (long*)nChannelData);
+		if (!success)
+		{
+			// error
+			CPoint poi = a_listXrayPois[i]->GetPosition();
+			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints:Call GetPointListSpectrum failed : index = %d(x : %d, y : %d)"),
+				i,
+				poi.x,
+				poi.y);
+
+			return FALSE;
+		}
+
+		//COTSImageProcess::FindPeaks(11.11);
+		bool isTrue = true;
+		//if (i > nCollectCount / 2)
+		//{
+		//	isTrue = false;
+		//}
+
+		if (m_bDoQuantification && isTrue)
 		{
 
 			// quantify the spectrum
@@ -3017,20 +3043,6 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXraysList& a_listXrayPois, const DWORD a_
 			a_listXrayPois[i]->SetElementQuantifyData(listElement);
 		}
 
-		// get spectrum data of a point
-		bool success = GetPointListSpectrum(i, (long*)nChannelData);
-		if (!success)
-		{
-			// error
-			CPoint poi = a_listXrayPois[i]->GetPosition();
-			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints:Call GetPointListSpectrum failed : index = %d(x : %d, y : %d)"),
-				i,
-				poi.x,
-				poi.y);
-
-			return FALSE;
-		}
-
 		// set spectrum data for the x-ray point
 		a_listXrayPois[i]->SetXrayData(nChannelData);
 	}

+ 4 - 4
OTSCPP/OTSControl/OTSControl.vcxproj

@@ -176,7 +176,7 @@
     <LinkIncremental>true</LinkIncremental>
     <IntDir>$(SolutionDir)\Obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
     <OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
-    <IncludePath>$(SolutionDir)\OTSCPP\OTSControl;$(SolutionDir)OTSCPP\OTSData;$(SolutionDir)OTSCPP\Tools;$(SolutionDir)OTSCPP\OTSLog;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)\OTSCPP\OTSControl;$(SolutionDir)OTSCPP\OTSData;$(SolutionDir)OTSCPP\Tools;$(SolutionDir)OTSCPP\OTSLog;$(SolutionDir)OTSCPP\OTSImagePro;$(IncludePath)</IncludePath>
     <ReferencePath>$(SolutionDir)OTSCPP\OpenDll\OxfordApi50Dll;$(ReferencePath)</ReferencePath>
     <LibraryPath>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
@@ -247,7 +247,7 @@
     <LinkIncremental>false</LinkIncremental>
     <OutDir>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\</OutDir>
     <IntDir>$(SolutionDir)\Obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
-    <IncludePath>$(SolutionDir)\OTSCPP\OTSControl;$(SolutionDir)OTSCPP\OTSData;$(SolutionDir)OTSCPP\Tools;$(SolutionDir)OTSCPP\OTSLog;$(IncludePath)</IncludePath>
+    <IncludePath>$(SolutionDir)\OTSCPP\OTSControl;$(SolutionDir)OTSCPP\OTSData;$(SolutionDir)OTSCPP\Tools;$(SolutionDir)OTSCPP\OTSLog;$(SolutionDir)OTSCPP\OTSImagePro;$(IncludePath)</IncludePath>
     <ReferencePath>$(SolutionDir)\OpenDll\OxfordApiDll;$(ReferencePath)</ReferencePath>
     <LibraryPath>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
@@ -264,7 +264,7 @@
       <ModuleDefinitionFile>
       </ModuleDefinitionFile>
       <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>OTSData.lib;OTSLog.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>OTSData.lib;OTSLog.lib;OTSImagePro.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <Midl>
       <MkTypLibCompatible>false</MkTypLibCompatible>
@@ -528,7 +528,7 @@
       <ModuleDefinitionFile>
       </ModuleDefinitionFile>
       <AdditionalLibraryDirectories>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>OTSData.lib;OTSLog.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>OTSData.lib;OTSLog.lib;OTSImagePro.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
     <Midl>
       <MkTypLibCompatible>false</MkTypLibCompatible>

+ 9 - 6
OTSCPP/OTSImagePro/FieldMgr.cpp

@@ -380,6 +380,9 @@ namespace OTSIMGPROC {
 		// pixel size (micros)
 		//double dPixelSize = (double)dScanFiledSizeX / (double)ImageSizeByPixel.cx;
 
+		double dOverLapSizeX = m_Overlap * dScanFiledSizeX / pixelx;
+		double dOverLapSizeY = m_Overlap * dScanFiledSizeY / pixely;
+
 		// the measure domain rectangle 
 		CRect rectMeasureDomain = m_pMeasureArea->GetDomainRect();
 
@@ -391,8 +394,8 @@ namespace OTSIMGPROC {
 		OTS_GET_IMAGE_MODE nStartMode = (OTS_GET_IMAGE_MODE)m_fieldStartMode;
 			
 			// calculate total columns, rows and make sure the domain area be covered
-			int nTotalCols = (int)(ceil((double)rectMeasureDomain.Width() / dScanFiledSizeX));
-			int nTotalRows = (int)(ceil((double)rectMeasureDomain.Height() / dScanFiledSizeY));
+			int nTotalCols = (int)(ceil((double)rectMeasureDomain.Width() / (dScanFiledSizeX - 2 * dOverLapSizeX)));
+			int nTotalRows = (int)(ceil((double)rectMeasureDomain.Height() / (dScanFiledSizeY - 2 * dOverLapSizeY)));
 
 			// calculate column on the left of the centre point
 			int nLeftCols = nTotalCols / 2;
@@ -405,16 +408,16 @@ namespace OTSIMGPROC {
 			nTotalRows = nRowsOnTop * 2 + 1;
 
 			// calculate left, right field column position (x only
-			int nLeftMostColX = poiDomainCentre.x - nLeftCols * (int)dScanFiledSizeX;
-			int nUpMostRowY = poiDomainCentre.y - nRowsOnTop * (int)dScanFiledSizeY;
+			int nLeftMostColX = poiDomainCentre.x - nLeftCols * ((int)dScanFiledSizeX - 2 * (int)dOverLapSizeX);
+			int nUpMostRowY = poiDomainCentre.y - nRowsOnTop * ((int)dScanFiledSizeY - 2* (int)dOverLapSizeY);
 				
 				std::vector <std::vector <CPoint>> pointMatrics(nTotalRows, std::vector<CPoint>(nTotalCols));
 				for (int i = 0; i < nTotalRows; i++)
 				{
 					for (int j = 0; j < nTotalCols; j++)
 					{
-						pointMatrics[i][j].x = nLeftMostColX + j * (int)dScanFiledSizeX;
-						pointMatrics[i][j].y = nUpMostRowY + i * (int)dScanFiledSizeY;
+						pointMatrics[i][j].x = nLeftMostColX + j * ((int)dScanFiledSizeX - 2 * (int)dOverLapSizeX);
+						pointMatrics[i][j].y = nUpMostRowY + i * ((int)dScanFiledSizeY - 2 * (int)dOverLapSizeY);
 					}
 				}
 				std::vector <std::vector <int>> sequenceMat; //construct an matrics map to the pointMatrics,but the content is the sequence number.

+ 7 - 2
OTSCPP/OTSImagePro/FieldMgr.h

@@ -43,7 +43,12 @@ namespace OTSIMGPROC {
 		BOOL GetFieldRectByIndex(int a_nIndex, CRect& a_rctField);
 		int GetTotalFields() { auto m_listFieldCentrePoints = CalculateFieldCentrePoints1(); return (int)m_listFieldCentrePoints.size(); }
 		
-
+		//overlap
+		int GetOverlap() { return m_Overlap; }
+		void SetOverlap(int a_Overlap)
+		{
+			m_Overlap = a_Overlap;
+		}
 
 		// measure area
 		CDomainPtr GetMeasureArea() { return m_pMeasureArea; }
@@ -66,7 +71,7 @@ namespace OTSIMGPROC {
 		CDomainPtr m_pMeasureArea;
 
 		
-
+		int m_Overlap;
 		int m_ScanFieldSize;
 		CSize m_ResolutionSize;
 		int m_fieldStartMode;

+ 12 - 1
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -2760,6 +2760,17 @@ namespace OTSIMGPROC
 		return true;
 	}
 	
-		
+	BOOL COTSImageProcess::FindPeaks(double pixelSize)
+	{
+		int random = rand();
+		if (random % 2 == 0)
+		{
+			return TRUE;
+		}
+		else
+		{
+			return FALSE;
+		}
+	}
 	
 }

+ 1 - 0
OTSCPP/OTSImagePro/OTSImageProcess.h

@@ -71,6 +71,7 @@ namespace OTSIMGPROC {
 		static void GetSpecialGrayRangeImage(CBSEImgPtr a_pImgIn, CIntRangePtr a_SpecialGrayRange, CBSEImgPtr a_pBinImgOut, long& foundedPixelNum);
 		static void RemoveBackGround(CBSEImgPtr a_pImgIn, COTSImageProcessParamPtr a_pImageProcessParam, CBSEImgPtr a_pImgOut,long& foundedPixelNum);
 		static BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize);
+		static BOOL FindPeaks(double a_PixelSize);
 
 		static BOOL MergeBigBoundaryParticles(COTSFieldDataList allFields, double pixelSize, int scanFieldSize, CSize ResolutionSize, COTSParticleList& mergedParts);
 

+ 4 - 0
OTSCPP/OTSImagePro/OTSImageProcessParam.h

@@ -58,6 +58,9 @@ namespace OTSIMGPROC
 
 		void SetErrodDilateParam(int a_val) { m_errodDilateParam = a_val; }// 0 means don't use errosion and dilation.
 		int GetErrodDilateParam() {return m_errodDilateParam ; }
+
+		void SetOverlapParam(int a_val) { m_overlapParam = a_val; }// 0 means no overlap
+		int GetOverlapParam() { return m_overlapParam; }
 	
 	protected:
 
@@ -81,6 +84,7 @@ namespace OTSIMGPROC
 		int m_BGRemoveType;
 		int m_autoBGRemoveType;
 		int m_errodDilateParam;
+		int m_overlapParam;
 		
 	};
 

+ 1 - 1
OTSCPP/OTSLog/OTSLog.vcxproj

@@ -500,7 +500,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>Use</PrecompiledHeader>
+      <PrecompiledHeader>Create</PrecompiledHeader>
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>

+ 4 - 2
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CFieldPositionMgr.cs

@@ -37,7 +37,7 @@ namespace OTSModelSharp
         // unmeasured field centre points list
         List<System.Drawing.Point> m_listUnmeasuredFieldCentrePoints;
         CFieldMgrClr fieldmgrclr;
-        public bool Init(CDomain a_pMeasureArea, COTSImgScanPrm  a_poImageScanParam, CSEMDataMsr a_poSEMDataMsr, List<System.Drawing.Point> a_listMeasuredFieldCentrePoints)
+        public bool Init(CDomain a_pMeasureArea, COTSImgScanPrm  a_poImageScanParam, COTSImageProcParam a_pImgProcParam, CSEMDataMsr a_poSEMDataMsr, List<System.Drawing.Point> a_listMeasuredFieldCentrePoints)
         {
             // assign class member
             m_pMeasureArea = new CDomain(a_pMeasureArea);
@@ -69,9 +69,11 @@ namespace OTSModelSharp
             System.Drawing.Size sizePixelImage = RESOLUTION_VALUE[nResulotionId];
            
             fieldmgrclr.Init(domainclr.GetClrDomainObj(), sizePixelImage,scanfieldsize, (int)m_poImageScanParam.GetFieldStartMode());
-         
+            fieldmgrclr.SetOverlap(a_pImgProcParam.GetOverlapParam());
+
             m_listUnmeasuredFieldCentrePoints = fieldmgrclr.GetUnmeasuredFieldCentrePoints(a_listMeasuredFieldCentrePoints);
             m_listFieldCentrePoints = fieldmgrclr.GetFieldCentrePoints();
+
             return true;
         }
 

+ 2 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -316,6 +316,7 @@ namespace OTSModelSharp
             // sample measure parameters
             CSampleParam pMsrParam = m_Sample.GetMsrParams();
             COTSImgScanPrm  poImageScanParam = pMsrParam.GetImageScanParam();
+            COTSImageProcParam pImgProcParam = pMsrParam.GetImageProcessParam();
             CSEMDataMsr poSEMDataMsr = m_Sample.GetSEMDataMsr();
             CMsrSampleStatus pStatus = m_Sample.GetMsrStatus();
 
@@ -326,7 +327,7 @@ namespace OTSModelSharp
             CFieldPositionMgr pFieldMgr = new CFieldPositionMgr();
 
             // init field centers list manager
-            if (!pFieldMgr.Init(m_Sample.GetMsrArea(), poImageScanParam, poSEMDataMsr, listCompletedCenter))
+            if (!pFieldMgr.Init(m_Sample.GetMsrArea(), poImageScanParam, pImgProcParam, poSEMDataMsr, listCompletedCenter))
             {
                 log.Error("CalculateFieldsCenters: failed to init field centres list manager.");
                 a_listUnMsrFieldCenter = new List<System.Drawing.Point>();

+ 14 - 2
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageProcParam.cs

@@ -23,6 +23,7 @@ namespace OTSDataType
         private OTS_BGREMOVE_TYPE m_BGRemoveType;
         private OTS_AUTOBGREMOVE_TYPE m_autoBGRemoveType;
         int m_errodDilateParam;
+        int m_OverlapParam;
 
         private CSpecialGrayRangeParam m_specialGreyRangeParam;
 
@@ -46,6 +47,7 @@ namespace OTSDataType
             m_BGRemoveType = OTS_BGREMOVE_TYPE.MANUAL;// OTS_BGREMOVE_TYPE.AUTO;
             m_autoBGRemoveType = OTS_AUTOBGREMOVE_TYPE.MIDDLE;
             m_errodDilateParam = 3;
+            m_OverlapParam = 20;
         }
         public CDoubleRange GetIncAreaRange() { return m_oIncArea; }
         public void SetIncAreaRange(CDoubleRange a_oVal) { m_oIncArea = a_oVal; }
@@ -68,6 +70,10 @@ namespace OTSDataType
 
         public void SetErrodDilateParam(int a_oVal) { m_errodDilateParam = a_oVal; }
 
+        public int GetOverlapParam() { return m_OverlapParam; }
+
+        public void SetOverlapParam(int a_oVal) { m_OverlapParam = a_oVal; }
+
 
         public void Duplicate(COTSImageProcParam a_oSource)
         {
@@ -83,7 +89,7 @@ namespace OTSDataType
             m_BGRemoveType = a_oSource.m_BGRemoveType;
             m_autoBGRemoveType = a_oSource.m_autoBGRemoveType;
             m_errodDilateParam = a_oSource.m_errodDilateParam;
-
+            m_OverlapParam = a_oSource.m_OverlapParam;
 
 
         }
@@ -94,7 +100,8 @@ namespace OTSDataType
             return m_oIncArea == a_oSource.m_oIncArea &&
                 m_oBGGray == a_oSource.m_oBGGray &&
                 m_oParticleGray == a_oSource.m_oParticleGray &&
-                m_errodDilateParam == a_oSource.m_errodDilateParam;
+                m_errodDilateParam == a_oSource.m_errodDilateParam&&
+                m_OverlapParam == a_oSource.m_OverlapParam;
 
         }
 
@@ -113,6 +120,9 @@ namespace OTSDataType
             xInt xnCorrosionExpansionCoefficient = new xInt();
             slo.Register("ErrodDilateParam", xnCorrosionExpansionCoefficient);
 
+            xInt xnOverlapParam = new xInt();
+            slo.Register("OverlapParam", xnOverlapParam);
+
             xString xnBGRemoveType = new xString();
             xString xnautoBGRemoveType = new xString();
 
@@ -125,6 +135,7 @@ namespace OTSDataType
                 xnBGRemoveType.AssignValue((int)m_BGRemoveType+":"+m_BGRemoveType.ToString());
                 xnautoBGRemoveType.AssignValue((int)m_autoBGRemoveType+":"+m_autoBGRemoveType.ToString());
                 xnCorrosionExpansionCoefficient.AssignValue(m_errodDilateParam);
+                xnOverlapParam.AssignValue(m_OverlapParam);
                 slo.Serialize(true, classDoc, rootNode);
             }
             else
@@ -134,6 +145,7 @@ namespace OTSDataType
                 m_BGRemoveType = (OTS_BGREMOVE_TYPE)Convert.ToInt32( xnBGRemoveType.value().Split(':')[0]);
                 m_autoBGRemoveType = (OTS_AUTOBGREMOVE_TYPE)Convert.ToInt32( xnautoBGRemoveType.value().Split(':')[0]);
                 m_errodDilateParam = Convert.ToInt32(xnCorrosionExpansionCoefficient.value());
+                m_OverlapParam = Convert.ToInt32(xnOverlapParam.value());
             }
         }
     }

+ 2 - 1
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -3767,6 +3767,7 @@ namespace OTSMeasureApp
 
             //m_MeasureAppForm.m_ProjParam.m_ResultData.GetImageProcParam
             COTSImgScanPrm pImgScanParam = WSample.GetMsrParams().GetImageScanParam();
+            COTSImageProcParam pImgProcParam = WSample.GetMsrParams().GetImageProcessParam();
 
             CSEMDataMsr pSEMDataMsr = WSample.GetSEMDataMsr();
       
@@ -3831,7 +3832,7 @@ namespace OTSMeasureApp
              
             }
             ////计算所有的帧图位置  calculate all the field position point in OTS coordination.
-            if (!pFieldMgr.Init(pMsrArea, pImgScanParam, pSEMDataMsr, listPoint))
+            if (!pFieldMgr.Init(pMsrArea, pImgScanParam, pImgProcParam, pSEMDataMsr, listPoint))
             {
                 return false;
             }

+ 5 - 1
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -592,7 +592,9 @@ namespace OTSMeasureApp
             //颗粒灰度范围 最大
             IDC_EDIT_PARTMAX.Text = m_cotsimgprocprm.GetParticleGray().GetEnd().ToString();
             //腐蚀膨胀系数
-            IDC_COMBO_CorrosionExpansionCoefficient.Text=m_cotsimgprocprm.GetErrodDilateParam().ToString();
+            IDC_COMBO_CorrosionExpansionCoefficient.Text = m_cotsimgprocprm.GetErrodDilateParam().ToString();
+            //重叠尺寸
+            IDC_EDIT_Overlap.Text = m_cotsimgprocprm.GetOverlapParam().ToString();
 
             //去背景方式
             foreach (ComboBoxItem cbi in IDC_COMBO_BGREMOVETYPE.Items)
@@ -814,6 +816,8 @@ namespace OTSMeasureApp
             m_cotsimgprocprm.SetAutoBGRemoveType((otsdataconst.OTS_AUTOBGREMOVE_TYPE)enum_AUTOBGREMOVETYP.Value);
             //腐蚀膨胀系数
             m_cotsimgprocprm.SetErrodDilateParam(Convert.ToInt32(IDC_COMBO_CorrosionExpansionCoefficient.Text));
+            //重叠像素
+            m_cotsimgprocprm.SetOverlapParam(Convert.ToInt32(IDC_EDIT_Overlap.Text));
         }
 
         /// <summary>

+ 38 - 0
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.designer.cs

@@ -158,6 +158,9 @@
             this.groupBox7 = new System.Windows.Forms.GroupBox();
             this.IDC_EDIT_STOP_INCA_AREA = new System.Windows.Forms.TextBox();
             this.label48 = new System.Windows.Forms.Label();
+            this.label50 = new System.Windows.Forms.Label();
+            this.label51 = new System.Windows.Forms.Label();
+            this.IDC_EDIT_Overlap = new System.Windows.Forms.TextBox();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -920,6 +923,8 @@
             // groupBox5
             // 
             this.groupBox5.Controls.Add(this.IDC_COMBO_CorrosionExpansionCoefficient);
+            this.groupBox5.Controls.Add(this.label50);
+            this.groupBox5.Controls.Add(this.IDC_EDIT_Overlap);
             this.groupBox5.Controls.Add(this.label49);
             this.groupBox5.Controls.Add(this.IDC_COMBO_AUTOBGREMOVETYP);
             this.groupBox5.Controls.Add(this.label_Auto);
@@ -936,6 +941,7 @@
             this.groupBox5.Controls.Add(this.IDC_EDIT_PARTAREAMIN);
             this.groupBox5.Controls.Add(this.label24);
             this.groupBox5.Controls.Add(this.label28);
+            this.groupBox5.Controls.Add(this.label51);
             this.groupBox5.Controls.Add(this.label27);
             this.groupBox5.Controls.Add(this.label26);
             this.groupBox5.Controls.Add(this.label23);
@@ -1616,6 +1622,35 @@
             this.label48.Text = "终止测量面积";
             this.label48.Visible = false;
             // 
+            // label50
+            // 
+            this.label50.AutoSize = true;
+            this.label50.Location = new System.Drawing.Point(6, 181);
+            this.label50.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label50.Name = "label50";
+            this.label50.Size = new System.Drawing.Size(77, 12);
+            this.label50.TabIndex = 824;
+            this.label50.Text = "图像重叠像素";
+            // 
+            // label51
+            // 
+            this.label51.AutoSize = true;
+            this.label51.Location = new System.Drawing.Point(225, 181);
+            this.label51.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label51.Name = "label51";
+            this.label51.Size = new System.Drawing.Size(35, 12);
+            this.label51.TabIndex = 721;
+            this.label51.Text = "pixel";
+            // 
+            // IDC_EDIT_Overlap
+            // 
+            this.IDC_EDIT_Overlap.Location = new System.Drawing.Point(125, 178);
+            this.IDC_EDIT_Overlap.MaxLength = 10;
+            this.IDC_EDIT_Overlap.Name = "IDC_EDIT_Overlap";
+            this.IDC_EDIT_Overlap.Size = new System.Drawing.Size(92, 21);
+            this.IDC_EDIT_Overlap.TabIndex = 832;
+            this.IDC_EDIT_Overlap.Text = "20";
+            // 
             // ProgMgrInfoForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -1815,5 +1850,8 @@
         private System.Windows.Forms.Label label48;
         private System.Windows.Forms.ComboBox IDC_COMBO_CorrosionExpansionCoefficient;
         private System.Windows.Forms.Label label49;
+        private System.Windows.Forms.Label label50;
+        private System.Windows.Forms.Label label51;
+        public System.Windows.Forms.TextBox IDC_EDIT_Overlap;
     }
 }

+ 5 - 5
OTSIncAMeasureApp/CRegistration.cs

@@ -17,13 +17,13 @@ namespace OTSMeasureApp
            
             try
             {
-                //if (!checkRegistration())//文件授权法
-                //{
-                //    return false;
+                if (!checkRegistration())//文件授权法
+                {
+                    return false;
 
-                //}
+                }
                 //狗加密法
-                SenseShield.DogDecrypting.decrypting(101);//参数为许可号
+                //SenseShield.DogDecrypting.decrypting(101);//参数为许可号
             }
             catch (Exception ex)
             {

+ 1 - 0
OTSIncAMeasureApp/ServiceCenter/CImageHandler.cs

@@ -324,6 +324,7 @@ namespace OTSModelSharp.ServiceInterface
             prmclr.SetBGRemoveType((int)a_oSource.GetBGRemoveType());
             prmclr.SetAutoBGRemoveType((int)a_oSource.GetAutoBGRemoveType());
             prmclr.SetErrodDilateParam(a_oSource.GetErrodDilateParam());
+            prmclr.SetOverlapParam(a_oSource.GetOverlapParam());
 
             return prmclr;
         }