Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Passing Camera frame in android as a Mat

In the openCV implementation of Android part I have a method called onCameraFrame() which returns the input frame

public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
mNativeDetector.match(inputFrame.rgba());
return inputFrame.rgba();
}

and in the jni side I am receiving it as

Mat mMat1 = (*((Mat*)inputMat));

But when i try to compare it I get this error

OpenCV Error: Assertion failed (type == src2.type() && src1.cols == src2.cols && (type == CV_32F || type == CV_8U)) in void cv::batchDistance(cv::InputArray, cv::InputArray, cv::OutputArray, int, cv::OutputArray, int, int, cv::InputArray, int, bool), file /home/reports/ci/slave/50-SDK/opencv/modules/core/src/stat.cpp, line 1797

How to solve this error and pass the Cameraframe mats for comparison ?

Passing Camera frame in android as a Mat

In the openCV implementation of Android part I have a method called onCameraFrame() which returns the input frame

public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
mNativeDetector.match(inputFrame.rgba());
return inputFrame.rgba();
}

and in the jni side I am receiving it as

Mat mMat1 = (*((Mat*)inputMat));

But when i try to compare it I get this error

OpenCV Error: Assertion failed (type == src2.type() && src1.cols ==  src2.cols && (type == CV_32F || type == CV_8U)) in void  cv::batchDistance(cv::InputArray, cv::InputArray, cv::OutputArray, int,  cv::OutputArray, int, int, cv::InputArray, int, bool), file  /home/reports/ci/slave/50-SDK/opencv/modules/core/src/stat.cpp, line 1797

How to solve this error and pass the Cameraframe mats for comparison ?