You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include <jni.h>
|
|
|
|
#include <opencv2/core/core.hpp>
|
|
|
|
#include <opencv2/imgproc/imgproc.hpp>
|
|
|
|
#include <opencv2/features2d/features2d.hpp>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace cv;
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4Mixed_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba);
|
|
|
|
|
|
|
|
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4Mixed_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba)
|
|
|
|
{
|
|
|
|
Mat* pMatGr=(Mat*)addrGray;
|
|
|
|
Mat* pMatRgb=(Mat*)addrRgba;
|
|
|
|
vector<KeyPoint> v;
|
|
|
|
|
|
|
|
FastFeatureDetector detector(50);
|
|
|
|
detector.detect(*pMatGr, v);
|
|
|
|
for( size_t i = 0; i < v.size(); i++ )
|
|
|
|
circle(*pMatRgb, Point(v[i].pt.x, v[i].pt.y), 10, Scalar(255,0,0,255));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|