dd989e652475e9fa4b7e0c39560cecacd1255805
[profile/ivi/opencv.git] / samples / android / tutorial-4-mixed / jni / jni_part.cpp
1 #include <jni.h>
2 #include <opencv2/core/core.hpp>
3 #include <opencv2/imgproc/imgproc.hpp>
4 #include <opencv2/features2d/features2d.hpp>
5 #include <vector>
6
7 using namespace std;
8 using namespace cv;
9
10 extern "C" {
11 JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Sample4View_FindFeatures(JNIEnv* env, jobject thiz, jlong addrGray, jlong addrRgba)
12 {
13     Mat* pMatGr=(Mat*)addrGray;
14     Mat* pMatRgb=(Mat*)addrRgba;
15     vector<KeyPoint> v;
16
17     FastFeatureDetector detector(50);
18     detector.detect(*pMatGr, v);
19     for( size_t i = 0; i < v.size(); i++ )
20         circle(*pMatRgb, Point(v[i].pt.x, v[i].pt.y), 10, Scalar(255,0,0,255));
21 }
22
23 }