Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SURF Detect "bad allocation" Error #123

Closed
GoogleCodeExporter opened this issue Apr 7, 2015 · 10 comments
Closed

SURF Detect "bad allocation" Error #123

GoogleCodeExporter opened this issue Apr 7, 2015 · 10 comments

Comments

@GoogleCodeExporter
Copy link

I'm trying to use the SURF Feature Detector in features2d. Essentially I'm 
doing this tutorial: 
http://opencv.itseez.com/doc/tutorials/features2d/feature_flann_matcher/feature_
flann_matcher.html
but in java, using javacv.

I found the scala SURF example in javacv-examples that is essentially identical 
to the first part of the tutorial.

However whenever I call the .detect() method (in scala or in java) I get a "bad 
allocation" error (stack trace below).

What steps will reproduce the problem?
1. Create a SurfFeatureDetector.
2. Call the .detect() method.

What is the expected output? What do you see instead?
I would expect it not to crash. Instead it crashes.

What version of the product are you using? On what operating system?
I'm on Windows 7 64, using 64 bit everything (jdk, opencv, javacv).

Please provide any additional information below.

Here's the stack trace from the scala example:
java.lang.RuntimeException: bad allocation
        at com.googlecode.javacv.cpp.opencv_features2d$FeatureDetector.detect(Native Method)
        at SURF$delayedInit$body.apply(<console>:46)
        at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
        at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
        at scala.App$$anonfun$main$1.apply(App.scala:60)
        at scala.App$$anonfun$main$1.apply(App.scala:60)
        at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
        at scala.collection.immutable.List.foreach(List.scala:45)
        at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)
        at scala.App$class.main(App.scala:60)
        at SURF$.main(<console>:39)
        at .<init>(<console>:41)
        at .<clinit>(<console>)
        at .<init>(<console>:11)
        at .<clinit>(<console>)
        at $print(<console>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:704)

        at scala.tools.nsc.interpreter.IMain$Request$$anonfun$14.apply(IMain.scala:920)
        at scala.tools.nsc.interpreter.Line$$anonfun$1.apply$mcV$sp(Line.scala:43)
        at scala.tools.nsc.io.package$$anon$2.run(package.scala:25)
        at java.lang.Thread.run(Thread.java:662)

Original issue reported on code.google.com by jacob.ge...@gmail.com on 26 Oct 2011 at 4:16

@GoogleCodeExporter
Copy link
Author

Which version of JavaCV?

Original comment by samuel.a...@gmail.com on 26 Oct 2011 at 4:24

@GoogleCodeExporter
Copy link
Author

I downloaded javacv-bin-20111001.zip

Original comment by jacob.ge...@gmail.com on 26 Oct 2011 at 4:26

@GoogleCodeExporter
Copy link
Author

Also, the OpticalFlowTracker java sample worked fine, so I believe that JavaCV 
is installed correctly.

Original comment by jacob.ge...@gmail.com on 26 Oct 2011 at 4:34

@GoogleCodeExporter
Copy link
Author

and which version of OpenCV?

Original comment by samuel.a...@gmail.com on 27 Oct 2011 at 1:37

@GoogleCodeExporter
Copy link
Author

OpenCV 2.3 (64bit)

Original comment by jacob.ge...@gmail.com on 27 Oct 2011 at 3:19

@GoogleCodeExporter
Copy link
Author

Could you please try again with OpenCV 2.3.1 instead? Thank you

Original comment by samuel.a...@gmail.com on 28 Oct 2011 at 4:46

@GoogleCodeExporter
Copy link
Author

Sorry, my mistake, I actually am using 2.3.1, the dll files are all named like 
opencv_core231.dll

Original comment by jacob.ge...@gmail.com on 30 Oct 2011 at 6:33

@GoogleCodeExporter
Copy link
Author

And are you certain that your system is loading the ones compiled for Visual 
C++ 2010? You can make sure of this by deleting all the files within 
directories other than "vc10"...

Original comment by samuel.a...@gmail.com on 31 Oct 2011 at 3:01

@GoogleCodeExporter
Copy link
Author

Ah, that fixed it. Thanks!

Original comment by jacob.ge...@gmail.com on 31 Oct 2011 at 3:25

@GoogleCodeExporter
Copy link
Author

Great!

Original comment by samuel.a...@gmail.com on 2 Nov 2011 at 1:18

  • Changed state: Invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant