1

I am working on google Colab and for the pre-installed opencv the functionality works fine, but i want to use "BRISQUE" which is not fully released but can be installed with opencv-contrib. There are methods which are followed but they are not for google colab. So not working for me.I actually want "quality" module from opencv-contrib to be appended to my opencv. The link to the module is https://github.com/opencv/opencv_contrib/tree/master/modules/quality

Screenshot of sample program is attached which is giving error..

enter image description here

Any help would be appreciated. Thanks in advance.

marco romelli
  • 1,143
  • 8
  • 19
ColabAli
  • 21
  • 1
  • 3
  • 1
    The package you need is `opencv-contrib-python` and you can install it running `!pip install opencv-contrib-python`. – marco romelli Jan 21 '20 at 13:27
  • when i run !pip install opencv-contrib-python, it shows Requirement already satisfied. But the result i want is to use the quality module of opencv-contrib, which still gives error. the hider file quality.hpp is unknown to google colab. @marcoromelli – ColabAli Jan 21 '20 at 15:50
  • You can't run C++ code in Google Colab. You have to use Python. – marco romelli Jan 22 '20 at 09:02
  • That isn't true @marcoromelli . As i had successfully done a few. This is one of the few links you could try on google colab "https://www.wikihow.com/Run-CUDA-C-or-C%2B%2B-on-Jupyter-(Google-Colab)" you can run c++ code by putting %cu on top of the Cell – ColabAli Jan 23 '20 at 05:40
  • Ok so it doesn't make sense to install `opencv-contrib-python`. I guess you'll have to recompile OpenCV from source including the "contrib" module: https://docs.opencv.org/4.2.0/d7/d9f/tutorial_linux_install.html – marco romelli Jan 23 '20 at 08:27
  • @marcoromelli, I tried many methods, one of which was to 1) download opencv latest from gethub, 2) extract it and then make an empty folder name build inside it 3)then download opencv-contrib from get hub and extract it. 4)then configure and build opencv-contrib modules inside build directory, I did all these, and build was also successful, and i can see the module i wanted in opencv/build/module but when i try header of that module #include. i still get the same error – ColabAli Jan 23 '20 at 08:41

1 Answers1

1
!pip install  opencv-python==3.4.2.17
!pip install  opencv-contrib-python==3.4.2.17
import cv2 

this worked for me. Load cv2 in the same cell. IF you load seperately, it takes a default version

haritha c
  • 111
  • 1
  • 3