#pragma once #include "OTSParticle.h" namespace OTSIMGPROC { using namespace OTSDATA; // Re-magnification const int nImage_Size = 3; //make matrix filled with 255 const int nBlackColor = 255; //make binary processing parameter 128 const int nProcessParam = 100; //picture size const int nPictureSize = 128; // added to filtered pixels const double delta = 0; using namespace std; class __declspec(dllexport) COTSImageProcess { public: COTSImageProcess(); ~COTSImageProcess(); // image process // morphology // LPBYTE source£º binary image pointer input£¬0, and 255 // LPBYTE target: image pointer output // WORD rows: image height // WORD clumns: image width // WORD wDegree: 1~8, eight direction selction. // erode image with a structure of verticle 3 element static void BErodeVertical3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // erode image with a left 45 degree structure of 3 element static void BErodeLeft45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // erode image with a structure of horizontal 3 element static void BErodeHorizontal3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // erode image with a right 45 degree structure of 3 element static void BErodeRight45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // dilate image with a structure of verticle 3 element static void BDilateVertical3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // dilate image with a left 45 degree structure of 3 element static void BDilateLeft45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // dilate image with a structure of horizontal 3 element static void BDilateHorizontal3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // dilate image with a right 45 degree structure of 3 element static void BDilateRight45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns); // erode image with a structure of verticle 8 element static void BErode3(LPBYTE source, LPBYTE target, WORD wDegree, WORD rows, WORD columns); // dilate image with a structure of verticle 8 element static void BDilate3(LPBYTE source, LPBYTE target, WORD wDegree, WORD rows, WORD columns); // ReZoom the picture with re-magnification static BOOL ReZoom(CString InPutPath, CString OutPutPath); static BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize); }; }