12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #pragma once
- #include "OTSParticle.h"
- #include "OTSImageProcessParam.h"
- #include <OTSFieldData.h>
- 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);
- BOOL SplitFieldImageIntoMatricsParticle(CBSEImgPtr fieldImg, double a_PixelSize, COTSFieldDataPtr outFldData);
-
- BOOL SplitRawImageIntoParticlesByWaterShed(CBSEImgPtr fieldImg, double a_PixelSize, COTSFieldDataPtr outFldData);
- CIntRangePtr CalBackground(CBSEImgPtr m_pBSEImg);
- std::vector<CIntRangePtr> CalcuGrayLevelRange(CBSEImgPtr m_pBSEImg);
- void GetSpecialGrayRangeImage(CBSEImgPtr a_pImgIn, CIntRange a_SpecialGrayRange, CBSEImgPtr a_pBinImgOut, long& foundedPixelNum);
- void BinaryProcess(CBSEImgPtr a_pImgIn, COTSImageProcessParamPtr a_pImageProcessParam, CBSEImgPtr a_pImgOut/*,long& foundedPixelNum*/);
- void RemoveBackGround(CBSEImgPtr a_pImgIn, CBSEImgPtr a_pBinImgOut);
- 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);
- BOOL GetParticlesFromBinaryImage(CBSEImgPtr m_pBSEImg, CDoubleRange a_diameterRange, double a_pixelSize, COTSParticleList& listParticleOut);
- void findPeakAndValley(const std::vector<int>& v, std::vector<int>& peakPositions, std::vector<int>& valleyPositions);
- //void findPeakAndValley(const vector<int>& v, vector<int>& peakPositions, vector<int>& valleyPositions, int minPeakDistance);
- std::vector<CIntRange> GetValidGreyLevelRanges(CBSEImgPtr pBSEImg);
- BOOL FindSeedsByGrayScale(CBSEImgPtr fieldImg, double a_PixelSize, std::vector<CPoint>& OutSeeds);
-
- void ImshowImage(CBSEImgPtr img);
- void ImshowChartData(CBSEImgPtr img);
-
- COTSImageProcessParamPtr m_imageProcessParam;
-
- };
- }
|