OpenCV: "Feature Matching with FLANN" tutorial - getting exception - c++

I am starting up with OpenCV (using C++) and was playing around with the "Feature matching with FLANN" tutorial from here:
http://opencv.itseez.com/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html
I did not modify anything, just tried running it as it is. Unfortunately, when running it, I am getting this error when the program tries to detect the keypoints (on the line detector.detect(img_1, keypoints_1)) :
I had no problems with running other OpenCV tutorials out of the box...did anyone experience similar problems?
My system: Visual Express 2010 and OpenCV 2.3, under Windows 7 64-bit. Could this be a bug of v2.3, or some issues related to the 64-bitness of my system?

It sure helps to know more about C++ than a worm :) I realized I had linked against the release version of the feature2d lib. As always, solved automatically by virtue of the "power of posting"...

I have same mistake with your‘s,because you have use different Version of lib file.
If you use debug,you must use lib ended by 'd'.

Related

OpenCV in Code::Blocks: The application was unable to start correctly (0xc00000be)

I set up OpenCV with Code::Blocks as per this tutorial: http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/.
I've got as far as building the test program at the end successfully, but when I try to run it I get the following error: "The application was unable to start correctly (0xc00000be). Click OK to close the application."
The one thing that is certainly different from the tutorial for me is that I'm working with OpenCV 3.0.0, Code::Blocks 13.12 and the latest version of mingw (number not obvious from their website or the installer).
I found that other people had had this problem in the past, e.g. The application was unable to start correctly (0xc00000be)
However, it has been a long time since that thread was active, I'm working with newer versions of the software and, most importantly, the answer given there didn't help (I compiled openCV with the same mingw that I'm using with Code::Blocks), so I thought this question would be worth asking (sorry if it's not, I'm rather new to this).
Could anybody suggest a fix that might get rid of this error?
A few other things to note:
I didn't download the Code::Blocks that came with mingw as I was advised against it, I got them separately as per the tutorial
I have installed OpenCV and Code::Blocks on my E: drive, though mingw is still on my C:.
I have added both mingw and OpenCV to my PATH variable, and mingw to my Path variable
I have linked the libraries in both the main compiler settings for Code::Blocks and the Build Options of my project.
I'm working from a 64-bit Windows 7 Laptop, but I have done everything 32-bit style as advised in the tutorial.
Thanks in advance!
So, one solution I've found to this problem is to copy all the .dll files from "...\opencv\build\x86\mingw\bin" to the project file (build directory).
Having done that, the project will run fine. This still doesn't (directly) explain why it wont run without those files (at least, several sources including the tutorial imply it should), and so isn't really optimal. I will continue to look for a solution for this so I don't have to clutter every opencv project I make with the .dlls.
However, for anyone simply wanting to get stuck into coding who is having this problem, I recommend that solution.

converting kinect data to opencv matrix

NEW TO OPENCV AND KINECT :)
I am sorry if there are other similar questions here - I did search and am still lost.
I am trying to use the Microsoft Kinect SDK with opencv. I looked at the KinectBridgeWithOpenCVBasis example in the SDK but find it too complex.
Here is the question: I am using the DepthSensor class from this site I am trying to get the depth data into opencv matrix. The code is as follows:
DepthSensor *ds = new DepthSensor();
ds->init();
Mat frame;
ds->getDepthMat().copyTo(frame);
imshow("display", ds->getColorMat());
I did add ds->processDepth(); at various points to check if it works. The exact error message is :
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, fi
le C:\builds\2_4_PackSlave-win64-vc12-shared\opencv\modules\highgui\src\window.c
pp, line 261
and
Unhandled exception at 0x000007FEFC7B940D in opencvtest.exe: Microsoft C++ exception: cv::Exception at memory location 0x00000000001AF500.
Any ideas on how I fix this? Thanks.
MT
I'm still fairly new to OpenCV and the Kinect as well, but I came across this post. It seems to describe a similar problem. If you look at the last comment on any of the posts, the OP has described the solution they found:
Thanks for answering. I figured out the issue. It was a conflict
between the 32 and 64 bits dlls vs the compiler. When I installed VS
2010 with superpack 2.3 the compiler I think tries to use a mix match
of x86 and x64 dlls based on the way its setup in the environment vars
and Vs2010. I figured it out by installing VS2010 on a different
computer with only x86 support compiler and I had no trouble at all.
Everything Worked Fine! Exact same setup, only one is X86 and the
other is X86 and X64. It didn't make sense because the compiler should
choose one right? and not a mix of x86 and 64 dlls?
Another (perhaps related?) possibility is that something is wrong in your install of OpenCV. The first couple times I tried building the libraries I made mistakes and got strange errors when trying to run code. I eventually settled on using the pre-built libraries. If you get errors with all OpenCV code, try reinstalling.
Finally, it looks as though you've only posted a fragment of your code. I've seen many people request that questions include the complete code so that it can be more easily debugged and in case you missed an error somewhere else.
Good luck!

Setting up OpenCV with Windows 7 and Code Blocks

I have successfully built OpenCV and I have come to the point where code::blocks recognizes the OpenCV syntax and successfully builds the program. However when I run I get this error
"The procedure entry point_gxx_personality_v0 could not be located in the dynamic link library libstdc++-6.dll."
I am using Code::Blocks v 12.11 and minGW (the most recent, I can't remember the version number) along with OpenCV-2.4.8 Has anyone ever seen this problem? Help if you can, anything right now might work since I am so close.
https://stackoverflow.com/questions/3895879/installing-opencv-on-windowsw32-to-be-used-with-code-blocks?rq=1
Using this link to the other question I was able to locate a hint for my problem. I had everything correct and the hint to change the build to a GUI Application solved the issue. The programs build and then run as they should.

OpenCV imshow() does not work

I have written an openCV code and my code has following statement:
cv::imshow("Matches", matchesImg);
cv::waitKey(0);
When I run the code either in Debug or Release I am not able to see window which shows me the output.
And this is happening for every project I create.
Not able to figure out the reason, Can someone please guide me on this?
I am coding on Windows 7 and Visual studio 2010, with opencv version of 2.4.6
As I mentioned in the comments, you have to create a window first, using namedWindow with the same window name as in imshow
See this tutorial for details.
EDIT
This strongly suggest that you have to create the window beforehand.
Some may argue that it didn't work this way for previous versions of OpenCV. Then, let's say this solution apply at least to OpenCV 2.4.6, which is the version of concern here (and it solved the problem).

OpenCV - How do I get started?

I just don't seem to be able to get OpenCV to work properly. Here's what I want to accomplish:
Use CodeBlocks (which I installed using codeblocks-10.05mingw-setup.exe) with OpenCV (installer: OpenCV-2.4.2.exe) on my Windows x64.
I've tried a lot of different configurations which will only bother you if I posted them all, so I hope you don't mind if I just ask the simple question: how do I get this to work?
I think I'm missing the smallest detail right now, so a detailed description of how to get started would be welcome.
If the OpenCV installer did the job, you should have by now OpenCV libraries and headers already installed in your system.
I would then go ahead and try to compile a hello world basic code, like the one you can get from here. If you would like to program using an IDE, like VisualC++ in Windows, you can follow this guide that will help you setting up the environment.
OpenCV team just introduced their new web site. There you can find Introduction to OpenCV section with installation instructions, including detailed instructions for Windows. Don't forget to cleanup your system before installation to avoid problems with mixing different install options. If you still can't get it working with CodeBlocks, follow Dan's advice and try compiling from command line.
When you are done with installation, go on and read there great new tutorials!