当前位置:网站首页>OpenCV3.0 is compatible with VS2010 and VS2013
OpenCV3.0 is compatible with VS2010 and VS2013
2022-08-05 06:10:00 【cql_cqu】
Reprint: https://blog.csdn.net/fioletfly/article/details/47280727?utm_source=blogxgwz0
1. Basic configuration of OpenCV3.0
I have been tormented by OpeCV3.0 these days, mainlyIt is due to the current Visual Studio switching between 2010 and 2013.So sometimes, although I configure it well, there are always various errors in order to make these two versions run.It's really confusing. I won't talk about the configuration here. Baidu has a lot of them, and the configuration of the 2.x version is almost the same.
Configuration on VS2013:
Include Library Directories



The above configuration is basically ok.
VS2010 configuration:



2. Problems arise
To give a simple example to illustrate the problem, findFunction of contours: findcontours.
void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierar-
chy, int mode, int method, Point offset=Point())
void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierar-
chy, int mode, int method, Point offset=Point())
I thought that according to the basic configuration, it can run on VS2010 and VS2013 at the same time, because it is configured in the project propertiesOK, see the picture above.Running the same piece of code and processing the same image, the next problem comes.Here I want to tell you that I used VS2010 first, so openCV3.0 was the first to be applied to VS2010, so it ran very well in VS2010, but there were various strange problems when porting to VS2013.
For detailed questions, see the comparison chart:

The contour points found in VS2010 are correct

The contour points found in VS2013 are about to crash,so big
So here is a direct error.
3. Finding the problem
After thinking about it for a long time, I don't know where the error is, and I always suspect that my image hasThe problem, but I didn't see anything famous when I checked it.Here, I carefully debugged and checked the code, and finally got a prompt
, it is really a great VS2013 attachment, otherwise I really can't see it.

This is a few meanings, I didn't joinhave you come in?Oh wait, it doesn't seem to be, because the dependent library only adds these names, and does not add specific addresses.In the dependent library, only
only requires the reference of the lib file. I thought that it would be no problem to directly reference the dll file.But it still seems to have no effect, that is to say, the dll will not be called here, and this dll will not be called from the dependent library.I checked the Internet later,
The things in the bin directory of your opencv configuration are under the directory below
C:\Windows\System32\opencv_world300d.dll
4. Problem Solving
According to the above tips, we only need to copy several folders of the ...\opencv\build\x86\vc12\bin file to C:\Windows\System32.But half of the problem is solved, then VS2010 can't be used again, so this is a toss.It seems that it will be used as much as possible to run on a platform in the future.
5. Tail
Here I need to remind everyone: According to my experiment, the latest version of openCV3.0 seems to beVS2010 is not supported, because there are only vc11 and vc12 in the build file. That is to say, only VS2012 and VS2013 are supported. It seems to give up VS2010. I wonder if there are any experts who can solve this problem.Or use vc11 or vc12 directly in VS2010, this has not been tried, you can try it, it seems that compiling with CMake can be used in VS2010, VS2008, VS2005, etc.
Currently I am using the openCV3.0 Beta version which supports vs2010, vs2012, vs2013.You can try this version, the beta version is relatively stable.
I hope this can help everyone, these tangled people.
边栏推荐
猜你喜欢
随机推荐
D45_摄像机组件Camera
【Day1】VMware软件安装
新一代解析技术——云解析
spark源码-任务提交流程之-5-CoarseGrainedExecutorBackend
VRRP原理及命令
Why can't I add a new hard disk to scan?How to solve?
Wireshark抓包及常用过滤方法
交换机原理
spark算子-textFile算子
Blender软件介绍与使用心得
Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system
每日一题-三数之和-0716(2)
Lua,ILRuntime, HybridCLR(wolong)/huatuo热更对比分析
[Day6] File system permission management, file special permissions, hidden attributes
Getting Started Doc 06 Adding files to a stream
Getting Started Documentation 10 Resource Mapping
网站ICP备案是什么呢?
I/O性能与可靠性
每日一题-正则表达式匹配-0715
单臂路由与三成交换机









