An Image Widget for display OpenCV Mat image
Project description
Test reStrctueText
This is a test document for Python Package Index.
Below is a Python3 code block.
def foo():
pass
def foo():
pass
imagepyqt
A PyQt5/PySide2 Image Widget for quickly displaying OpenCV Mat Image!
Modified @ 2017.07.26 16:47:36 CST
Dependency
numpy
opencv-python (or you can compile cv2 from the OpenCV Source!)
PyQt5/PySide2
Install
$ git clone https://github.com/Image-Py/imagepyqt
$ cd imagepyqt
$ ls
...
imagepyqt/
setup.py
$ python3 setup.py install
...
Uninstall
pip3 uninstall imagepyqt
Usage
(1) To test
$ python3 -m "imagepyqt.demos"
A simple demo
""" [1] Read Image in cv2 """
import cv2
imagename = "/home/auss/Pictures/test.png" ## TODO: change to your image path!
img = cv2.imread(imagename)
""" [2] Display the OpenCV Mat in imagepyqt """
import imagepyqt as ipq
ipq.imshow(img,"Test ImagePyQt")
ipq.runQApp()
Other demos
import os, sys
from imagepyqt.widgets import imwidget
from imagepyqt.myQt import mkQApp, runQApp, QtWidgets
from imagepyqt import qimshow
## TODO: change to your own imagepath!
imagename = "/home/auss/Pictures/test.png"
def test1():
"""A Simple demo"""
import cv2
img = cv2.imread(imagename)
qApp=mkQApp()
qimshow(img,"Test MyImageWidget[2]")
runQApp()
def test2():
"""Another Simple demo"""
import cv2
img = cv2.imread(imagename)
qApp = mkQApp()
win = imwidget.MyImageWidget()
win.setImage(img)
win.setWindowTitle("Test MyImageWidget[1]")
win.show()
runQApp()
def run():
test1()
test2()
if __name__ == "__main__":
run()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
image_pyqt-0.0.1-py3-none-any.whl
(634.6 kB
view hashes)
Close
Hashes for image_pyqt-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c35a2b4e086b308a4bf55b2565a1ecd4e7a390b3a48b9b876432344ecea7f198 |
|
MD5 | 810c7276454a9a92e4ebd83c99fd781d |
|
BLAKE2b-256 | d3b5150447229b52909b78d3cdcd56470a107f81fbb436dbabd605308ce85a5b |