mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
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.
28 lines
830 B
28 lines
830 B
14 years ago
|
#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" {
|
||
12 years ago
|
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial2_Sample2NativeProcessing_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba);
|
||
12 years ago
|
|
||
12 years ago
|
JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial2_Sample2NativeProcessing_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba)
|
||
14 years ago
|
{
|
||
12 years ago
|
Mat& mGr = *(Mat*)addrGray;
|
||
|
Mat& mRgb = *(Mat*)addrRgba;
|
||
14 years ago
|
vector<KeyPoint> v;
|
||
|
|
||
|
FastFeatureDetector detector(50);
|
||
12 years ago
|
detector.detect(mGr, v);
|
||
|
for( unsigned int i = 0; i < v.size(); i++ )
|
||
|
{
|
||
|
const KeyPoint& kp = v[i];
|
||
|
circle(mRgb, Point(kp.pt.x, kp.pt.y), 10, Scalar(255,0,0,255));
|
||
|
}
|
||
14 years ago
|
}
|
||
|
}
|