Use imread () function reads the correct posture six kinds of pictures

OpenCV practice road - use imread () function reads the correct posture six kinds of pictures

Where opencv in the argv [1] points to files

test

#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>\n");
        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;
}

 

Guess you like

Origin www.cnblogs.com/fcfc940503/p/11307484.html