OpenCV GTK+2.x error

前端 未结 14 2100
轮回少年
轮回少年 2020-12-03 07:16

I had installed OpenCV following these steps (). After trying to compile one examples,i got this error :

OpenCV Error: Unspecified error (The function is no         


        
相关标签:
14条回答
  • 2020-12-03 08:01

    I have had to deal with this issue a couple of times, this is what has worked consistently thus far:

    conda remove opencv
    conda install -c menpo opencv
    pip install --upgrade pip
    pip install opencv-contrib-python
    
    0 讨论(0)
  • 2020-12-03 08:06

    I tried several of the answers mentioned above the one that worked for me in ubuntu is mentioned in the following steps:

    1. Firstly, remove the current opencv package that is installed in your system by typing in the following command in the terminal conda remove opencv.
    2. If your python version is 3.6 or above then change it into the stable version which can be done by typing in conda install python=3.5.
    3. Later on install the opencv package again by giving the following input in terminal conda install -c menpo opencv3
    0 讨论(0)
  • 2020-12-03 08:08

    @oxydron/Elliott Miller: I have Ubuntu 16.04 LTS environment with gtk 3 pre installed. I got the same error for Caffe build (master branch), Try the following steps, may be it should work for you.

    sudo apt-get install libgtk-3-dev
    cmake .. (WITH_GTK=ON and other settings), 
    make
    

    And bingo the error was gone... in my python caffe code

    Please note:

    The CMAKE configuration should reflect GTK+ 3.x instead of GTK+ 2.x

           GUI: 
    --     QT:                          NO
    --     GTK+ 3.x:                    YES (ver 3.18.9)
    --     GThread :                    YES (ver 2.48.2)
    --     GtkGlExt:                    NO
    --     OpenGL support:              NO
    --     VTK support:                 NO
    
    0 讨论(0)
  • 2020-12-03 08:08

    I had the same problem, and fixed it by simply reinstalling opencv.

    There is no need to uninstall it first.

    0 讨论(0)
  • 2020-12-03 08:09

    I have the solved using Anaconda 3 installing on Ubuntu 16.04.

    I have used pycharm editor for my python code.

    I am using python 3.6 version.

    I solved the issue using these processes.

    IDEA: we need to install the package opencv-contrib-python package from the pycharm.

    0 讨论(0)
  • 2020-12-03 08:10

    For me (Arch Linux, Anaconda with Python 3.6), installing from the suggested channels menpo or loopbio did not change anything. My solution was to

    1. install pkg-config (sudo pacman -Syu pkg-config),
    2. remove opencv from the environment (conda remove opencv) and
    3. re-install opencv from the conda-forge channel (conda install -c conda-forge opencv)

    conda list now returns opencv 3.3.0 py36_blas_openblas_203 [blas_openblas] conda-forgeand all windows launched using cv2 are working fine.

    0 讨论(0)
提交回复
热议问题