Skip to content

Instantly share code, notes, and snippets.

@smex
smex / toQImage.py
Last active September 1, 2021 09:46
Convert numpy arrays (from opencv) to QImage
from PyQt4.QtGui import QImage, qRgb
import numpy as np
class NotImplementedException:
pass
gray_color_table = [qRgb(i, i, i) for i in range(256)]
def toQImage(im, copy=False):
if im is None: