Comments (22)
Just to be more specific, I've encountered this problem when using cv2.imshow()
and cv2.waitKey()
.
from opencv-python.
I suggest we consider to publish an OpenCV python module with Gtk/Qt support.
Today I spent serval hours on building OpenCV from scratch in order to use cv2.imshow()
, it's very painful.
If add new dependency is a problem, how about publishing a new module with Gtk/Qt support, like opencv-python-gtk and opencv-python-qt ?
from opencv-python.
You can fork the repo and try to tune the build scripts. First you should try to install GTK+ 2.x to the CentOS container (yum install gtk2
might be enough) and after that make OpenCV build scripts to find it. After that write some test scripts which utilize for example cv2.imshow() to confirm that the build was ok.
from opencv-python.
This still needs to be fixed badly. Any progress on this critical issue?
OpenCV is rather useless for computer vision if you can't use it to efficiently display output.
from opencv-python.
The error says: "Rebuild the library with Windows, GTK+ 2.x or Carbon support.". OpenCV needs to be compiled with GTK support (WITH_GTK=ON
). Currently I'm too busy to add support for this, but I'll have a look at the issue as soon as I have more spare time. Same thing with ffmpeg on Linux. Testing the builds is very time consuming stuff.
from opencv-python.
It's because of 'opencv-python-headless'. Uninstall it!
pip uninstall opencv-python-headless
from opencv-python.
The release builds for 3.3.0.10 are now in progress and the GUI supported wheels should be available to install during the next couple of hours. Please report if you have any issues with them.
from opencv-python.
Hi, I did run into an issue with headless (docker) versions of ubuntu. #44 I think anyone running opencv-python in a cloud environment without X11 is going to have the same issue.
from opencv-python.
I'll try to compile the packages with GTK to avoid separate packages. I hope that auditwheel / delocate can handle the dependencies automatically and embed them to the wheels. For this to work I have to fork the manylinux CentOS 5 containers and build GTK support to them manually since the default GTK provided in the EL5 repos is too old (2.10 and OpenCV needs at least 2.18). This should be easy with Docker. For macOS I'll have to go with homebrew and hope that the build times don't get too long.
from opencv-python.
pip install opencv-python fixed this issue for me
from opencv-python.
This one work for me on facefusion installation
pip uninstall opencv-python-headless -y
pip install opencv-python --upgrade
from opencv-python.
I have been testing different build setups during the last two weeks. Building newer version of GTK was too complicated so instead of GTK I built Qt 4.8.7 manually on the manylinux containers. These new customized containers seem to be working fine and the Linux wheels should have GUI support in the upcoming releases.
I'll see if I can enable Qt on macOS builds too.
EDIT: Looks like I can build with Qt 4.8.7 also on macOS (Qt was preinstalled on the Travis macOS images).
from opencv-python.
On which OS you get this error? The error appears because OpenCV provided by this repo has not been built with GTK support (it can be enabled, but it requires work at least on Linux due to the Cent OS 5 containers).
from opencv-python.
Ubuntu 16.04
from opencv-python.
it would be very convenient for us to get this working, is there anything I can do to help?
from opencv-python.
Hi. Any progress on this?
from opencv-python.
I haven't had time to look at this.
from opencv-python.
I have an idea how this could be implemented. However, introducing a new dependency (GTK) without breaking the library import on every system is not an easy task. After all, there are hundreds of GNU/Linux distributions which don't necessarily have GTK binaries easily available (including the Cent OS 5 containers where the packages are built). Implementing this will take time and surely you know that I'm doing this for free on my limited free time.
Additionally, I don't think that OpenCV is useless without GUI features. It was never meant to be a comprehensive GUI framework. It might be good for showing images for debugging purposes, but there are many better ways to draw the images on the screen if needed. Here are few suggestions:
- matplotlib
- PIL (pillow)
- scikit-image
- tkinter
- kivy
And you can always build OpenCV from sources.
from opencv-python.
I second having two additional modules for gtk and qt. I found that qt was easier to get working than gtk, but I'm on Ubuntu, so it wasn't super difficult. I don't think Cent OS 5 has either GTK+ 2.x (which is what imshow requires) or Qt by default, so that might not work for skvark.
@skvark - I've tried using those libraries for my purposes, however sometimes that requires rewriting large portions of code that already should work with OpenCV to instead work with another image display library. Another problem is performance, OpenCV displays images fast, which is definitely important for demo-ing a live feed from a tracking network (for example).
from opencv-python.
Get exact a same error, any idea on the a best way to fix this?
from opencv-python.
Should I be using a different IDE to avoid this error? I'm currently using Xcode 9.
from opencv-python.
Could you elabolarate a bit more what it is excatly you're trying to do? This issue has been closed over a year ago. All recent opencv-python
(given that you installed opencv-python
as described in the README) releases have GUI support. The IDE you use is not related to this library in any way.
from opencv-python.
Related Issues (20)
- PyPI: macOS arm64 wheel missing HOT 2
- cv2.createThinPlateSplineShapeTransformer not exist in 4.10
- imdecode jpeg2000 segfault or deadlock in multithreading HOT 4
- Typing of compare does not allow scalar for src1 or src2
- Why Building wheel for opencv-python when using "pip install opencv-python"
- Typing stubs generation has failed when building wheel HOT 1
- error: OpenCV(4.9.0) D:\a\opencv-python\opencv-python\opencv\modules\dnn\src\layers\convolution_layer.cpp:396: error: (-2:Unspecified error) Number of input channels should be multiple of 3 but got 4 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'
- Gstreamer support on windows 10 HOT 1
- why ı am getting this error HOT 1
- QRCodeDetector() not working
- [Suggestion] Metapackage as solution to current issues with opencv as dependency HOT 2
- Build from source python 3.12 fails HOT 6
- error: OpenCV(4.8.0) /io/opencv/modules/core/src/copy.cpp:71: error: (-215:Assertion failed) cn <= 4 in function 'scalarToRawData'
- ModuleNotFoundError: No module named 'distutils' in latest release HOT 10
- MacOS arm64 wheels missing from PyPI 4.10 release HOT 2
- ImportError: numpy.core.multiarray --- Numpy 2.0.0 HOT 1
- cv2/cv2.abi3.so, 2): Library not loaded: /usr/local/opt/libunistring/lib/libunistring.2.dylib Referenced from: /usr/local/opt/gnutls/lib/libgnutls.30.dylib HOT 1
- When will opencv-python support numpy 2.0? HOT 6
- compile bug
- AttributeError: module 'numpy' has no attribute 'object'. `np.object` was a deprecated alias for the builtin `object`. To avoid this error in existing code, use `object` by itself. Doing this will not modify any behavior and is safe. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv-python.