Consider this function 'display()'
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from skimage import transform
def display(filename):
img = Image.open(filename)
img = np.array(img).astype('float32')/255
img = transform.resize(img, (200, 200, 3))
img = np.expand_dims(img, axis=0)
plt.imshow(mpimg.imread(filename))
plt.show()
Now as you know this will create a window of its own but I instead want to display the image in a PyQt5 QWidget. How do I do that?
Edit : I don't think it's a duplicate question. There is nothing about plotting images in that answer marked by eyllanesc!