#pragma once #include "OTSParticle.h" #include "OTSImageProcessParam.h" #include namespace OTSIMGPROC { using namespace OTSDATA; class __declspec(dllexport) COTSImageProcess { public: COTSImageProcess(COTSImageProcessParamPtr a_pImageProcessParam); ~COTSImageProcess(); void UpdateImageProcessParam(COTSImageProcessParamPtr a_pImageProcessParam) { m_imageProcessParam = a_pImageProcessParam; }; BOOL RemoveBGByCVconnectivities(CBSEImgPtr m_pBSEImg, double a_pixelSize, COTSFieldDataPtr m_pFieldData); BOOL GetParticlesBySpecialGrayRange(CBSEImgPtr m_pBSEImg, CIntRangePtr a_grayRange, CDoubleRangePtr a_diameterRange, double a_pixelSize, COTSFieldDataPtr m_pFieldData); CIntRangePtr CalBackground(CBSEImgPtr m_pBSEImg); std::vector CalcuGrayLevelRange(CBSEImgPtr m_pBSEImg); void GetSpecialGrayRangeImage(CBSEImgPtr a_pImgIn, CIntRangePtr a_SpecialGrayRange, CBSEImgPtr a_pBinImgOut, long& foundedPixelNum); void RemoveBackGround(CBSEImgPtr a_pImgIn, COTSImageProcessParamPtr a_pImageProcessParam, CBSEImgPtr a_pImgOut/*,long& foundedPixelNum*/); BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize); BOOL MergeBigBoundaryParticles(COTSFieldDataList allFields, double pixelSize, int scanFieldSize, CSize ResolutionSize, COTSParticleList& mergedParts); private: BOOL GetParticles(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles); BOOL GetOneParticleFromROI(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles); BOOL GetSegmentList(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSSegmentsList& a_listSegments); BOOL GetFeatureList(COTSSegmentsList& a_listSegments, COTSFeatureList& a_listFeatures); BOOL ChangeFeaturelist(COTSFeatureList& a_listFeatures, COTSParticleList& a_listParticle); void ImshowImage(CBSEImgPtr img); void ImshowChartData(CBSEImgPtr img); COTSImageProcessParamPtr m_imageProcessParam; }; }