#include #include #include #include #include #include using namespace std; using namespace cv; using namespace cv::gpu; #include #define LOG_TAG "Cuda" #define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) extern "C" { JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Tutorial4Activity_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba); JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial4_Tutorial4Activity_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba) { Mat& mGr = *(Mat*)addrGray; Mat& mRgb = *(Mat*)addrRgba; vector keypoints; GpuMat grGpu(mGr); FAST_GPU fast(50); fast(grGpu, GpuMat(), keypoints); for( unsigned int i = 0; i < keypoints.size(); i++ ) { const KeyPoint& kp = keypoints[i]; circle(mRgb, Point(kp.pt.x, kp.pt.y), 10, Scalar(255,0,0,255)); } } }