1 #include <opencv2/opencv.hpp>
 2 #include <iostream>
 3 using namespace cv;
 4 using namespace std;
 5 
 6 int main()
 7 {
 8 
 9     const char* inputImage = "33.jpg";
10     Mat img;
11 
12     img = imread(inputImage, 0);
13     if (img.empty())
14     {
15         cout << "Could not read input image file: " << inputImage << endl;
16         return -1;
17     }
18 
19     img = img >200;
20     imshow("Img", img);
21     waitKey(0);
22     return 0;
23 }

opencv 对RGB图像直接二值化                opencv 对RGB图像直接二值化

 

相关文章:

  • 2021-08-28
  • 2021-06-21
  • 2021-06-11
  • 2021-06-03
  • 2022-12-23
  • 2021-10-18
  • 2021-08-14
  • 2021-12-03
猜你喜欢
  • 2021-10-12
  • 2021-11-14
  • 2021-07-22
  • 2021-05-20
  • 2021-12-11
  • 2022-12-23
  • 2021-07-10
相关资源
相似解决方案