Categories
Mastering Development

PyQt5 OpenCV QImage, QPixmap Pictures are output incorrectly [duplicate]

I am using opencv to open an image and putting qimage into qpixmap. Since the Korean route is included, imread is performed in the following way. def imread(filename, flags=cv2.IMREAD_COLOR, dtype=np.uint8): try: n = np.fromfile(filename, dtype) img = cv2.imdecode(n, flags) return img except Exception as e: print(e) return None The image you want to pixmap Photos […]

Categories
Mastering Development

Draw grid with text in each box then receive coordinates using opencv python

so I have been trying to make this work I haven’t had much luck. So the point of this is that I make a grid over a section of the screen and then get a coordinate of a center of a box. This is what I’ve tried import numpy as np from mss import mss […]

Categories
Development

PyQt5 Convert 2d np array to QImage

from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout from PyQt5.QtGui import QPixmap, QImage import numpy as np import sys def print_np(): app = QApplication(sys.argv) win = QWidget() label = QLabel() img = np.ones((500, 500)) qImg = QPixmap(QImage(img.data, img.shape[0], img.shape[1], QImage.Format_Indexed8)) label.setPixmap(qImg) vbox = QVBoxLayout() vbox.addWidget(label) win.setLayout(vbox) win.show() sys.exit(app.exec_()) In this code, I am trying to display […]

Categories
Development

Multi-threaded image processing with openCV in python

I am quite new to python and have problems to parallize a part of my algorithm. Consider an input image thats need to be threshold in a certain way on pixel level. Since the algorithm only considers a specific area to calculate the threshold values, I’d like to run each chunk of the image in […]

Categories
Development Python

Python OpenCV line detection to detect `X` symbol in image

I have an image where I need to detect a X symbol inside the line. The image: As you can see in the image above there is a X symbol inside a line. I want to know the X & Y coordinates of the symbol. Is there a way to find this symbol within this […]