python opencv完成UYVY => BGR图片转换 UYVY图片可视化

def load_uyvy(input_name, img_height, img_width):
    with open(input_name, "rb") as src_file:
        raw_data = np.fromfile(src_file, dtype=np.uint8, count=img_width*img_height*2)
        im = raw_data.reshape(img_height, img_width, 2)

        bgr = cv2.cvtColor(im, cv2.COLOR_YUV2BGR_UYVY)
        print(type(bgr))
        print(bgr.shape)
        # print(bgr)

    cv2.imwrite('./test.png', bgr)

 应用下载网站:YUVEye官方下载-ZigZagSin

参考链接:为什么打开并查看一个YUV文件那么麻烦?-云社区-华为云

参考链接:YUV422 to RGB conversion using Python and OpenCV – Thinking Toasters

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值