Parcourir la source

fix a bug while calculating the dmax dmin property.

gsp il y a 3 ans
Parent
commit
e8762ba7ee
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      OTSCPP/OTSImagePro/OTSImageProcess.cpp

+ 3 - 3
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -1759,10 +1759,10 @@ namespace OTSIMGPROC
 		}		
 	//--------abstract the contour of the particle.
 		Mat cvcopyImg;
-		medianBlur(particleImage, cvcopyImg, 7);//smooth the edge
-		Mat cvContourImg = Mat::zeros(rect.Height() + nExpand_Size, rect.Width() + nExpand_Size, CV_8U);
+		medianBlur(particleImage, cvcopyImg, 5);//smooth the edge
+		//Mat cvContourImg = Mat::zeros(rect.Height() + nExpand_Size, rect.Width() + nExpand_Size, CV_8U);
 		vector<vector<Point>>contours;
-		Canny(cvcopyImg, cvcopyImg, 20, 20 * 2, 3);
+		//Canny(cvcopyImg, cvcopyImg, 20, 20 * 2, 3);
 		findContours(cvcopyImg, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
 		if (contours.size()==0)// the particle is too odd that openCV can't find a contour of it. Then we take the upright rect of the particle as it's minArea rect.
 		{