Skip to content

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

Open

Description

@johnwlambert

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

Activity

  1. asmorkalov commented on Sep 10, 2021

    @asmorkalov
    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.

  2. johnwlambert commented on Sep 10, 2021

    @johnwlambert
    Author

    Thanks!

  3. johnwlambert commented on Sep 27, 2021

    @johnwlambert
    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?

  4. asmorkalov commented on Sep 28, 2021

    @asmorkalov
    Collaborator

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

  5. added a commit that references this issue on Oct 7, 2021
  6. asenyaev commented on Oct 8, 2021

    @asenyaev
    Contributor

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

  7. johnwlambert commented on Oct 8, 2021

    @johnwlambert
    Author

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

  8. asmorkalov commented on Oct 11, 2021

    @asmorkalov
    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.

  9. asmorkalov commented on Oct 21, 2021

    @asmorkalov
    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.

  10. johnwlambert commented on Oct 21, 2021

    @johnwlambert
    Author

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

  11. asmorkalov commented on Oct 22, 2021

    @asmorkalov
    Collaborator

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

  12. mfatih7 commented on May 16, 2022

    @mfatih7

    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

  13. mfatih7 commented on May 16, 2022

    @mfatih7

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

  14. asmorkalov commented on May 16, 2022

    @asmorkalov
    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.

  15. mfatih7 commented on Sep 23, 2022

    @mfatih7

    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

  16. asmorkalov commented on Sep 25, 2022

    @asmorkalov
    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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions