I am using opencv-sdk-android. I want that my native code should return keypoint vector. Is it correct to use code like this..
Vector<KeyPoint> keypoint = FindFeatures(Gray1.getNativeObjAddr(),descriptor.getNativeObjAddr());
and
public native Vector<KeyPoint> FindFeatures(long matAddrGr1, long matAddrGr2);
My natice code is
extern "C" {
JNIEXPORT Vector<KeyPoint> JNICALL Java_com_example_xyz_MainActivity_FindFeatures(JNIEnv*, jobject, jlong addrGray1, jlong addrdescrptor);
JNIEXPORT Vector<KeyPoint> JNICALL Java_com_example_xyz_MainActivity_FindFeatures(JNIEnv*, jobject, jlong addrGray1, jlong addrdescrptor)
{
Mat& mGr1 = *(Mat*)addrGray1;
Mat& descriptors_1 = *(Mat*)addrdescrptor;
vector<KeyPoint> keypoint_1;
//Do some processing here..
return keypoint_1;
}
}
If not please suggest me some altenative way to achieve it. am new in opencv.