BaseFunction.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include <opencv2/core/core.hpp>
  3. #include <opencv2/highgui/highgui.hpp>
  4. #include <opencv2/opencv.hpp>
  5. #include "OTSParticle.h"
  6. #include "OTSImageProcessParam.h"
  7. #include <OTSFieldData.h>
  8. using namespace cv;
  9. using namespace std;
  10. using namespace OTSDATA;
  11. float getDistance(Point pointO, Point pointA);
  12. float getDist_P2L(Point pointP, Point pointA, Point pointB);
  13. int Side(Point P1, Point P2, Point point);
  14. void FindInnerCircleInContour(vector<Point> contour, Point& center, int& radius);
  15. BOOL GetParticleAverageChord(std::vector<Point> listEdge, double a_PixelSize, double& dPartFTD);
  16. void linearSmooth5(WORD wordIn[], WORD wordOut[], int N);
  17. void BlurImage(CBSEImgPtr inImg);
  18. Mat GetMatDataFromBseImg(CBSEImgPtr inImg);
  19. CBSEImgPtr GetBSEImgFromMat(Mat inImg);
  20. void ImageStretchByHistogram(const Mat& src, Mat& dst);
  21. Mat AdjustContrastY(const Mat& img);
  22. void CVRemoveBG(const cv::Mat& img, cv::Mat& dst, int bgstart, int bgend/*, long& nNumParticle*/);
  23. void RemoveBG_old(const cv::Mat& img, cv::Mat& dst, int nBGStart, int nBGEnd, long& nNumParticle);
  24. /// <summary>
  25. ///
  26. /// </summary>
  27. /// <param name="img">原图</param>
  28. /// <param name="dst">目标图</param>
  29. /// <param name="black_thing">0 black ;1 bright;2 both black and bright </param>
  30. /// <param name="min_size">物体最小大小</param>
  31. /// <param name="min_gray">物体的灰度最大值</param>
  32. void AutoRemove_background_OTS(const cv::Mat& img, cv::Mat& dst, int black_thing=2, int min_size=1, int min_gray=30);