Opencv4android extracting feature point descriptors (Feature descriptor)

Source: Internet
Author: User

Opencv4android extracting feature point descriptors (Feature descriptor)

After the keypoints is obtained (refer to the front), the descriptors at the key points can be calculated by using the corresponding featuredescriptor.

Native Code:

void JNICALL Java_com_example_test_NativeUtil_computeDescripors(        JNIEnv *env, jclass thiz, jlong mGrayAddr, jlong mRgbaAddr, jlong mOutputAddr) {    Mat* pMatGr=(Mat*)mGrayAddr;    Mat* pMatRgb=(Mat*)mRgbaAddr;    Mat* pMatDesc=(Mat*)mOutputAddr;    vector<KeyPoint> v;    //OrbFeatureDetector detector(50);    OrbFeatureDetector detector;    OrbDescriptorExtractor extractor;    detector.detect(*pMatGr, v);    extractor.compute(*pMatGr, v, *pMatDesc);}

Operating effect:


The result is true, because the resulting descriptor is a matrix, and each key corresponds to a vector. Information about this vector can be seen through the Logcat log.

06-17 13:25:32.339:i/feature descriptor::activity (2689): row:490,col:32,channels:1

Note that 490 feature points are extracted, the descriptors corresponding to the feature points are 32 dimensions (this is the orb, if it is sift, the dimensions are different)

the error encountered
Error 1:

06-17 12:53:05.021:e/androidruntime (1532): caused By:java.lang.ClassCastException:android.widget.ImageView cannot Be cast to Android.widget.Button

Sometimes inexplicable false report the wrong, by removing R.java to solve.

Reference:
Common Interfaces of Descriptor Extractors

Opencv4android extracting feature point descriptors (Feature descriptor)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.