From 162187608bbaf1f79d38c88803754c8e58359129 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 26 Nov 2016 12:40:34 +0100 Subject: cleanup --- opencv-qt-integration-1/python/ImageViewer.py | 45 --------------------------- 1 file changed, 45 deletions(-) delete mode 100644 opencv-qt-integration-1/python/ImageViewer.py (limited to 'opencv-qt-integration-1/python') diff --git a/opencv-qt-integration-1/python/ImageViewer.py b/opencv-qt-integration-1/python/ImageViewer.py deleted file mode 100644 index 1525f21..0000000 --- a/opencv-qt-integration-1/python/ImageViewer.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 - -import os -import sys - -try: - from PyQt5.QtCore import * - from PyQt5.QtGui import * - from PyQt5.QtWidgets import * - import cv2 -except ImportError: - print("Please install the required packages.") - sys.exit() - -class ImageViewer(QWidget): - - def __init__(self): - QWidget.__init__(self) - self.filename = "../../assets/flughahn.jpg" - self.setup_ui() - - def setup_ui(self): - img = cv2.imread(self.filename) - self.image_label = QLabel() - if img is None: - self.image_label.setText("Cannot load the input image.") - else: - img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) - img_ = QImage(img.data, img.shape[1], img.shape[0], QImage.Format_RGB888) - self.image_label.setPixmap(QPixmap.fromImage(img_)) - self.quit_button = QPushButton("Quit") - self.quit_button.clicked.connect(self.close) - self.main_layout = QVBoxLayout() - self.main_layout.addWidget(self.image_label) - self.main_layout.addWidget(self.quit_button) - self.setLayout(self.main_layout) - self.setWindowTitle("OpenCV - Qt Integration") - - -if __name__ == "__main__": - app = QApplication(sys.argv) - viewer = ImageViewer() - viewer.show() - app.exec_() -- cgit v1.2.3