Build opencv with LAPACK/EIGEN for ios/android

In my project I need to use the optimized version of ransac(cv::USAC_FAST) like this:

cv::findEssentialMat(ref_points, curr_points, 1.0,
cv::Point2d(0, 0), cv::USAC_FAST, confg,
thre, status_e);
I’m getting this error while running on ios:

terminating with uncaught exception of type cv::Exception: OpenCV(4.5.1) /Users/shir.barzel/opencv/modules/calib3d/src/usac/essential_solver.cpp:197: error: (-213:The function/feature is not implemented) To use essential matrix solver LAPACK or Eigen has to be installed! in function ‘estimate’

as I understand I need EIGEN or LAPACK
There is no option for that in the:
opencv/platforms/ios/ script
so I’ve tried to add the cmake flags:
WITH_EIGEN or WITH_LAPACK to the script, but it’s doesn’t really works
anyone has some tutorial on how to do it?

cant help with LAPACK, but adding Eigen support should be as easy as:

  • download : and unzip
    (it is a “headers only” lib, no “install” needed)
  • WITH_EIGEN=ON (cmake)
  • EIGEN_INCLUDE_PATH=/path/to/Eigen_toplevel_folder (cmake)

carefully observe the cmake output,
it should show up under " Other third-party libraries:"