参考:https://www.cnblogs.com/visionfeng/p/6094423.html
opencv的一个像素为:[B,G,R] ,matplotlib的一个像素为:[R,G,B]。
出错示例:
for i in range(u[1]):
for j in range(u[0]):
im[leftupx + i][leftupy + j] = sf[i][j]
问题解决:
for i in range(u[1]):
for j in range(u[0]):
im[leftupx + i][leftupy + j][0] = sf[i][j][2]
im[leftupx + i][leftupy + j][1] = sf[i][j][1]
im[leftupx + i][leftupy + j][2] = sf[i][j][0]
完整代码就不展示了,解决方法放上来给大家感受一下