OTSImageProcess.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. BOOL SplitRawImageIntoParticlesByWaterShed(CBSEImgPtr fieldImg, double a_PixelSize, COTSFieldDataPtr outFldData);
  17. CIntRangePtr CalBackground(CBSEImgPtr m_pBSEImg);
  18. std::vector<CIntRangePtr> CalcuGrayLevelRange(CBSEImgPtr m_pBSEImg);
  19. void GetSpecialGrayRangeImage(CBSEImgPtr a_pImgIn, CIntRange a_SpecialGrayRange, CBSEImgPtr a_pBinImgOut, long& foundedPixelNum);
  20. void BinaryProcess(CBSEImgPtr a_pImgIn, COTSImageProcessParamPtr a_pImageProcessParam, CBSEImgPtr a_pImgOut/*,long& foundedPixelNum*/);
  21. void RemoveBackGround(CBSEImgPtr a_pImgIn, CBSEImgPtr a_pBinImgOut);
  22. BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize);
  23. BOOL MergeBigBoundaryParticles(COTSFieldDataList allFields, double pixelSize, int scanFieldSize, CSize ResolutionSize, COTSParticleList& mergedParts);
  24. private:
  25. BOOL GetParticles(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);
  26. BOOL GetOneParticleFromROI(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);
  27. BOOL GetSegmentList(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSSegmentsList& a_listSegments);
  28. BOOL GetFeatureList(COTSSegmentsList& a_listSegments, COTSFeatureList& a_listFeatures);
  29. BOOL ChangeFeaturelist(COTSFeatureList& a_listFeatures, COTSParticleList& a_listParticle);
  30. BOOL GetParticlesFromBinaryImage(CBSEImgPtr m_pBSEImg, CDoubleRange a_diameterRange, double a_pixelSize, COTSParticleList& listParticleOut);
  31. void findPeakAndValley(const std::vector<int>& v, std::vector<int>& peakPositions, std::vector<int>& valleyPositions);
  32. //void findPeakAndValley(const vector<int>& v, vector<int>& peakPositions, vector<int>& valleyPositions, int minPeakDistance);
  33. std::vector<CIntRange> GetValidGreyLevelRanges(CBSEImgPtr pBSEImg);
  34. BOOL FindSeedsByGrayScale(CBSEImgPtr fieldImg, double a_PixelSize, std::vector<CPoint>& OutSeeds);
  35. void ImshowImage(CBSEImgPtr img);
  36. void ImshowChartData(CBSEImgPtr img);
  37. COTSImageProcessParamPtr m_imageProcessParam;
  38. };
  39. }