- Homebrew安装OpenCV:brew install opencv
- Clion中新建项目testOpenCV,关键是CmakeLists.txt中设置
- main.cpp测试代码:
- 测试代码:
#include #include using namespace cv; int main() { std::string image_path = "path/to/image"; Mat img = imread(image_path, IMREAD_COLOR); imshow("Display window", img); int k = waitKey(0); // Wait for a keystroke in the window return 0; }
09-20
216
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-05
2516
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-24
448
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)