How can I add contrib modules to opencv3.1.0? (Windows 10, Visual Studio 2015) - opencv

I'm doing a simple AR-Project for school and have to use opencv for it. I found it quite tricky to install in visual studio but now it's working fine. Now I want to use the aruco module, I tried this tutorial, but after building the bin folder is missing and the includes in my code don't work anymore... Is there a (preferably easy) way of adding the contrib modules into my (saved and functioning) opencv-folder?
EDIT: I successfully build opencv with modules (using cmake gui and vs14) and the includes for my old code are working fine, but when I try to use the aruco module I get these: Error Message
The files are all where they are supposed to be and I set all paths and additional dependencies as well as the include directory...
Any Idea what's wrong?

OK - I did it.
I disabled all other modules in cmake and now the includes for aruco work.
But I can't really explain myself why the other (unused) modules corrupt the aruco libraries?

Related

OpenCV 3.1.0 - LNK1104 with opencv_world310d.lib (Visual Studio Express 2013)

iam actually trying to get opencv running on my Computer. I allready configured the environment variables on Windows and added the Path for the includes and the libraries in a propertiesheet.
Now when i want to add additional dependencies i watched into my directory (opencv\build\x64\vs12\lib)and there are only two files. opencv_world310.lib and opencv_world310d.lib. So they are on my HDD.
I think these are the files i have to add?
I did this and then i got the error LNK1104 could not open "opencv_world310d.lib. Same with opencv_world310.lib.
Iam trying to build a example-code from opencv so there should be everything fine with it. I saw some Tutorials they did not have any issue. But they used OpenCv3.0
Is there any workaround?
kind regards
Yes. By default, opencv_world310.lib is the only file you should link with.
Or if you're building with Debug configuration, you should use opencv_world310d.lib instead.
Since the error code is LNK1104, I believe your additional library path is something wrong.
And then please check you are building x64 code not win32 code.

Three ways to configure OpenCV with Visual Studio?

I've been trying to configure OpenCV 2.4.6 C++ VS for many weeks with a pre-built library. I'm getting nowhere. It seems there are three ways:
Manually by changing the environmental variables.
Nuget. Apparently, out of my league.
Cmake, again out of my league.
I've been down many paths with the manual method. Tutorials, etc. They just don't cut it. Something is just different that stops me. For example, a moment ago, I noticed in the "close" list above, "OpenCV and VS config " looked hopeful. Someone there said to see his web site. It was in Spanish. Often the IDEs are just not the same.
Comments?
Read this page. This is a sample CMakeLists.txt file:
cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
project (SO_example)
FIND_PACKAGE (OpenCV REQUIRED)
file (GLOB SOURCES "*.h" "*.cpp")
add_executable (so_example ${SOURCES})
target_link_libraries (so_example ${OpenCV_LIBS})
Put this along with your header and source files and then build your project files using the CMake GUI. That should do it.
HTH

How to setup OpenNI 2.0 with OpenCV for a Kinect project?

I am working on my final year project. I need to work with Kinect to detect hand movements. I have tried a few ways and got some results, however, none was enough to meet the needs of the project. I saw this video long ago, and just got to know that they open sourced it recently. So I gave it a try.
My problem now is how to set things up.
The above awesome project uses OpenNI with Kinect. I tried to follow OpenCV tutorials to build it from source code, to let OpenCV work with OpenNI.
Problems:
It says "For the OpenNI Framework you need to install both the development build and the PrimeSensor Module." but as I followed the links some of them were dead. Seems like OpenNI 2.0 doesn't use PrimeSensor any longer.
It also says that in Cmake folders, one is OpenCV/Src, the other is /build. But the OpenCV I downloaded doesn't have anything as Src folder.
Still I used the whole folder as Src, and built it to a build folder and checked WITH OPENNI. I used the Include and Lib folder in OpenNI2 I downloaded, but when I built the OpenCV solution (already generated from CMake) all builds failed.
Also, while generating with Cmake, even if my future OpenCV solution had been successfully built (which wasn't the case), Cmake would have kept telling me how PrimeSense was not available, which made me feel so insecure. :(
I am a bit confused about 32- and 64-bit. The above project I want to follow says it works on 64-bit. But I use MS C++ Express, all projects are 32-bit. So which PrimeSense drivers (given in OpenNI2) should I use?
Could anyone please tell me how to set all these things (OpenNI2.0, OpenCV 2.4.3, PrimeSense) together so I can work with Kinect?
A while back I wrote two tutorials on 1) how to set up OpenNI 1.5 with NITE 2) How to compile OpenCV with OpenNI support.
These can be found here and here
I know this is not what you asked for, but the process of compiling OpenCV with OpenNI 2.0 should be similar and might help you understand where you are going wrong.
I will try to write a newer tutorial, however since I currently do not have access to a sensor, I might not be able to test if it works out in the end.
EDIT:
I have written some code to access Kinect data streams in OpenCV Mat format using OpenNI 2.x. The code github repo can be found here. Detailed guidance on how to set everything up can be found here.
OpenNI 2.x is much advanced than the previous versions. You don't need to install primesense sensorkinect driver. You can use OpenNI 2.x along with the Microsoft Kinect SDK 1.x.
Install both 64 and 32-bit OpenNI 2.x if you have Windows 7 x64 otherwise only 32-bit. Configure it with Visual Studio 2010 or 12. You can follow this video:
http://www.youtube.com/watch?v=ACqPsV0R4to
Then configure OpenCV for visual Studio 2010 or 12. You can follow this link:
http://4someonehelp.blogspot.in/2013/04/install-opencv-245-using-visual-studio.html
Thanks

