test.cpp 598 B

12345678910111213141516171819202122232425262728293031
  1. #include <iostream>
  2. #include "AutoWWWL.h"
  3. #include <opencv2/opencv.hpp>
  4. using namespace std;
  5. using namespace cv;
  6. using namespace ATWL;
  7. vector<String> globroot(String pattern)
  8. {
  9. vector<String> fn;
  10. glob(pattern, fn, false);
  11. return fn;
  12. }
  13. int main()
  14. {
  15. Mat img = imread(R"(Image_FinalImage.tif)",-1);
  16. Mat mask = imread(R"(mask.tif)", -1);
  17. int width = img.cols;
  18. int height = img.rows;
  19. int ww = 0;
  20. int wl = 0;
  21. int ret = AutoWWWL(img.ptr<ushort>(), mask.ptr<uchar>(), width, height, ww, wl);
  22. cout << "WW:" << ww << endl;
  23. cout << "WL:" << wl << endl;
  24. system("pause");
  25. return 0;
  26. }