Download samples/android/tutorial-2-mixedprocessing/jni/jni_part.cpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 826 Bytes
-
https://huggingface.co/tgollogly/test/resolve/main/samples/android/tutorial-2-mixedprocessing/jni/jni_part.cpp
- Command line
-
hf download hf://tgollogly/test/samples/android/tutorial-2-mixedprocessing/jni/jni_part.cpp
-
curl -L -o jni_part.cpp https://huggingface.co/tgollogly/test/resolve/main/samples/android/tutorial-2-mixedprocessing/jni/jni_part.cpp
826 Bytes
| using namespace std; | |
| using namespace cv; | |
| extern "C" { | |
| JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial2_Tutorial2Activity_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba); | |
| JNIEXPORT void JNICALL Java_org_opencv_samples_tutorial2_Tutorial2Activity_FindFeatures(JNIEnv*, jobject, jlong addrGray, jlong addrRgba) | |
| { | |
| Mat& mGr = *(Mat*)addrGray; | |
| Mat& mRgb = *(Mat*)addrRgba; | |
| vector<KeyPoint> v; | |
| Ptr<FeatureDetector> detector = FastFeatureDetector::create(50); | |
| 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)); | |
| } | |
| } | |
| } | |