Giter VIP home page Giter VIP logo

qtimshow's Introduction

qtimshow

Little hack to have an imshow function like OpenCV

OpenCV and Qt are graphically incompatible. Both require ownership and also hijack program's main thread.

This module brings the Qt version of cv2.imshow. To maximize compatibility with both cases, remove prefix:

from cv2 import imshow
from qtimshow import imshow

Usage

This module requires two parts to work:

  • Attach to main thread (enable it)
import qtimshow

if __name__ == '__main__':
    ...
    app = QtGui.QApplication(sys.argv)
    qtimshow.enable()
    ....
    app.exec_()

  • Import imshow function (use it)
from qtimshow import imshow

Image types

Image type handling is too limited. Supported:

  • RGB
  • Grayscale

Any further type can be manually supported by pass the Qt's counterpart type:

from PyQt4.QtGui import QImage
imshow('a title', img_rgb, QImage.Format_RGB888)

Install

This module can be installed, added to pythonpath or just copied.

Recommended option:

mkdir -p $HOME/.python_modules
git clone https://github.com/varhub/qtimshow.git $HOME/.python_modules/qtimshow
export PYTHONPATH=$PYTHONPATH:$HOME/.python_modules
# you can add last line to .profile or .bashrc to avoid type it always

License

Program is under GPLv3 or later, copyrigth (C) 2015 Victor Arribas. You can get a copy of license from http://www.gnu.org/licenses/.

qtimshow's People

Contributors

varhub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.