HOG compute jni error

asked 2013-11-12 16:58:10 -0500

Rauluka gravatar image

updated 2013-11-12 17:25:28 -0500

I use java version of opencv and I want to compute HOG by using hog.compute. The problem is that I get: java.lang.Exception: Unknown exception in JNI code {objdetect::compute_10()} at org.opencv.objdetect.HOGDescriptor.compute_0(Native Method)

I would be grateful if someone could help.

The code:

protected void computeFeature(Mat imgSample,
        HashMap<String, Double> features, Mat mask) {

    HOGDescriptor hog = new HOGDescriptor(new Size(128, 64), new Size(16,
            16), new Size(8, 8), new Size(8, 8), 9, 0, -1,0, 0.2, false, 64);

    Imgproc.resize(imgSample, imgSample, new Size(128, 64));
    MatOfFloat z = new MatOfFloat();

    hog.compute(imgSample, z);

edit retag flag offensive close merge delete



could you add some code showing, how you're trying to use it ?

berak gravatar imageberak ( 2013-11-12 17:17:51 -0500 )edit

As you wish ^ These are standard parameters for HOG. I tried different combinations of parameters but I stillget jni error.

Rauluka gravatar imageRauluka ( 2013-11-12 17:27:16 -0500 )edit

yea, your params look pretty reasonable, so probably not an issue.

here ' s what the generator made (3.0, grain of salt needed)

did you check, if imgSample is valid ? (i can't see much else there)

berak gravatar imageberak ( 2013-11-12 17:37:38 -0500 )edit

A minute ago I checked that it falls when I have image files and folder in the same input folder(with samples) so it seems that is the issue (my bad). Thank you for your quick answer:)

Rauluka gravatar imageRauluka ( 2013-11-12 17:42:53 -0500 )edit