添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
暴躁的石榴  ·  OpenCV ...·  3 月前    · 
瘦瘦的棒棒糖  ·  OpenCV 4基础篇| ...·  3 月前    · 
微醺的荔枝  ·  go - Gorilla ...·  2 年前    · 
考研的乌龙茶  ·  java 获取图片地址 ...·  2 年前    · 
孤独的炒面  ·  Using datasource in a ...·  2 年前    · 

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

Expected behaviour

I didn't expect this error. I checked various forums about this issue, like StackOverflow or this GitHub repo and it seems to be caused by conflicting installation of opencv but I checked and I have only one version of the package installed ( opencv-python )

Actual behavior

I receive the following error :

Traceback (most recent call last):
  File "[...]/pattern.py", line 7, in <module>
    ss = cv2.ximgproc.segmentation.createSelectiveSearchSegmentation()
AttributeError: module 'cv2' has no attribute 'ximgproc'

Steps to reproduce

  • Run the following file
  • import cv2
    img = cv2.imread("image.jpg")
    # Create a Selective Search object
    ss = cv2.ximgproc.segmentation.createSelectiveSearchSegmentation()
    # Set the input image
    ss.setBaseImage(img)
    # Run the selective search algorithm
    ss.switchToSelectiveSearchFast()
    rects = ss.process()
    # Show the results
    for i, rect in enumerate(rects):
        x, y, w, h = rect
        cv2.rectangle(img, (x, y), (x+w, y+h), (0, 255, 0), 2)
    cv2.imshow("Selective Search", img)
    cv2.waitKey(0)
  • operating system & architecture : I use Ubuntu 22.04 (x86-64)
  • opencv-python version : opencv_python-4.7.0.72 with Python 3.10.6
  • I used to following methods to try to mitigate this issue:

  • I uninstalled opencv-python and checked that it was not installed anymore.
  • I purged the download cache of pip
  • I installed opencv-python with pip.
  • 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