VS 永久配置opencv

本文借鉴链接中博客的方法对VS2015永久配置了opencv  

http://blog.csdn.net/mwymi/article/details/51564169

可参照博客中的方法对release X64 进行配置 

且用如下代码测试

#include "stdafx.h"
#include <iostream>
#include <opencv2/highgui/highgui.hpp>


int main()
{
    const std::string window_name = "lena";
    const std::string input_pic = "lena.jpg";
    cv::Mat test_pic = cv::imread(input_pic);
    if (test_pic.empty())
    {
        std::cout << "no input image" << std::endl;
        return -1;
    }
    cv::namedWindow(window_name);
    cv::imshow(window_name, test_pic);
    cv::waitKey(0);
    return 0;
}

注意 imread 路径需为 “\”

若直接读取的话需要和 C++文件在同一文件夹内

原文地址:https://www.cnblogs.com/hustpet/p/7128452.html