Programming Experience: CMake compile Opencv3.0&extra model of the various problems encountered ~

Source: Internet
Author: User

Previous time research an algorithm, the author provided the source code, very proud to announce that the source code has been integrated in 3.0, so I began the "bitter force" of the configuration of the trip, the results encountered n bugs, fortunately, some of their habits, this article said I encountered problems, and how to solve some problems.

1. Opencv_contrib-master This is an additional module for Opencv3.0, which provides new modules such as XFEATURES2D, which integrates the excellent algorithms proposed in the last two years, such as the latch features I studied earlier, and integrates in this extra module, but most of all, the code in this module supports MATLAB mixed programming, which provides mexfunction functions for each algorithm, which greatly shortens the time for mixed programming, and we only need to recompile mexfunction in MATLAB. You can call the algorithm directly. Here is the extra module directory structure, if you have a mood to look at Matlab/readme.txt, provide two ways to compile extra module, and teach you how to write Mexfunction. It's quite a mouthful, it's quite a story!
2. Using CMake to compile extra module according to the method suggested in Matlab/readme.txt we are not compiled the correct results, because there is a lot less content, or directly with the CMake to compile it! Download a Cmake2.8.12, download a opencv3.0beta version of the original code (note, be sure to beta version), configure Opencv3.0 the correct path, set the path on the additional path option:

This time we click on the Configure, the following prompt error will appear:

Select Win64 Compile and report the following error:

This is due to the machine-installed Cuda library mismatch, tick off the With_cuda option, the error disappears, but there are new errors: unable to write ....
Directly on the text experience, the following are various errors and corresponding solutions!

First: Only in the X64 platform release mode, the OpenCV3.0 can be compiled by MATLAB, otherwise prompted:

1. Matlab:

2. Mex:e:/matlab/r2013b/bin/mex.bat

3. Compiler/generator:not working (bindings won't be generated)

Second: Hint Opencv_core cannot find, because Cmakelist.txt file is destroyed, regenerate 3.0 and compile

Third: opencv3.0 provides additional modules, called Opencv_contrib-master, preferably placed in the Module modules 3.0, in the CMake, you need to specify additional properties Opencv_extra_module_ Path is the true path of the extra module.

IV: When using CMake, the With_cuda option needs to be canceled.

V: VS2010 Compile the time, Mr. Cheng All_build, in the generation Inatall. The latter function is to summarize all modules (including additional modules, MATLAB module) include files together, so when configuring VS2010, you should also add the Include directory under Inatall, not the build level.

Sixth: A few Python files are missing from the newly released 3.0 and need to be re-added, missing Ippicv_windows_20141027.zip, and re-downloaded.

Seventh: Sometimes there will be no mex.bat of the situation, it seems that cmake is not necessarily reliable.


Eighth: Whether to use VS2010 or VS2013, compile the additional modules when the error,:
3. Compiling extra Mexfunction problems encountered in module I compile the object is the XFEATURES2D project LATCHBridge.cpp file, before compiling the OpenCV3.0 need to add relevant information to the file, modify part of the contents of the Red box:
This makes it possible to compile the file, but there may also be an issue where the additional modules are incompatible with the Std.
4. Conclusion in a word, OpenCV3.0 's additional modules are still immature, mixed programming cannot be compiled through!!


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Programming Experience: CMake compile Opencv3.0&extra model of the various problems encountered ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.