3

I have downloaded the file opencv_contrib_python-4.4.0.46-cp38-cp38-manylinux2014_x86_64.whl from https://pypi.org/project/opencv-contrib-python/4.4.0.46/#files

I open the whl file and see that it contains a folder called opencv_contrib_python.libs which contains the following files:

enter image description here

I'm looking for the source code for these so files so I download the source code opencv-contrib-python-4.4.0.46.tar.gz from the same link above and extracted it but I do not see the source code for any of the files e.g libavformat-06a336f2.so.58.61.100

I then built the opencv contrib project code using the cmake flag OPENCV_EXTRA_MODULES_PATH like so:

cmake ../opencv-contrib-python-4.4.0.46/opencv/ -D OPENCV_EXTRA_MODULES_PATH=../opencv-contrib-python-4.4.0.46/opencv_contrib/modules/

But I do not see any of these files getting built.

How do I get the source fof these modules? I need to modify one of them and need to need to ensure I have it built and linked correctly with OpenCV.

Community
  • 1
  • 1
Harry Boy
  • 4,159
  • 17
  • 71
  • 122
  • 2
    you see libQt mentioned? libcrypto? those are external dependencies, not part of OpenCV's source. – Christoph Rackwitz Oct 04 '21 at 23:36
  • How do I get them? And how do I include them as part of the wheel package? I can build ffmpeg on its own but its .so files do not have the same name as above e.g libavformat-06a336f2.so.58.61.100?? – Harry Boy Oct 04 '21 at 23:49
  • this contains all the required recipes to build the package that is published on PyPI: https://github.com/opencv/opencv-python – Christoph Rackwitz Oct 04 '21 at 23:52
  • I have set export ENABLE_CONTRIB=1 and ran pip wheel . -v and the wheel file is produced but I still do not see the folder opencv_contrib_python.libs inside the wheel. Am I missing any steps? – Harry Boy Oct 05 '21 at 12:32
  • https://github.com/opencv/opencv_contrib – Miki Oct 05 '21 at 12:37
  • If I run $ cmake -DOPENCV_EXTRA_MODULES_PATH=/modules it does not produce the wheel file. And if I export ENABLE_CONTRIB=1 and run pip wheel . -v the wheel file is produced but I still do not see the folder opencv_contrib_python.libs inside the wheel. What am I doing wrong? – Harry Boy Oct 05 '21 at 13:00
  • "it does not produce the wheel file" means it *failed*? I'm sure it's spewing a lot of log output. that *might* be important. – Christoph Rackwitz Oct 05 '21 at 14:33
  • No it has not failed, the cmake step does not appear to output a wheel file. It builds all the contrib modules and puts them in the lib folder correctly. – Harry Boy Oct 05 '21 at 15:59

2 Answers2

2

The libraries created depend on the platform you are building your code and it should have all required libraries and tools(like gcc, python includes etc). The libraries which you mentioned are a part of ffmpeg, qt, x11 which are part of screen capture and video creator/converter. Opencv depend on them for its functioning. Recently I built ffmpeg on sles platform from source and created those libraries successfully. I can tell more about your issue if you can ping me the logs of building opencv using cmake, before make install.

0

Try building the source from https://github.com/opencv/opencv_contrib with command

cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib-master/modules ../../opencv-contrib-python-4.4.0.46/opencv Then do :- make -j5

Download python source also and set its include(Python-3.6.13/Include/) to $PYTHON_INCLUDE_DIRS. Set other cmake directives as required. For more info check link