如何在OpenCV中使用数组显示多个图像(分割的)?

分割图像后,我想使用Qt设计器显示所有图像,但是我很难对其进行编码。我只能使用matplotlib的外部窗口显示图像,但是有点奇怪。请帮助我修复代码

a = cv2.imread(image)
a_height = a.shape[0]
a_width = a.shape[1]
r = 2
c = 2
M = a_height // r
N = a_width // c
arr = []

for y in range(0,a_height,M):
    for x in range(0,a_width,N):
        tiles = a[y:y + M,x:x + N]
        gg = cv2.cvtColor(tiles,cv2.COLOR_BGR2RGB)
        # cv2.imwrite("split"+str(x)+"_"+str(y)+".jpg",tiles)
        # plt.subplot(r,c,k)
        # plt.imshow(gg)
        # plt.xticks([]),plt.yticks([])
 # plt.show()
        arr.append(tiles)
        for i in enumerate(arr):
            c = QtGui.QImage(arr,arr.shape[1],arr.shape[0],arr.shape[1] * 3,QImage.Format_RGB888).rgbSwapped()
            pixmap = QtGui.QPixmap(c)
            scaledImage = pixmap.scaled(181,171,QtCore.Qt.KeepAspectRatio)
            self.label_process.setPixmap(scaledImage)
gukoule 回答:如何在OpenCV中使用数组显示多个图像(分割的)?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3117159.html

大家都在问