HOG compute jni error [closed]

asked Nov 12 '13

Rauluka gravatar image

updated Nov 12 '13

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);

}
Preview: (hide)

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-09-22 16:30:47.059837

Comments

1

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

berak gravatar imageberak (Nov 12 '13)edit

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

Rauluka gravatar imageRauluka (Nov 12 '13)edit
1

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 (Nov 12 '13)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 (Nov 12 '13)edit