mirror of https://github.com/opencv/opencv.git
CodeReview #1512 notes fixed.
parent
834a0b518c
commit
3780685fe6
8 changed files with 222 additions and 175 deletions
@ -1,61 +0,0 @@ |
|||||||
/* DO NOT EDIT THIS FILE - it is machine generated */ |
|
||||||
#include <jni.h> |
|
||||||
/* Header for class org_opencv_samples_fd_DetectionBaseTracker */ |
|
||||||
|
|
||||||
#ifndef _Included_org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
#define _Included_org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
#ifdef __cplusplus |
|
||||||
extern "C" { |
|
||||||
#endif |
|
||||||
/*
|
|
||||||
* Class: org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
* Method: nativeCreateObject |
|
||||||
* Signature: (Ljava/lang/String;F)J |
|
||||||
*/ |
|
||||||
JNIEXPORT jlong JNICALL Java_org_opencv_samples_fd_DetectionBaseTracker_nativeCreateObject |
|
||||||
(JNIEnv *, jclass, jstring, jint); |
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
* Method: nativeDestroyObject |
|
||||||
* Signature: (J)V |
|
||||||
*/ |
|
||||||
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBaseTracker_nativeDestroyObject |
|
||||||
(JNIEnv *, jclass, jlong); |
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
* Method: nativeStart |
|
||||||
* Signature: (J)V |
|
||||||
*/ |
|
||||||
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBaseTracker_nativeStart |
|
||||||
(JNIEnv *, jclass, jlong); |
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
* Method: nativeStop |
|
||||||
* Signature: (J)V |
|
||||||
*/ |
|
||||||
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBaseTracker_nativeStop |
|
||||||
(JNIEnv *, jclass, jlong); |
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
* Method: nativeSetFaceSize |
|
||||||
* Signature: (JI)V |
|
||||||
*/ |
|
||||||
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBaseTracker_nativeSetFaceSize |
|
||||||
(JNIEnv *, jclass, jlong, jint); |
|
||||||
|
|
||||||
/*
|
|
||||||
* Class: org_opencv_samples_fd_DetectionBaseTracker |
|
||||||
* Method: nativeDetect |
|
||||||
* Signature: (JJJ)V |
|
||||||
*/ |
|
||||||
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBaseTracker_nativeDetect |
|
||||||
(JNIEnv *, jclass, jlong, jlong, jlong); |
|
||||||
|
|
||||||
#ifdef __cplusplus |
|
||||||
} |
|
||||||
#endif |
|
||||||
#endif |
|
@ -0,0 +1,61 @@ |
|||||||
|
/* DO NOT EDIT THIS FILE - it is machine generated */ |
||||||
|
#include <jni.h> |
||||||
|
/* Header for class org_opencv_samples_fd_DetectionBasedTracker */ |
||||||
|
|
||||||
|
#ifndef _Included_org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
#define _Included_org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
#ifdef __cplusplus |
||||||
|
extern "C" { |
||||||
|
#endif |
||||||
|
/*
|
||||||
|
* Class: org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
* Method: nativeCreateObject |
||||||
|
* Signature: (Ljava/lang/String;F)J |
||||||
|
*/ |
||||||
|
JNIEXPORT jlong JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeCreateObject |
||||||
|
(JNIEnv *, jclass, jstring, jint); |
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
* Method: nativeDestroyObject |
||||||
|
* Signature: (J)V |
||||||
|
*/ |
||||||
|
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeDestroyObject |
||||||
|
(JNIEnv *, jclass, jlong); |
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
* Method: nativeStart |
||||||
|
* Signature: (J)V |
||||||
|
*/ |
||||||
|
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeStart |
||||||
|
(JNIEnv *, jclass, jlong); |
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
* Method: nativeStop |
||||||
|
* Signature: (J)V |
||||||
|
*/ |
||||||
|
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeStop |
||||||
|
(JNIEnv *, jclass, jlong); |
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
* Method: nativeSetFaceSize |
||||||
|
* Signature: (JI)V |
||||||
|
*/ |
||||||
|
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeSetFaceSize |
||||||
|
(JNIEnv *, jclass, jlong, jint); |
||||||
|
|
||||||
|
/*
|
||||||
|
* Class: org_opencv_samples_fd_DetectionBasedTracker |
||||||
|
* Method: nativeDetect |
||||||
|
* Signature: (JJJ)V |
||||||
|
*/ |
||||||
|
JNIEXPORT void JNICALL Java_org_opencv_samples_fd_DetectionBasedTracker_nativeDetect |
||||||
|
(JNIEnv *, jclass, jlong, jlong, jlong); |
||||||
|
|
||||||
|
#ifdef __cplusplus |
||||||
|
} |
||||||
|
#endif |
||||||
|
#endif |
@ -1,52 +0,0 @@ |
|||||||
package org.opencv.samples.fd; |
|
||||||
|
|
||||||
import org.opencv.core.Mat; |
|
||||||
import org.opencv.core.MatOfRect; |
|
||||||
|
|
||||||
public class DetectionBaseTracker |
|
||||||
{ |
|
||||||
public DetectionBaseTracker(String filename, int faceSize) |
|
||||||
{ |
|
||||||
mNativeObj = nativeCreateObject(filename, faceSize); |
|
||||||
} |
|
||||||
|
|
||||||
public void start() |
|
||||||
{ |
|
||||||
nativeStart(mNativeObj); |
|
||||||
} |
|
||||||
|
|
||||||
public void stop() |
|
||||||
{ |
|
||||||
nativeStop(mNativeObj); |
|
||||||
} |
|
||||||
|
|
||||||
public void setMinFaceSize(int faceSize) |
|
||||||
{ |
|
||||||
nativeSetFaceSize(mNativeObj, faceSize); |
|
||||||
} |
|
||||||
|
|
||||||
public void detect(Mat imageGray, MatOfRect faces) |
|
||||||
{ |
|
||||||
nativeDetect(mNativeObj, imageGray.getNativeObjAddr(), faces.getNativeObjAddr()); |
|
||||||
} |
|
||||||
|
|
||||||
public void release() |
|
||||||
{ |
|
||||||
nativeDestroyObject(mNativeObj); |
|
||||||
mNativeObj = 0; |
|
||||||
} |
|
||||||
|
|
||||||
protected long mNativeObj = 0; |
|
||||||
|
|
||||||
protected static native long nativeCreateObject(String filename, int faceSize); |
|
||||||
protected static native void nativeDestroyObject(long thiz); |
|
||||||
protected static native void nativeStart(long thiz); |
|
||||||
protected static native void nativeStop(long thiz); |
|
||||||
protected static native void nativeSetFaceSize(long thiz, int faceSize); |
|
||||||
protected static native void nativeDetect(long thiz, long inputImage, long resultMat); |
|
||||||
|
|
||||||
static |
|
||||||
{ |
|
||||||
System.loadLibrary("detection_base_tacker"); |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,52 @@ |
|||||||
|
package org.opencv.samples.fd; |
||||||
|
|
||||||
|
import org.opencv.core.Mat; |
||||||
|
import org.opencv.core.MatOfRect; |
||||||
|
|
||||||
|
public class DetectionBasedTracker |
||||||
|
{ |
||||||
|
public DetectionBasedTracker(String cascadeName, int minFaceSize) |
||||||
|
{ |
||||||
|
mNativeObj = nativeCreateObject(cascadeName, minFaceSize); |
||||||
|
} |
||||||
|
|
||||||
|
public void start() |
||||||
|
{ |
||||||
|
nativeStart(mNativeObj); |
||||||
|
} |
||||||
|
|
||||||
|
public void stop() |
||||||
|
{ |
||||||
|
nativeStop(mNativeObj); |
||||||
|
} |
||||||
|
|
||||||
|
public void setMinFaceSize(int size) |
||||||
|
{ |
||||||
|
nativeSetFaceSize(mNativeObj, size); |
||||||
|
} |
||||||
|
|
||||||
|
public void detect(Mat imageGray, MatOfRect faces) |
||||||
|
{ |
||||||
|
nativeDetect(mNativeObj, imageGray.getNativeObjAddr(), faces.getNativeObjAddr()); |
||||||
|
} |
||||||
|
|
||||||
|
public void release() |
||||||
|
{ |
||||||
|
nativeDestroyObject(mNativeObj); |
||||||
|
mNativeObj = 0; |
||||||
|
} |
||||||
|
|
||||||
|
private long mNativeObj = 0; |
||||||
|
|
||||||
|
private static native long nativeCreateObject(String cascadeName, int minFaceSize); |
||||||
|
private static native void nativeDestroyObject(long thiz); |
||||||
|
private static native void nativeStart(long thiz); |
||||||
|
private static native void nativeStop(long thiz); |
||||||
|
private static native void nativeSetFaceSize(long thiz, int size); |
||||||
|
private static native void nativeDetect(long thiz, long inputImage, long faces); |
||||||
|
|
||||||
|
static |
||||||
|
{ |
||||||
|
System.loadLibrary("detection_based_tacker"); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue