"OpenCV Error: The function/feature is not implemented" on Android app

"OpenCV Error: The function/feature is not implemented" on Android app

我正在使用 ndk-build 在本机 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/src/matrix.cpp, line 1931
A/libc: Fatal signal 6 (SIGABRT) at 0x00001f38 (code=-6), thread 8011 (CameraHandlerTh)

通过使用调试器,我找到了引发此错误的代码部分。 cv::findHomography();

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;
}

有什么想法吗?

提前致谢,

供日后参考。

经过一段时间的搜索...

我正在使用包含旧版本 OpenCV 的外部模块(即 ros indigo)。它与我使用的较新版本 (OpenCV 3.2) 冲突。

解决方案是在 android.mk(或 cmake)中将两个模块分开。

但之后,对于 ndk-build 用户,将无法跨模块正确找到包含文件...Whosebug post