简体   繁体   English

Android应用程序上出现“ OpenCV错误:功能/功能未实现”

[英]“OpenCV Error: The function/feature is not implemented” on Android app

I am working with OpenCV (version 3.2) on an Native Android app using ndk-build. 我正在使用ndk-build在本机Android应用程序上使用OpenCV(3.2版)。 I got an error that I cannot get around. 我遇到一个我无法解决的错误。

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)

By using the debugger I found the code part that throws this error. 通过使用调试器,我发现了引发此错误的代码部分。 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;
}

Any idea ? 任何想法 ?

Thanks in advance, 提前致谢,

For futur reference. 供将来参考。

After searching for a while... 搜索了一段时间之后...

I am using external module (namely ros indigo) that contains an older version of OpenCV. 我正在使用包含旧版OpenCV的外部模块(即ros indigo)。 it clashes with the newer version i'm using (OpenCV 3.2). 它与我使用的较新版本(OpenCV 3.2)冲突。

The solution is to separate the two modules in your android.mk (or cmake). 解决方案是将android.mk(或cmake)中的两个模块分开。

BUT after that, for ndk-build users, include files won't be find correctly across modules... stackoverflow post 但在那之后,对于NDK建造的用户,包括文件不会被跨模块找到正确... 计算器后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM