|
@@ -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.
|
|
|
{
|