opencv 2.4.13 支持win10么
1个回答
展开全部
官网下载最新版的opencv,在Windows10 系统下的vs2012对opencv的环境配置。
工具/原料
vs2012
opencv2.4.13
方法/步骤
下载最新版本openCV,官方连接http://opencv.org/,我用的是openCV-2.4.4,下载完成点击exe文件,运行软件,将openCV库解压到你所要安装的目录中,注意目录不要包含中文。我直接解压D:\。点击Extract开始解压。
配置电脑属性,右键点击我的电脑,选择属性,点击高级设置,选择环境变量,在环境变量对话框中找到用户变量和系统变量分别新增opencv和path的用户变量。路径如下图。以及path的环境变量。
配置好系统的环境变量,打开vs,新建一个基于控制台win32的空项目。
我的项目名称是myfirstopencv.然后找到Property Manager.在Debug|Win32添加OpenCv_Debug_Setting.配置完include Directories和Library Directories
。然后点击Linker->Input->Additional dependencies.将下面这19个opencv库加到这里
opencv_ml2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_core2413d.lib
opencv_features2d2413d.lib
opencv_flann2413d.lib
opencv_gpu2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
opencv_legacy2413d.lib
opencv_objdetect2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_nonfree2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_videostab2413d.lib
在Release|Win32添加OpenCv_Release_Setting.配置include Directories和Library Directories与Debug|Win32的配置相同。
然后点击Linker->Input->Additional dependencies的配置与上一步的配置唯一不同的是去掉所有的d.
opencv_ml2413.lib
opencv_calib3d2413.lib
opencv_contrib2413.lib
opencv_core2413.lib
opencv_features2d2413.lib
opencv_flann2413.lib
opencv_gpu2413.lib
opencv_highgui2413.lib
opencv_imgproc2413.lib
opencv_legacy2413.lib
opencv_objdetect2413.lib
opencv_ts2413.lib
opencv_video2413.lib
opencv_nonfree2413.lib
opencv_ocl2413.lib
opencv_photo2413.lib
opencv_stitching2413.lib
opencv_superres2413.lib
opencv_videostab2413.lib
到此所有配置完成。然后保存所增加的属性设置
我们用一个简单的程序来检查刚刚的配置是否成功。
#include<iostream>
#include<core/core.hpp>
#include<highgui/highgui.hpp>
using namespace cv;
using namespace std;
int main()
{
//读入图片,注意图片路径
Mat image=imread("D:\\lena.jpg");
//图片读入成功与否判定
if(!image.data)
{
cout<<"you idiot!where did you hide lena!"<<endl;
//等待按键
system("pause");
return -1;
}
//创建一个名字为“Lena”的图像显示窗口,(不提前声明也可以)
namedWindow("Lena",1);
//显示图像
imshow("Lena",image);
//等待按键
waitKey();
return 0;
}
程序运行结果如图所示。
要想永久配置opencv。每次 建立项目将OpenCv_Debug_Setting,OpenCv_Release_Setting添加到Property Manager的Debug|Win32和Release|Win32。
工具/原料
vs2012
opencv2.4.13
方法/步骤
下载最新版本openCV,官方连接http://opencv.org/,我用的是openCV-2.4.4,下载完成点击exe文件,运行软件,将openCV库解压到你所要安装的目录中,注意目录不要包含中文。我直接解压D:\。点击Extract开始解压。
配置电脑属性,右键点击我的电脑,选择属性,点击高级设置,选择环境变量,在环境变量对话框中找到用户变量和系统变量分别新增opencv和path的用户变量。路径如下图。以及path的环境变量。
配置好系统的环境变量,打开vs,新建一个基于控制台win32的空项目。
我的项目名称是myfirstopencv.然后找到Property Manager.在Debug|Win32添加OpenCv_Debug_Setting.配置完include Directories和Library Directories
。然后点击Linker->Input->Additional dependencies.将下面这19个opencv库加到这里
opencv_ml2413d.lib
opencv_calib3d2413d.lib
opencv_contrib2413d.lib
opencv_core2413d.lib
opencv_features2d2413d.lib
opencv_flann2413d.lib
opencv_gpu2413d.lib
opencv_highgui2413d.lib
opencv_imgproc2413d.lib
opencv_legacy2413d.lib
opencv_objdetect2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_nonfree2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_videostab2413d.lib
在Release|Win32添加OpenCv_Release_Setting.配置include Directories和Library Directories与Debug|Win32的配置相同。
然后点击Linker->Input->Additional dependencies的配置与上一步的配置唯一不同的是去掉所有的d.
opencv_ml2413.lib
opencv_calib3d2413.lib
opencv_contrib2413.lib
opencv_core2413.lib
opencv_features2d2413.lib
opencv_flann2413.lib
opencv_gpu2413.lib
opencv_highgui2413.lib
opencv_imgproc2413.lib
opencv_legacy2413.lib
opencv_objdetect2413.lib
opencv_ts2413.lib
opencv_video2413.lib
opencv_nonfree2413.lib
opencv_ocl2413.lib
opencv_photo2413.lib
opencv_stitching2413.lib
opencv_superres2413.lib
opencv_videostab2413.lib
到此所有配置完成。然后保存所增加的属性设置
我们用一个简单的程序来检查刚刚的配置是否成功。
#include<iostream>
#include<core/core.hpp>
#include<highgui/highgui.hpp>
using namespace cv;
using namespace std;
int main()
{
//读入图片,注意图片路径
Mat image=imread("D:\\lena.jpg");
//图片读入成功与否判定
if(!image.data)
{
cout<<"you idiot!where did you hide lena!"<<endl;
//等待按键
system("pause");
return -1;
}
//创建一个名字为“Lena”的图像显示窗口,(不提前声明也可以)
namedWindow("Lena",1);
//显示图像
imshow("Lena",image);
//等待按键
waitKey();
return 0;
}
程序运行结果如图所示。
要想永久配置opencv。每次 建立项目将OpenCv_Debug_Setting,OpenCv_Release_Setting添加到Property Manager的Debug|Win32和Release|Win32。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询