瀏覽代碼

fix a bug in image process(remove background and find the particles)

cxs 3 年之前
父節點
當前提交
0d503e40d0
共有 2 個文件被更改,包括 16 次插入11 次删除
  1. 2 2
      OTSCPP/OTSControl/OTSControl.vcxproj
  2. 14 9
      OTSCPP/OTSImagePro/OTSImageProcess.cpp

+ 2 - 2
OTSCPP/OTSControl/OTSControl.vcxproj

@@ -115,7 +115,7 @@
     <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>
-    <ReferencePath>$(SolutionDir)OTSCPP\OpenDll\OxfordApiDll;$(ReferencePath)</ReferencePath>
+    <ReferencePath>$(SolutionDir)OTSCPP\OpenDll\OxfordApi50Dll;$(ReferencePath)</ReferencePath>
     <LibraryPath>$(SolutionDir)\Bin\$(Platform)\$(Configuration)\;$(LibraryPath)</LibraryPath>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_oxford50|x64'">
@@ -404,7 +404,7 @@
   </ItemGroup>
   <ItemGroup>
     <Reference Include="OINA.Extender">
-      <HintPath>..\..\..\..\OTS2_0\OTS\OTS\OTSCPP\OpenDll\OxfordApi50Dll\OINA.Extender.dll</HintPath>
+      <HintPath>..\OpenDll\OxfordApi50Dll\OINA.Extender.dll</HintPath>
     </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />

+ 14 - 9
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -1365,18 +1365,23 @@ namespace OTSIMGPROC
 					}
 					COTSParticleList roiParts;
 					
-					GetOneParticleFromROI(rectMax.x, rectMax.y, rectMax.width, rectMax.height, imageROI.data, roiParts);
-					if (roiParts.size()>0)
+					if (GetOneParticleFromROI(rectMax.x, rectMax.y, rectMax.width, rectMax.height, imageROI.data, roiParts))
 					{
-						COTSParticlePtr roiPart = roiParts[0];//we will find only one part in the roi.
-						roiPart->SetXRayPos(CPoint(center_x, center_y));
-						CRect r = CRect(x, y, x + w, y + h);
-						roiPart->SetParticleRect(r);
-						roiPart->SetActualArea(actualArea);
-						roiPart->SetPixelArea(area);
-						listParticleOut.push_back(roiPart);
+						if (roiParts.size() > 0)
+						{
+							COTSParticlePtr roiPart = roiParts[0];//we will find only one part in the roi.
+							roiPart->SetXRayPos(CPoint(center_x, center_y));
+							CRect r = CRect(x, y, x + w, y + h);
+							roiPart->SetParticleRect(r);
+							roiPart->SetActualArea(actualArea);
+							roiPart->SetPixelArea(area);
+							listParticleOut.push_back(roiPart);
+						}
+
+
 					}
 					
+					
 				  }
 
 			}