使OpenCV程序脱离本地OpenCV环境到其它电脑上运行

前言
一般在编写图像处理软件的时候会用到OpenCV,而且在OpenCV程序代码调试完成之后就需要拿到别的电脑上去演示。由于演示用的电脑没有与编写代码机器一样的OpenCV环境就会造成出现这样的错误 
 使OpenCV程序脱离本地OpenCV环境到其它电脑上运行_第1张图片
这样的原因就是本有将OpenCV需要的DLL集合和程序当中。一般来讲解决这个问题有两种解决方案 
1. 动态链接opencv,即把相应的dll拷贝到exe所在目录,然后一起拿到目标电脑上去运行 
2. 静态编译,是将相应dll中的函数打包进exe,然后直接拷贝exe到目标电脑上去运行 
在本文中就是用静态编译作为示例讲解

1. Debug配置
配置包含目录 


配置库目录 
 
这里一定要选择staticlib

配置代码生成 

使OpenCV程序脱离本地OpenCV环境到其它电脑上运行_第2张图片
配置链接器->输入

IlmImfd.lib
libjasperd.lib
libjpegd.lib
libpngd.lib
libtiffd.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_ml2413d.lib
opencv_nonfree2413d.lib
opencv_objdetect2413d.lib
opencv_ocl2413d.lib
opencv_photo2413d.lib
opencv_stitching2413d.lib
opencv_superres2413d.lib
opencv_ts2413d.lib
opencv_video2413d.lib
opencv_videostab2413d.lib
zlibd.lib

2. Release配置
这里由于包含目录、库目录都是和Debug版本一定的处理,这里就不重复阐述了,下面列出了他们不一样的地方。 
配置代码生成 
 使OpenCV程序脱离本地OpenCV环境到其它电脑上运行_第3张图片
配置链接器->输入

IlmImf.lib
libjasper.lib
libjpeg.lib
libpng.lib
libtiff.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_ml2413.lib
opencv_nonfree2413.lib
opencv_objdetect2413.lib
opencv_ocl2413.lib
opencv_photo2413.lib
opencv_stitching2413.lib
opencv_superres2413.lib
opencv_ts2413.lib
opencv_video2413.lib
opencv_videostab2413.lib
zlib.lib
————————————————
https://blog.csdn.net/m_buddy/article/details/78448347

你可能感兴趣的:(图像)