HOG compute jni error [closed]
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);
}
could you add some code showing, how you're trying to use it ?
As you wish ^ These are standard parameters for HOG. I tried different combinations of parameters but I stillget jni error.
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)
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:)