#pragma once #include "BSEImgClr.h" #include "OTSImgProcPrmClr.h" #include "OTSImageProcess.h" #include #include "../OTSLog/COTSUtilityDllFunExport.h" namespace OTSIMGPROC { using namespace OTSCOMMONCLR; public ref class ImageProForClr { public: bool GetFieldDataFromImage(CBSEImgClr^ bseImg, COTSImgProcPrmClr^ perameter, COTSFieldDataClr^ fieldData) { bool ret = COTSImageProcess::RemoveBGByFindContour(bseImg->GetBSEImgPtr(), perameter->GetImgPrcPrmPtr(), fieldData->GetOTSFieldDataPtr()); return ret; } bool CalcuParticleImagePropertes(COTSParticleClr^ particle, double a_PixelSize) { bool ret = COTSImageProcess::CalcuParticleImagePropertes(particle->GetOTSParticlePtr(), a_PixelSize); return ret; } BOOL MergeBigBoundaryParticles(System::Collections::Generic::List^ allFields, double pixelSize, int scanFieldSize, Size ResolutionSize, System::Collections::Generic::List^ mergedParts) { std::vector allFlds; COTSParticleList mergedParticles; for each (auto f in allFields) { allFlds.push_back(f->GetOTSFieldDataPtr()); } CSize CResolutionSize; CResolutionSize.cx = ResolutionSize.Width; CResolutionSize.cy = ResolutionSize.Height; bool ret = COTSImageProcess::MergeBigBoundaryParticles(allFlds, pixelSize, scanFieldSize, CResolutionSize, mergedParticles); for each (auto p in mergedParticles) { mergedParts->Add(gcnew COTSParticleClr(p)); } return ret; } void RemoveBackGround(CBSEImgClr^ a_pImgIn, COTSImgProcPrmClr^ a_pImageProcessParam, CBSEImgClr^ a_pImgOut, long% foundedPixelNum) { // the background pixel will be 0,and the other part will be 255. long num = 0; COTSImageProcess::RemoveBackGround(a_pImgIn->GetBSEImgPtr(), a_pImageProcessParam->GetImgPrcPrmPtr(), a_pImgOut->GetBSEImgPtr(), num); foundedPixelNum = num; return ; } }; }