版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_39622065/article/details/82285097
BGR to RGB
OpenCV image to Matplotlib
rgb = bgr[...,::-1]
RGB to BGR
Matplotlib image to OpenCV
bgr = rgb[...,::-1]
RGB to GBR
gbr = rgb[...,[2,0,1]]
展示结果:
print("before",gray)
gray=gray[...,::-1] #BRG to RGB
print("after gray",gray)
before:
[[[172 168 187]
[171 167 185]
[174 169 181]
after:
[[[187 168 172]
[185 167 171]
[181 169 174]