&引用;OpenCV错误:功能/特性未实现;在Android应用程序上
我正在使用ndk构建的原生Android应用程序上使用OpenCV(3.2版)。 我犯了一个我绕不过去的错误&引用;OpenCV错误:功能/特性未实现;在Android应用程序上,android,c++,opencv,android-ndk,opencv3.0,Android,C++,Opencv,Android Ndk,Opencv3.0,我正在使用ndk构建的原生Android应用程序上使用OpenCV(3.2版)。 我犯了一个我绕不过去的错误 E/cv::error(): OpenCV Error: The function/feature is not implemented (Unknown/unsupported array type) in int cv::_InputArray::type(int) const, file /build/master_pack-android/opencv/modules/core/
E/cv::error(): OpenCV Error: The function/feature is not implemented (Unknown/unsupported array type) in int cv::_InputArray::type(int) const, file /build/master_pack-android/opencv/modules/core/src/matrix.cpp, line 1931
A/libc: Fatal signal 6 (SIGABRT) at 0x00001f38 (code=-6), thread 8011 (CameraHandlerTh)
通过使用调试器,我找到了引发此错误的代码部分。
cv::findHomography()代码>
void Homography33::compute(){
如果(有效)返回;
std::载体标的;
std::载体dPts;
用于(int i=0;i以供将来参考
搜索了一会儿之后
我使用的外部模块(即ros indigo)包含较旧版本的OpenCV。它与我使用的较新版本(OpenCV 3.2)冲突
解决方案是将android.mk(或cmake)中的两个模块分开
但是在那之后,对于ndk build用户,将无法在模块之间正确找到包含文件…您可以获得整个堆栈跟踪吗?(至少是与OpenCV相关的帧)
void Homography33::compute() {
if ( valid ) return;
std::vector<cv::Point2f> sPts;
std::vector<cv::Point2f> dPts;
for (int i=0; i<4; i++) {
sPts.push_back(cv::Point2f(srcPts[i].first, srcPts[i].second));
}
for (int i=0; i<4; i++) {
dPts.push_back(cv::Point2f(dstPts[i].first - cxy.first, dstPts[i].second - cxy.second));
}
cv::Mat homography = cv::findHomography(sPts, dPts); // throws error
for (int c=0; c<3; c++) {
for (int r=0; r<3; r++) {
H(r,c) = homography.at<double>(r,c);
}
}
valid = true;
}