#pragma once #include #include #include #include "OTSParticle.h" #include "OTSImageProcessParam.h" #include using namespace cv; using namespace std; using namespace OTSDATA; float getDistance(Point pointO, Point pointA); float getDist_P2L(Point pointP, Point pointA, Point pointB); int Side(Point P1, Point P2, Point point); void FindInnerCircleInContour(vector contour, Point& center, int& radius); BOOL GetParticleAverageChord(std::vector listEdge, double a_PixelSize, double& dPartFTD); void linearSmooth5(WORD wordIn[], WORD wordOut[], int N); void BlurImage(CBSEImgPtr inImg); Mat GetMatDataFromBseImg(CBSEImgPtr inImg); CBSEImgPtr GetBSEImgFromMat(Mat inImg); void ImageStretchByHistogram(const Mat& src, Mat& dst); Mat AdjustContrastY(const Mat& img); void CVRemoveBG(const cv::Mat& img, cv::Mat& dst, int bgstart, int bgend/*, long& nNumParticle*/); void RemoveBG_old(const cv::Mat& img, cv::Mat& dst, int nBGStart, int nBGEnd, long& nNumParticle); /// /// /// /// 原图 /// 目标图 /// 0 black ;1 bright;2 both black and bright /// 物体最小大小 /// 物体的灰度最大值 void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing=2, int min_size=1, int min_gray=30);