| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 | #pragma once#include "OTSParticle.h"#include "OTSImageProcessParam.h"#include <OTSFieldData.h>namespace OTSIMGPROC {	using namespace OTSDATA;		// Re-magnification	const int nImage_Size = 3;	//make matrix filled with 255 	const int nBlackColor = 255;	//make binary processing parameter 128 	const int nProcessParam = 100;	//picture size	const int nPictureSize = 128;		// added to filtered pixels	const double delta = 0;	using namespace std;	class __declspec(dllexport) COTSImageProcess	{	public:		COTSImageProcess();		~COTSImageProcess();		// image process		// morphology		// LPBYTE source£º binary image pointer input£¬0, and 255		// LPBYTE target:  image pointer output		// WORD rows: image height		// WORD clumns: image width		// WORD wDegree: 1~8, eight direction selction.		// erode image with a structure of verticle 3 element		static void BErodeVertical3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// erode image with a left 45 degree structure of 3 element		static void BErodeLeft45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// erode image with a structure of horizontal 3 element		static void BErodeHorizontal3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// erode image with a right 45 degree structure of 3 element		static void BErodeRight45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// dilate image with a structure of verticle 3 element		static void BDilateVertical3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// dilate image with a left 45 degree structure of 3 element		static void BDilateLeft45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// dilate image with a structure of horizontal 3 element		static void BDilateHorizontal3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// dilate image with a right 45 degree structure of 3 element		static void BDilateRight45Degree3(LPBYTE source, LPBYTE target, WORD rows, WORD columns);		// erode image with a structure of verticle 8 element		static void BErode3(LPBYTE source, LPBYTE target, WORD wDegree, WORD rows, WORD columns);		// dilate image with a structure of verticle 8 element		static void BDilate3(LPBYTE source, LPBYTE target, WORD wDegree, WORD rows, WORD columns);		// ReZoom the picture with re-magnification		static BOOL ReZoom(CString InPutPath, CString OutPutPath);		static BOOL RemoveBSEImageBG(CBSEImgPtr m_pBSEImg, COTSImageProcessParamPtr a_pImageProcessParam, COTSFieldDataPtr m_pFieldData);		static BOOL RemoveBGByFindContour(CBSEImgPtr m_pBSEImg, COTSImageProcessParamPtr a_pImageProcessParam, COTSFieldDataPtr m_pFieldData);		static CIntRangePtr CalBackground(CBSEImgPtr m_pBSEImg);		static void RemoveBackGround(CBSEImgPtr a_pImgIn, COTSImageProcessParamPtr a_pImageProcessParam, CBSEImgPtr a_pImgOut,long& foundedPixelNum);		static BOOL CalcuParticleImagePropertes(COTSParticlePtr part, double a_PixelSize);		static BOOL MergeBigBoundaryParticles(COTSFieldDataList allFields, double pixelSize, int scanFieldSize, CSize ResolutionSize, COTSParticleList& mergedParts);	protected:		static BOOL GetParticles(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSParticleList& a_listParticles);		static BOOL GetSegmentList(long left, long top, long a_nWidth, long a_nHeight, const BYTE* a_pPixel, COTSSegmentsList& a_listSegments);		static BOOL GetFeatureList(COTSSegmentsList& a_listSegments, COTSFeatureList& a_listFeatures);		static BOOL ChangeFeaturelist(COTSFeatureList& a_listFeatures, COTSParticleList& a_listParticle);					};}
 |