Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv2.findEssentialMat w/ USAC_ACCURATE throws LAPACK/Eigen error from pypi wheel #534

Open
4 tasks done
johnwlambert opened this issue Sep 1, 2021 · 15 comments
Open
4 tasks done
Assignees
Labels

Comments

@johnwlambert
Copy link

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
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • 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)
  • 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")
  • I'm using the latest version of opencv-python
@asmorkalov
Copy link
Collaborator

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.

@johnwlambert
Copy link
Author

Thanks!

@johnwlambert
Copy link
Author

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?

@asmorkalov
Copy link
Collaborator

@johnwlambert The dependency is broken by mistake. We are working on infrastructure fix for the next release.

asenyaev added a commit that referenced this issue Oct 7, 2021
@asenyaev
Copy link
Contributor

asenyaev commented Oct 8, 2021

Hi @johnwlambert, the issue was fixed in #547 and merged into master. The next release of packages will upload fixed wheels.

@johnwlambert
Copy link
Author

Very nice, thanks @asenyaev for the patch. Do you know when the next release will be published?

@asmorkalov
Copy link
Collaborator

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.

@asmorkalov
Copy link
Collaborator

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.

@johnwlambert
Copy link
Author

Thank you! Confirmed on my end that the issue is resolved.

@asmorkalov
Copy link
Collaborator

Sounds great!. I reopen the issue as Windows configuration is not ready.

@asmorkalov asmorkalov reopened this Oct 22, 2021
@mfatih7
Copy link

mfatih7 commented May 16, 2022

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

@mfatih7
Copy link

mfatih7 commented May 16, 2022

Then I downgraded to version 4.5.1.48.
But this generated other errors related to Camera Calibration and 3D Reconstriction functions

@asmorkalov
Copy link
Collaborator

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.

@mfatih7
Copy link

mfatih7 commented Sep 23, 2022

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

@asmorkalov
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants