opencv-python
opencv-python copied to clipboard
cv2.findEssentialMat w/ USAC_ACCURATE throws LAPACK/Eigen error from pypi wheel
Expected behaviour
I expect the library not to crash or throw an error:
Actual behaviour
error: OpenCV(4.5.3) /tmp/pip-req-build-l1r0y34w/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'
but I installed this from the pypi wheel. I would expect auditwheel
or delocate
to have provided the Eigen dependencies
Steps to reproduce
- example code
!pip install opencv_python==4.5.3.56
then
i2Ei1, inlier_mask = cv2.findEssentialMat(
uv_norm_i1[match_indices[:, 0]],
uv_norm_i2[match_indices[:, 1]],
K,
method=cv2.USAC_ACCURATE,
threshold=self._estimation_threshold_px / fx,
prob=RANSAC_SUCCESS_PROB,
)
- operating system + architecture (e.g. x86)
uname -a
Linux 9f3c72e6a869 5.4.104+ #1 SMP Sat Jun 5 09:50:34 PDT 2021 x86_64 x86_64 x86_64 GNU/Linux
- opencv-python version
import cv2
cv2.__version__
4.5.3
Issue submission checklist
- [X] This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
- [X] I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
- [X] The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
- [X] I'm using the latest version of
opencv-python
Eigen is header-only library, it's not visible in list of shared libraries or dependencies. The issue is our CI miss-configuration. I'll check scripts and come back with the issue resolution.
Thanks!
Hi @asmorkalov, just wanted to check back with you about this.
I noticed that in the 4.5.0 opencv distribution, eigen/lapack are properly packaged.
But in other later versions, such as 4.5.3, the packaging is broken. Was there a major change in the packaging between those versions?
@johnwlambert The dependency is broken by mistake. We are working on infrastructure fix for the next release.
Hi @johnwlambert, the issue was fixed in https://github.com/opencv/opencv-python/pull/547 and merged into master
. The next release of packages will upload fixed wheels.
Very nice, thanks @asenyaev for the patch. Do you know when the next release will be published?
OpenCV 4.5.4 is already published in core repository: https://github.com/opencv/opencv/releases/tag/4.5.4. Python packages will be ready in a week or so.
OpenCV-Python 4.5.4 packages just released to Pypi. LAPACK is enabled for all Linux configurations, MacOS (accelerate framework), but not Windows. The team will work on Windows support for the next release.
Thank you! Confirmed on my end that the issue is resolved.
Sounds great!. I reopen the issue as Windows configuration is not ready.
hello @asmorkalov
With WIN 10 I have the same problem and I am getting the error
error: OpenCV(4.5.5) D:\a\opencv-python\opencv-python\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 'cv::usac::EssentialMinimalSolverStewenius5ptsImpl::estimate'
cv.version Out[8]: '4.5.5'
I have installed LAPACK and Eigen using conda with
conda install -c conda-forge lapack conda install -c conda-forge eigen
Then I downgraded to version 4.5.1.48. But this generated other errors related to Camera Calibration and 3D Reconstriction functions
Yes. Windows packages does not contain LAPACK and the function is available on Linux and Mac for now. We are looking for good enough LAPACK implementation for Windows to cover all platforms.
hello @asmorkalov
Do you have any updates for USAC OpenCV implementation for windows?
In my study, I want to use both RANSAC and USAC implementations.
best regards
Hello @mfatih7 We have some build issues with LAPACK and binaries distribution for now. Unfortunately I cannot guarantee that it'll be fixed before the next release.