首页 > 代码库 > opencv 源码编译
opencv 源码编译
opencv代码版本:opencv-3.2.0-vc14.exe
编译环境VS2010
参考
http://blog.csdn.net/jarvischu/article/details/8468894
注意事项:CMake点击Configure配置完成之后,BUILD_CUDA_STUBS取消生成,详细资料可以搜索cuda,否则编译的时候出现没有找打cuda_runtime.h文件的错误
CMake生成动态库之后,所有的include和lib,dll都在install文件下,
不同版本生成的lib和dll名称中数字不一样,将下面拷贝过去不一定适合构建的工程
opencv_calib3d320d.lib
opencv_core320d.lib
opencv_features2d320d.lib
opencv_flann320d.lib
opencv_highgui320d.lib
opencv_imgcodecs320d.lib
opencv_imgproc320d.lib
opencv_ml320d.lib
opencv_photo320d.lib
opencv_shape320d.lib
opencv_stitching320d.lib
opencv_superres320d.lib
opencv_video320d.lib
opencv_videoio320d.lib
opencv_videostab320d.lib
创建样例程序的时候将dll拷贝到调试目录,而不是放在系统目录
配置属性
常规
输出目录:$(ProjectDir)\Debug
将所有的dll拷贝到当前的目录即可调试
模块计算机类型“X64”与目标计算机类型“X86”冲突问题的几点补充
编译平台是64位,打开配置管理器,在项目的属性中,选择X64,没有的新建一个
参考:
http://blog.csdn.net/ac273317472/article/details/51391951
#include "opencv2/highgui.hpp"
using namespace cv;
int main(int argc, const char** argv)
{
const char* imagename = "D:/Documents/Pictures/142802955.jpg";
cv::Mat img = cv::imread(imagename);
if(img.empty())
{ fprintf(stderr, "Can not load image %s\n", imagename);
return -1;
}
if( !img.data )
return -1;
cv::namedWindow("image", CV_WINDOW_AUTOSIZE);
cv::imshow("image", img);
cv::waitKey();
return 0;
}
http://www.opencv.org.cn/opencvdoc/2.3.2/html/doc/tutorials/imgproc/histograms/histogram_equalization/histog
ram_equalization.html
opencv 源码编译