OpenCV实践之路——使用imread()函数读取图片的六种正确姿势
opencv里的argv[1]指向的文件在哪里
测试
#include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" #include <iostream> #include <stdio.h> using namespace std; using namespace cv; /** @函数 main */ int main(int argc, char** argv) { Mat src_base, hsv_base; Mat src_test1, hsv_test1; Mat src_test2, hsv_test2; Mat hsv_half_down; /// 装载三张背景环境不同的图像 if (argc < 4) { printf("** Error. Usage: ./compareHist_Demo <image_settings0> <image_setting1> <image_settings2> "); return -1; } src_base = imread(argv[1], 1); src_test1 = imread(argv[2], 1); src_test2 = imread(argv[3], 1); namedWindow("原图"); moveWindow("原图", 60, 60); imshow("原图", src_base ); imshow("1原图", src_test1); imshow("2原图", src_test2); waitKey(0); return 0;
}