Browse Source

change the BlurImage mode to GaussianBlur

gsp 2 months ago
parent
commit
de15ed566f
2 changed files with 4 additions and 25 deletions
  1. 2 2
      OTSCPP/OTSImagePro/BaseFunction.cpp
  2. 2 23
      OTSCPP/OTSImagePro/OTSImageProcess.cpp

+ 2 - 2
OTSCPP/OTSImagePro/BaseFunction.cpp

@@ -164,9 +164,9 @@ void BlurImage(CBSEImgPtr inImg)
 	BYTE* pPixel = inImg->GetImageDataPointer();
 	Mat cvcopyImg = Mat(rows, cols, CV_8UC1, pPixel);
 	//Mat blurImg;
-	medianBlur(cvcopyImg, cvcopyImg, 5);//get rid of the noise point.
+	//medianBlur(cvcopyImg, cvcopyImg, 5);//get rid of the noise point.
 	//cv::bilateralFilter
-	//cv::GaussianBlur(cvcopyImg, cvcopyImg, Size(5, 5), 2);
+	cv::GaussianBlur(cvcopyImg, cvcopyImg, Size(5, 5), 2);
 	//inImg->SetImageData(cvcopyImg.data, width, height);
 	/*outImg = inImg;*/
 

+ 2 - 23
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -457,28 +457,7 @@ namespace OTSIMGPROC
 
 		std::vector<CPoint> matrixPs;
 		GetMatrixPointsFromRect(rect, xrayStep, matrixPs);
-		//int colnum = ceil((double)rect.Width() / xrayStep + 0.5);
-		//if (colnum % 2 == 0) colnum += 1;//let the number to be an odd number.Then we can make the middle point in the center of the particle exactly.
-		//int rownum = ceil((double)rect.Height() / xrayStep + 0.5);
-		//if (rownum % 2 == 0) rownum += 1;
-
-		//CPoint theFirst = CPoint(rect.left - (colnum * xrayStep - rect.Width()) / 2 + xrayStep / 2, rect.top - (rownum * xrayStep - rect.Height()) / 2 + xrayStep / 2);
-
-
-		//for (int i = 0; i < rownum; i++)
-		//{
-		//	for (int j = 0; j < colnum; j++)
-		//	{
-		//		double x = (double)theFirst.x + (double)j * xrayStep;
-		//		double y = (double)theFirst.y + (double)i * xrayStep;
-		//		CPoint thePoint = CPoint(x, y);
-
-
-		//		matrixPs.push_back(thePoint);
-
-
-		//	}
-		//}		
+			
 		int i = 0;
 		COTSParticleList matrixParts;
 		for (auto point : matrixPs)
@@ -561,7 +540,7 @@ namespace OTSIMGPROC
 		FindSeedsByGrayScale(noBgImg, a_PixelSize, seeds);
 		std::vector<CPoint> matrixseeds;
 		matrixseeds.clear();
-		if (seeds.size() <20)
+		if (seeds.size() <50)
 		{
 			auto step = areaRng.GetStart() * 4;
 			GetMatrixPointsFromRect(fieldImg->GetImageRect(), step / a_PixelSize, matrixseeds);