OTSImageProcess.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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(COTSImageProcessParamPtr a_pImageProcessParam);
  11. ~COTSImageProcess();
  12. void UpdateImageProcessParam(COTSImageProcessParamPtr a_pImageProcessParam) { m_imageProcessParam = a_pImageProcessParam; };
  13. BOOL RemoveBGByCVconnectivities(CBSEImgPtr m_pBSEImg, double a_pixelSize, COTSFieldDataPtr m_pFieldData);
  14. BOOL GetParticlesBySpecialGrayRange(CBSEImgPtr m_pBSEImg, CIntRangePtr a_grayRange, CDoubleRangePtr a_diameterRange, double a_pixelSize, COTSFieldDataPtr m_pFieldData);
  15. BOOL SplitFieldImageIntoMatricsParticle(CBSEImgPtr fieldImg, double a_PixelSize, COTSFieldDataPtr outFldData);
  16. CIntRangePtr CalBackground(CBSEImgPtr m_pBSEImg);
  17. std::vector<CIntRangePtr> CalcuGrayLevelRange(CBSEImgPtr m_pBSEImg);
  18. void GetSpecialGrayRangeImage(CBSEImgPtr a_pImgIn, CIntRangePtr a_SpecialGrayRange, CBSEImgPtr a_pBinImgOut, long& foundedPixelNum);
  19. void RemoveBackGround(CBSEImgPtr a_pImgIn, COTSImageProcessParamPtr a_pImageProcessParam, CBSEImgPtr a_pImgOut/*,long& foundedPixelNum*/);
  20. BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize);
  21. BOOL MergeBigBoundaryParticles(COTSFieldDataList allFields, double pixelSize, int scanFieldSize, CSize ResolutionSize, COTSParticleList& mergedParts);
  22. private:
  23. BOOL GetParticles(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);
  24. BOOL GetOneParticleFromROI(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);
  25. BOOL GetSegmentList(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSSegmentsList& a_listSegments);
  26. BOOL GetFeatureList(COTSSegmentsList& a_listSegments, COTSFeatureList& a_listFeatures);
  27. BOOL ChangeFeaturelist(COTSFeatureList& a_listFeatures, COTSParticleList& a_listParticle);
  28. void ImshowImage(CBSEImgPtr img);
  29. void ImshowChartData(CBSEImgPtr img);
  30. COTSImageProcessParamPtr m_imageProcessParam;
  31. };
  32. }