使用之前的代码跑出来图片是这样的
可以看到图像是灰白的,并且原本左边的一部分图片跑到右边去了
之前的代码
showImage = QtGui.QImage(result_image.data,
result_image.shape[1],
result_image.shape[0],
QtGui.QImage.Format_BGR888)
修改之后的代码
showImage = QtGui.QImage(result_image.data,
result_image.shape[1],
result_image.shape[0],
result_image.shape[1]*3,
QtGui.QImage.Format_BGR888)
改动的内容也就是加了一个参数:第二个参数*3,
修改后的效果如下