Browse Source

add erode and dilate function when finding particles.

gsp 3 years ago
parent
commit
ea42d1448b
1 changed files with 4 additions and 4 deletions
  1. 4 4
      OTSCPP/OTSImagePro/OTSImageProcess.cpp

+ 4 - 4
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -1791,8 +1791,8 @@ namespace OTSIMGPROC
 					pPixel[i] = 0;
 				}
 			}
-			/*COTSImageProcess::BErode3(pPixel, pTempImg, 3, nHeightImg, nWidthImg);
-			COTSImageProcess::BDilate3(pTempImg, pPixel, 3, nHeightImg, nWidthImg);*/
+			COTSImageProcess::BErode3(pPixel, pTempImg, 3, nHeightImg, nWidthImg);
+			COTSImageProcess::BDilate3(pTempImg, pPixel, 3, nHeightImg, nWidthImg);
 			//Mat cvcopyImg = Mat(nHeightImg, nWidthImg, CV_8UC1, pPixel);// use the medianblur method to achieve the same effect as open morphology(errod and dialate).
 			//medianBlur(cvcopyImg, cvcopyImg, 5);
 			//pPixel = cvcopyImg.data;
@@ -1855,8 +1855,8 @@ namespace OTSIMGPROC
 			default:
 				break;
 			}
-			/*COTSImageProcess::BErode3(pPixel, pTempImg, 3, nHeightImg, nWidthImg);
-			COTSImageProcess::BDilate3(pTempImg, pPixel, 3, nHeightImg, nWidthImg);*/
+			COTSImageProcess::BErode3(pPixel, pTempImg, 3, nHeightImg, nWidthImg);
+			COTSImageProcess::BDilate3(pTempImg, pPixel, 3, nHeightImg, nWidthImg);
 			/*Mat cvcopyImg = Mat(nHeightImg, nWidthImg, CV_8UC1, pPixel);
 			medianBlur(cvcopyImg, cvcopyImg, 5);
 			pPixel = cvcopyImg.data;*/