OpenCV 2.4.2 library files using CMake and MinGW - Target IDE CodeBlocks

I have been having this issue with OpenCV 2.4.2 that it doesn't really get installed properly with Microsoft VS 2010 Express; It is always missing a dll file or two doesn't matter what I follow by Googling. Also, Visual Studio 2010 Express is only valid for a few days, so it is acceptable that VS will not behave well with OpenCV at that point. However, when I changed my IDE to CodeBlocks, it is even stranger because now I have missing dll files and also "Missing Entry Point" error because of a duplicate .dll file. I found this guide and followed what it told me to do:
http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
But it still doesn't work!! What I am after is a complete and definitive solution to integrating OpenCV (preferrably 2.4.2 version) on a Windows 7 64-bit machine. I have been turning Stackoverflow inside out but no solution is working for me. The problems are
WHEN USING VISUAL STUDIO:
Missing dll file (e.g. libopencv_core242d.dll, etc.)
WHEN USING CODE BLOCKS:
First it complains that libstdc++-6.dll is missing. When I download it to my C:\MinGW\libexec\gcc\mingw32\4.7.0 folder, it stops complaining about this. But now it complains that there is any entry point problem and some other .dll file is missing!!!
If someone has managed to make it work by hook or crook, I will be more than happy to know what it is, IN DEPTH. I don't believe that such an important library can be so stupidly distributed so that developers have to struggle night and day to make this work.
FYI, I have tried even the OPenCV website and frankly their instructions are a bit useless. Also, all the necessary information e.g. adding PATH, adding includes and libraries, etc. Please someone point me to the right direction as it has been two days and I cannot get anywhere. It is literally stopping my job now :(
As an answer, but probably a very simple one, I did the following and got rid of the problem:
1) Uninstalled code::blocks completely from the PC and downloaded the IDE-only version (i.e. withouth MinGW compiler), then installed it.
2) Downloaded the latest stable version of MinGW, installed, and added C:\MinGW\bin to PATH
3) Followed rest of the instructions from [link] http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
4) Just to be sure, copied the opencv .dll files from the build folder (i.e. the one that you have created "make" and "install" files using CMake) to the debug (i.e. the executables') folder.
This will fix the problems. In case, it doesn't it might be that you need to add some environment variables.

OpenCV 2.1 Strange Errors

I'm not sure if this is the right place for asking these kind of question but I have no better place in mind.
After LOTS of coding in OpenCV, I'm trying to migrate to new C++ interface of openCV which has been introduced in OpenCV 2.0. but I keep getting strange errors.
For example:
trying to use pre-built dlls and libs, I got exceptions in "cv::warpAffine" and "findContours" cv::function at runtime. I compiled the openCV, used my own build of libs and dlls and everything got fixed!
the same problem happened in linux.
linking the "Debug" built dlls with "Release" built of program cause some unexpected runtime errors, and vice versa.
and some other errors.
can anyone helping me with what I'm doing wrong? (please keep in mind that I coded alot with older version of openCV).
When I migrated to C++ interface I couldnt make openCV work until I compiled the source by myself. Probably DLL's and Libs that are installed with opencv are good only to a specific machine.
Another thing. Try to do the following if you use Visual Studio
go to Project Properties->Click the C/C++ folder->Code Generation->Runtime Library and change it to /MDd in Debug configuration and /MD in release
It solves a problem with esceptions related to STL
Some of the functions ave moved out to new libs (especially some of the stereo functions are in calib3d) and the header file structure is completely changed in 2.2
There are some guides to the configuration eg for visual studio

Resources