OTSImageProcess.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "OTSParticle.h"
  3. #include "OTSImageProcessParam.h"
  4. #include <OTSFieldData.h>
  5. namespace OTSIMGPROC {
  6. using namespace OTSDATA;
  7. class __declspec(dllexport) COTSImageProcess
  8. {
  9. public:
  10. COTSImageProcess();
  11. ~COTSImageProcess();
  12. // ReZoom the picture with re-magnification
  13. static BOOL ReZoom(CString InPutPath, CString OutPutPath);
  14. static BOOL RemoveBSEImageBG(CBSEImgPtr m_pBSEImg, COTSImageProcessParamPtr a_pImageProcessParam, COTSFieldDataPtr m_pFieldData);
  15. static BOOL RemoveBGByFindContour(CBSEImgPtr m_pBSEImg, COTSImageProcessParamPtr a_pImageProcessParam, COTSFieldDataPtr m_pFieldData);
  16. static BOOL RemoveBGByCVconnectivities(CBSEImgPtr m_pBSEImg, COTSImageProcessParamPtr a_pImageProcessParam, double a_pixelSize, COTSFieldDataPtr m_pFieldData);
  17. static BOOL GetParticlesBySpecialGrayRange(CBSEImgPtr m_pBSEImg, CIntRangePtr a_grayRange, CDoubleRangePtr a_diameterRange, double a_pixelSize, COTSFieldDataPtr m_pFieldData);
  18. static CIntRangePtr CalBackground(CBSEImgPtr m_pBSEImg);
  19. static std::vector<CIntRangePtr> CalcuGrayLevelRange(CBSEImgPtr m_pBSEImg);
  20. static void GetSpecialGrayRangeImage(CBSEImgPtr a_pImgIn, CIntRangePtr a_SpecialGrayRange, CBSEImgPtr a_pBinImgOut, long& foundedPixelNum);
  21. static void RemoveBackGround(CBSEImgPtr a_pImgIn, COTSImageProcessParamPtr a_pImageProcessParam, CBSEImgPtr a_pImgOut,long& foundedPixelNum);
  22. static BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize);
  23. static BOOL SplitRawParticleIntoMatricsParticle(COTSParticlePtr part, int imageWidth, int imageHeight, double a_PixelSize, double a_XrayStep );
  24. static BOOL SplitRawParticleIntoGreyScaleParticle(COTSParticlePtr part, CDoubleRangePtr ecdRange, double a_PixelSize, CBSEImgPtr fieldImg);
  25. static BOOL SplitRawParticleIntoWaterShedParticle(COTSParticlePtr part, double a_PixelSize, CBSEImgPtr fieldImg);
  26. static BOOL MergeBigBoundaryParticles(COTSFieldDataList allFields, double pixelSize, int scanFieldSize, CSize ResolutionSize, COTSParticleList& mergedParts);
  27. private:
  28. static BOOL GetParticles(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);
  29. static BOOL GetOneParticleFromROI(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);
  30. static BOOL GetSegmentList(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSSegmentsList& a_listSegments);
  31. static BOOL GetFeatureList(COTSSegmentsList& a_listSegments, COTSFeatureList& a_listFeatures);
  32. static BOOL ChangeFeaturelist(COTSFeatureList& a_listFeatures, COTSParticleList& a_listParticle);
  33. static void ImshowImage(CBSEImgPtr img);
  34. static void ImshowChartData(CBSEImgPtr img);
  35. };
  36. }