I slightly changed the code of the Tutorial 2 Advanced Mix Java + Native. The C++ code looks as follows
#include <jni.h>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/video/tracking.hpp>
#include <opencv2/contrib/contrib.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <vector>
using namespace std;
using namespace cv;
extern "C" {
JNIEXPORT void JNICALL Java_com_droidnova_android_tutorial2d_Panel_FindFeatures(JNIEnv* env, jobject thiz, jlong addrGray, jlong addrRgba)
{
Mat* pMatGr=(Mat*)addrGray;
Mat* pMatRgb=(Mat*)addrRgba;
for (int i = 0; i < pMatRgb.rows; i++) {
}
}
}
It is not doing anything but I want to iterate through rows of the mat. But here it is a pointer to the mat and I get the following error message: error: request for member 'rows' in 'pMatRgb', which is of non-class type 'cv::Mat*'
How to convert it into Mat so I will be able to run the above code?