OpenCV with Microsoft Kinect SDK (C++) - opencv

Can anyone share how to use OpenCV with C++ SkeletalViewer sample ?
I am using OpenCV2.3 with with SkeletalViewer sample. However, I got the following errors while trying to create an image using cvCreateImage();
error LNK2001: unresolved external symbol _cvCreateImage C:\Users\Public\Documents\Microsoft Research KinectSDK Samples\NUI\SkeletalViewer - Copy\CPP\NuiImpl.obj SkeletalViewer
error LNK1120: 1 unresolved externals C:\Users\Public\Documents\Microsoft Research KinectSDK Samples\NUI\SkeletalViewer - Copy\CPP\Debug\SkeletalViewer.exe SkeletalViewer
Thanks a lot!

It sounds like you haven't added the library to your project. Right-click your project and go to Properties. Then go to Linker >> General >> Additional Library Directories, set this to
"$(YOUR_OPENCV_ROOT)\lib". Next, go to Linker >> Input >> Additional Dependencies and make sure opencv_core230.lib (or opencv_core231.lib, which ever 2.3.x version you are using) is in there.
Also, I would highly suggest using the C++ interface as it has more functionality than the C interface especially in OpenCV 2.3.x.
Hope that helps!

Related

Linking Header File with Main.Cpp file in Codeblocks

I am trying to use codeblocks to compile the code available here
The thing is every time I try to build and run, I run into the following error:
|/.../head_pose_estimation/opencv2/core/core.hpp|48|fatal error: opencv2/core.hpp: No such file or directory
Does anyone know how I can fix this? Thank you!
You do not have the pre-built (compiled) version of OpenCV, what you currently have are the source files. If you want to do something special with OpenCV (Target/GPU SUpport etc) then you will need to build the framework using an appropriate guide.
If however you simply want to use OpenCV in the most common way then download the pre-built libraries from the OpenCV.org website.
NOTE:
If you are using OpenCV with MinGW compiler, I do not remember if the pre-built is actually pre-built for MinGW. (I dont think they do) In this case you will HAVE to built the libraries. You can find a guide here

cannot setup Opencv 2.4.6 , opencv_core231d.lib Not Found Error

