janza / docker-python3-opencv Goto Github PK
View Code? Open in Web Editor NEW๐ ๐ ๐ Docker image with python 3 and opencv 4.1
Home Page: https://hub.docker.com/r/jjanzic/docker-python3-opencv
License: MIT License
๐ ๐ ๐ Docker image with python 3 and opencv 4.1
Home Page: https://hub.docker.com/r/jjanzic/docker-python3-opencv
License: MIT License
Upon trying to build the image, with:
docker build -t 'opencv' .
I get E: Unable to locate package libjasper-dev
according to:
https://stackoverflow.com/questions/43484357/opencv-in-ubuntu-17-04/44488374#44488374
one should add some repository. This solution did not work for me.
`
Scanning dependencies of target gen_opencv_python_source
[ 98%] Generate files for Python bindings and documentation
Note: Class Feature2D has more than 1 base class (not supported by Python C extensions)
Bases: cv::Algorithm, cv::class, cv::Feature2D, cv::Algorithm
Only the first base class will be used
Note: Class detail_GraphCutSeamFinder has more than 1 base class (not supported by Python C extensions)
Bases: cv::detail::GraphCutSeamFinderBase, cv::detail::SeamFinder
Only the first base class will be used
[ 98%] Built target gen_opencv_python_source
Scanning dependencies of target opencv_python3
[ 98%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir//src2/cv2.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-6/README.Bugs for instructions.
make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir//src2/cv2.cpp.o] Error 4
make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
make: *** [all] Error 2
modules/python3/CMakeFiles/opencv_python3.dir/build.make:62: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o' failed
CMakeFiles/Makefile2:3212: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
Makefile:160: recipe for target 'all' failed
`
Can we rename the docker image?
If we use this name (jjanzic/python3-opencv
) would be more appropriate,
Instead of using this name (jjanzic/docker-python3-opencv
).
And also tags.
opencv-4.0.0
contrib-opencv-4.0.0
4.0.0
4.0.0-contrib
$ # Current
$ docker container run -it jjanzic/docker-python3-opencv:opencv-4.0.0 python
$ docker container run -it jjanzic/docker-python3-opencv:contrib-opencv-4.0.0 python
$ # New
$ docker container run -it jjanzic/python3-opencv:4.0.0 python
$ docker container run -it jjanzic/python3-opencv:4.0.0-contrib python
Greeting,
I ran this Dockerfile on my unbuntu VM, with a minor change in the first line as "from python". After it's done I tried import cv2, but got
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'
Do I miss anything? Thanks,
Chun-Yen
How to fix this error message?
begueradj@h4ck3r:~$ sudo docker run -it jjanzic/docker-python3-opencv python
Python 3.6.4 (default, Feb 17 2018, 09:32:33)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
******************************************************************
* FATAL ERROR: *
* This OpenCV build doesn't support current CPU/HW configuration *
* *
* Use OPENCV_DUMP_CONFIG=1 environment variable for details *
******************************************************************
Required baseline features:
SSE - OK
SSE2 - OK
SSE3 - OK
SSSE3 - OK
SSE4.1 - OK
POPCNT - OK
SSE4.2 - OK
AVX - NOT AVAILABLE
OpenCV(3.4.1) Error: Assertion failed (Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup.) in initialize, file /opencv-3.4.1/modules/core/src/system.cpp, line 487
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(3.4.1) /opencv-3.4.1/modules/core/src/system.cpp:487: error: (-215) Missing support for required CPU baseline features. Check OpenCV build configuration and required CPU/HW setup. in function initialize](url)
in the docker hub page it says the tag opencv-4.1.0
is present in the documentation, but looking at the available tags I cannot find it, think you may have accidentally only released it as latest
. see https://hub.docker.com/r/jjanzic/docker-python3-opencv/builds
To use OpenCV 4.0.1 instead of 4.0.0, is it just a matter of changing the OPENCV_VERSION
variable?
I could submit a pull request.
Thanks.
How to use imshow from inside container?
I am getting the following error:
OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /opencv-3.4.0/modules/highgui/src/window.cpp, line 611
Traceback (most recent call last):
File "", line 1, in
cv2.error: /opencv-3.4.0/modules/highgui/src/window.cpp:611: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage
maybe this is a very silly question. I think docker can't have GUI. so any gui related function should not work with this docker image?
[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1076)
Attempting to run camodet_python I get:
OpenCv version: 4.1.1
Video Height 1944 Width 2592
Traceback (most recent call last):
File "/app.py", line 300, in <module>
main()
File "/app.py", line 292, in main
if( (cv2.waitKey(1) & 0xFF) == ord('q') ):
cv2.error: OpenCV(4.1.1) /opencv-4.1.1/modules/highgui/src/window.cpp:693: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvWaitKey'
Taking the suggestion of installing libgtk2.0-dev and pkg-config before the cmake fixes it. The waitKey still doesn't actually work, and I don't really need it, but this doesn't seem like a bad additiion to your image anyway.
unzip: cannot find zipfile directory in one of 3.4.0.zip or 3.4.0.zip.zip, and cannot find 3.4.0.zip.ZIP, period.
Dear janza, i have this error:
error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow
When use things with windows, what can i do please?
When I set the same configure of you,there is an error about downloading the file ippicv_linux_20151201.tgz. Could you push the file to the github?
Request for a new build with latest opencv-python and opencv-contrib-python which includes SIFT in xfeatures2d.
I would be nice if you could give the opencv build information for each image with:
python3 -c "import cv2; print(cv2.getBuildInformation())"
the simbolic link to the cv python library should point to the installed python version, so if you use python3.9 it should be:
RUN ln -s \
/usr/local/python/cv2/python-3.9/cv2.cpython-39m-x86_64-linux-gnu.so \
/usr/local/lib/python3.8/site-packages/cv2.so
However, this hard fix is no longer needed (at least with recent cmake and latest opencv version)
I tried myself and couldn't get it working. The jasper lib has issues and I didn't get too far
OpenCV is giving a warning that this option is deprecated:
-- WARNING: Option ENABLE_AVX='ON' is deprecated and should not be used anymore
-- Behaviour of this option is not backward compatible
-- Refer to 'CPU_BASELINE'/'CPU_DISPATCH' CMake options documentation
We've been using your docker image for our testing and noticed our code started failing today on automated builds due to the upgrade.
We reverted to contrib-opencv-3.4.1
but that has an older version of cmake.
Can you release a version of contrib which was pushed 3 months ago in August?
Hi,
I think these tags doesn't work correctly.
tags: opencv-4.0.0, contrib-opencv-4.0.0
$ docker container run -it jjanzic/docker-python3-opencv:opencv-4.0.0 python
Unable to find image 'jjanzic/docker-python3-opencv:opencv-4.0.0' locally
opencv-4.0.0: Pulling from jjanzic/docker-python3-opencv
54f7e8ac135a: Already exists
d6341e30912f: Already exists
087a57faf949: Already exists
5d71636fb824: Already exists
0c1db9598990: Already exists
bfb904e99f24: Already exists
78a3d3a96a32: Already exists
885a0ed92c89: Already exists
dd7cc9ace242: Already exists
a24a072f8608: Pull complete
a64f3f9c9555: Pull complete
4212a3a34e29: Pull complete
Digest: sha256:cf8c2f8a00c9bdc35ade7894bfa8f68b70434f4534d097ec0ea4069134f47784
Status: Downloaded newer image for jjanzic/docker-python3-opencv:opencv-4.0.0
Python 3.7.1 (default, Nov 16 2018, 22:26:09)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'
$ docker container run -it jjanzic/docker-python3-opencv:contrib-opencv-4.0.0 python
Unable to find image 'jjanzic/docker-python3-opencv:contrib-opencv-4.0.0' locally
contrib-opencv-4.0.0: Pulling from jjanzic/docker-python3-opencv
54f7e8ac135a: Already exists
d6341e30912f: Already exists
087a57faf949: Already exists
5d71636fb824: Already exists
0c1db9598990: Already exists
bfb904e99f24: Already exists
78a3d3a96a32: Already exists
885a0ed92c89: Already exists
dd7cc9ace242: Already exists
a07329d466c4: Pull complete
57e9858ba364: Pull complete
64f7b9be4e22: Pull complete
2ffe99e25909: Pull complete
Digest: sha256:de9bd86415472aabbdec81ef2295e57baeb8525a4e40d3d4c3cca16d98bcb0d8
Status: Downloaded newer image for jjanzic/docker-python3-opencv:contrib-opencv-4.0.0
Python 3.7.1 (default, Nov 16 2018, 22:26:09)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'
Thanks gorogoroyasu for this pull request.
The solution worked for me.
$ docker container run -it jjanzic/docker-python3-opencv:contrib-opencv-4.0.0 bash
root@fa545d0bd227:$ python3 -c "import cv2; print(cv2.__version__)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'cv2'
root@fa545d0bd227:$ ln -s /usr/local/python/cv2/python-3.7/cv2.cpython-37m-x86_64-linux-gnu.so /usr/local/lib/python3.7/site-packages/cv2.so
root@fa545d0bd227:$ python3 -c "import cv2; print(cv2.__version__)"
4.0.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.