Skip to content

New version of opencv-python gets isntalled, stitching does not work with it #298

Closed

Description

@Hirmuolio

When stitching is installed it installs opencv-python version 5.0.0.93. But stitching does not work with that and gets error AttributeError: module 'cv2' has no attribute 'BRISK_create'.

user@pc:~/python_scripts$ uv venv test --python 3.13
Using CPython 3.13.11
Creating virtual environment at: test
Activate with: source test/bin/activate
user@pc:~/python_scripts$ source test/bin/activate
(test) user@pc:~/python_scripts$ uv pip install stitching
Using Python 3.13.11 environment at: test
Resolved 6 packages in 159ms
Prepared 3 packages in 1.31s
Installed 6 packages in 16ms
 + largestinteriorrectangle==0.2.1
 + llvmlite==0.49.0
 + numba==0.67.0
 + numpy==2.5.2
 + opencv-python==5.0.0.93
 + stitching==0.6.1
(test) user@pc:~/python_scripts$ stitch s/*.png --output "s.png" --affine --try_use_gpu --blender_type "feather" --no-crop --blend_strength 1
Traceback (most recent call last):
  File "/home/user/python_scripts/test/bin/stitch", line 4, in <module>
    from stitching.cli.stitch import main
  File "/home/user/python_scripts/test/lib/python3.13/site-packages/stitching/__init__.py", line 1, in <module>
    from .stitcher import AffineStitcher, Stitcher  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/python_scripts/test/lib/python3.13/site-packages/stitching/stitcher.py", line 10, in <module>
    from .feature_detector import FeatureDetector
  File "/home/user/python_scripts/test/lib/python3.13/site-packages/stitching/feature_detector.py", line 9, in <module>
    class FeatureDetector:
    ...<38 lines>...
            return cv.drawKeypoints(img, keypoints, None, **kwargs)
  File "/home/user/python_scripts/test/lib/python3.13/site-packages/stitching/feature_detector.py", line 16, in FeatureDetector
    DETECTOR_CHOICES["brisk"] = cv.BRISK_create
                                ^^^^^^^^^^^^^^^
AttributeError: module 'cv2' has no attribute 'BRISK_create'

The requirements.txt says opencv-python==4.10.0.84 but for some reason that gets ignored and newer version is installed instead.

Forcing intallation of older version fixes this uv pip install --force-reinstall -v "opencv-python==4.10.0.84".

Activity

  1. lukasalexanderweber commented on Aug 14, 2026

    @lukasalexanderweber
    Member

    Thanks for reporting! The Tests fail when upgrading to 5.x: #299. Feel free to propose a fix, If not I'll look into it when I have time

  2. lukasalexanderweber commented on Aug 14, 2026

    @lukasalexanderweber
    Member

    requirements.txt is only used for testing/local development. https://github.com/OpenStitching/stitching/blob/main/setup.cfg is responsible for the package manager and does not have upper bounds (and it shouldnt), I rather want to adjust stitching to the breaking changes of 5.x

  3. lukasalexanderweber commented on Aug 14, 2026

    @lukasalexanderweber
    Member

    But till we adjust to 5.x it might even be a good idea to introduce an upper bound

  4. lukasalexanderweber commented on Aug 14, 2026

    @lukasalexanderweber
    Member

    https://github.com/opencv/opencv/wiki/OpenCV-4-to-5-migration#features2d--features

    The following detectors and descriptors have been moved to opencv_contrib (xfeatures2d): SURF, BRIEF, FREAK, LUCID, DAISY, and several others.

  5. lukasalexanderweber commented on Aug 14, 2026

    @lukasalexanderweber
    Member

    Here the cleanup for stitching_detailed: opencv/opencv#25292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    can be reproducedimage data is available so the discussed topic can be reproduced

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions