在此之前被标记为重复问题请阅读结束.谢谢你的期待.
我用home-brew设置了openCV.
这些是我使用的命令:
brew tap homebrew/science
brew install opencv
Run Code Online (Sandbox Code Playgroud)
我正在使用我在网上找到的以下简单文件来测试我的设置:
// Example showing how to read and write images
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main(int argc, char** argv)
{
// Load an image from file - change this based on your image name
Mat img = imread("my_image.jpg", CV_LOAD_IMAGE_UNCHANGED);
if(img.empty())
{
fprintf(stderr, "failed to load input image\n");
return -1;
}
// this is just to show, that you won't have to pre-alloc
// result-images with c++ any more.. …Run Code Online (Sandbox Code Playgroud)