Hello everyone;
i had opencv 2.2 on my vs2010, and i wanted to update so i went to opencv site and:
i've downloaded OpenCV for Windows (ver 2.4.6)
i've extracted it to c:\opencv2.4
i've set the Environment Variable as doc said here: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windowssetpathandenviromentvariable
( i didnt know what is "PATH EDITOR" so i've just changed Environment variables)
i made property sprite sheets as opencv doc said here: http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to
5.but Doc Was Old, and there was no "include" folder in OpenCV2.4/opencv/build/x64/vc10 so I did set include Directory to OpenCV2.4/opencv/build/include in My property sprite sheet.
everything seems true and VS detect include libraries But
VS2010 throw following error when i want to Build the solution:
1>LINK : fatal error LNK1104: cannot open file 'opencv_core231d.lib'
Strange thing is there is no "opencv_core231d.lib" File in c:\opencv2.4 at all!!!
:(
what is the problem?
This is a Linker error, so make sure you are trying to link the correct libraries.
I would suggest to use CMake, which definitely simplifies configuring projects, specially those having dependencies like OpenCV (you can take a look to the OpenCV documentation, or any blog explaining the steps: http://marcosnietoblog.wordpress.com/2011/11/19/opencv-for-windows-easy-installation-using-cmake/ )
By the way, I use to have several versions of opencv on the same folder:
C:\OpenCV\opencv2.4.3
C:\OpenCV\opencv2.4.6
...
So I can easily switch within CMake setting the OpenCV_DIR.
opencv_core231d.lib is a debug version, all the *d.lib and *d.dll files in openCV are with debug symbols.
It is likely that the pre-built release you downloaded doesn't contain debug ones.
either download te source and build both debug and release. Or, if you don't care how opencv works internally, just change the linker flags to use the same lib names with the d
edit. or of course if you donwloaded opencv 2.4.6 the file would be opencv_core246d.lib

OpenCV2.4.3 Program Can't start because libgcc_s_dw2-1.dll missing

Since last month I was working with OpenCV2.2(pre-built) using c functions only in code::blocks. But I need to shift to c++ API. But when I run the c++ code I am getting error like "undefined reference to c++ function". I just search in internet and found that I need to build from source. So I just moved to OpenCV2.4.3. These are my setting what I do with OpenCV2.4.3 for configuring project in code::blocks.
Extract OpenCV2.4.3 to E:\opencv
Add the line "E:\opencv\build\x86\mingw\bin" to path.
And in code::blocks set up the project like
-> Compiler and debugger setting->search directories add "E:\opencv\build\include"
-> In linker tab add "E:\opencv\build\x86\mingw\bin"
-> In limker setting tab add "E:\opencv\build\x86\mingw\lib"
And I build my project successfully but while I am running my project I am getting the error like "Program Can't start because libgcc_s_dw2-1.dll missing from your computer".
I am using code::blocks with MingGW compiler.
My questions are
1. Why I can't run c++ code using OpenCV2.2 while c code is successfully build and ran. Is it the pre-built library problem. If so where can I download OpenCV pre-built library which support both c and c++ code.
2. Why the MingGW compiler showing the error like "libgcc_s_dw2-1.dll missing "for OpenCV2.4.3 where as OpenCV2.2 successfully build and ran using the same MingGW compiler.
Any help will appreciated.
Thanks in advance..........
I had the same problem when I switched from OpenCV 2.0 to OpenCV 2.4.3. So I will suggest the following.
Uninstall both CodeBlocks and Opencv 2.4.3
Reinstall both and integrate them using the same steps you followed earlier.
Let us know if this works.

Using OpenCV with DevCPP

I am a newbie to OpenCV and I am trying to use it with DevC++. Although I am aware I could use Visual Studio for the same , I would still like to use DevC++.
The OpenCV Wiki-how seems obsolete with this information. Can you please tell me the steps with which I can modify the Compiler Options in DevCpp so that I may kick-off with OpenCV.
Any help is highly appreciated ...
Also, OpenCV wiki directs me to paste the following code in the Compiler Options ,
-L"C:\Program Files\OpenCV\lib" -lcxcore -lcv -lcvaux -lhighgui -lml -lcvcam
Sadly , I did not find the lib folder in my OpenCV directory..

Linker error LNK2019 (unresolved symbol) with OpenCV 2.4, CvBlob library, and Visual Studio 2012 RC

I've spent the last hour or two trying to hunt this problem down and can't seem to get it right. I am using OpenCV with MS VS 2012 RC, and to this point it has worked quite well (one bug dealing with the newer Mat container, but fine otherwise). I have a previously written application I am trying to port (from GCC/G++), which used the cvblob.dll library from here. I have recompiled the cvblob library with VS2012 (my previous version was compiled with MinGW and worked flawlessly), and managed to create both a DLL and an import library .LIB.
The application compiles properly, but the one spot where I use the cvblob library is now my source of error, because the linker cannot find the symbol for the cvLabel function in the library. This is the complete error message I get from VS2012:
ConsoleApplication1.cpp
1> Generating Code...
1>imageinput.obj : error LNK2019: unresolved external symbol _cvLabel referenced in function "public: class std::vector,class std::allocator > > _thiscall ImageInput::getROI(class cv::Mat,class cv::Mat)" (?getROI#ImageInput##QAE?AV?$vector#V?$Rect#H#cv##V?$allocator#V?$Rect_#H#cv###std###std##VMat#cv##0#Z)
1>C:\Users\Jake\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe : fatal error LNK1120: 1 unresolved externals
I'm not certain whether this is a problem with the cvblob library itself, my current binary for it, or just the process I used to compile it. I will gladly furnish any information I can upon request. Thanks in advance for your advice!
You obviously didn't link needed library in project settings. Try to add all OpenCV/CvBlob libs in linker properties of your prooject. See docs.
Also look at this discussion.

Resources