OTSImageProcess.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #include "OTSParticle.h"
  3. namespace OTSIMGPROC {
  4. using namespace OTSDATA;
  5. // Re-magnification
  6. const int nImage_Size = 3;
  7. //make matrix filled with 255
  8. const int nBlackColor = 255;
  9. //make binary processing parameter 128
  10. const int nProcessParam = 100;
  11. //picture size
  12. const int nPictureSize = 128;
  13. // added to filtered pixels
  14. const double delta = 0;
  15. using namespace std;
  16. class __declspec(dllexport) COTSImageProcess
  17. {
  18. public:
  19. COTSImageProcess();
  20. ~COTSImageProcess();
  21. // image process
  22. // morphology
  23. // LPBYTE source£º binary image pointer input£¬0, and 255
  24. // LPBYTE target: image pointer output
  25. // WORD rows: image height
  26. // WORD clumns: image width
  27. // WORD wDegree: 1~8, eight direction selction.
  28. // erode image with a structure of verticle 3 element
  29. static void BErodeVertical3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  30. // erode image with a left 45 degree structure of 3 element
  31. static void BErodeLeft45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  32. // erode image with a structure of horizontal 3 element
  33. static void BErodeHorizontal3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  34. // erode image with a right 45 degree structure of 3 element
  35. static void BErodeRight45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  36. // dilate image with a structure of verticle 3 element
  37. static void BDilateVertical3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  38. // dilate image with a left 45 degree structure of 3 element
  39. static void BDilateLeft45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  40. // dilate image with a structure of horizontal 3 element
  41. static void BDilateHorizontal3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  42. // dilate image with a right 45 degree structure of 3 element
  43. static void BDilateRight45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);
  44. // erode image with a structure of verticle 8 element
  45. static void BErode3(LPBYTE source, LPBYTE target, WORD wDegree, WORD rows, WORD columns);
  46. // dilate image with a structure of verticle 8 element
  47. static void BDilate3(LPBYTE source, LPBYTE target, WORD wDegree, WORD rows, WORD columns);
  48. // ReZoom the picture with re-magnification
  49. static BOOL ReZoom(CString InPutPath, CString OutPutPath);
  50. static BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize);
  51. };
  52. }