美文网首页
raw rgb转换为bmp

raw rgb转换为bmp

作者: 车到山前必有路2021 | 来源:发表于2021-03-12 11:05 被阅读0次

    1. ffmpeg

    ffmpeg -f rawvideo -s 1920*1080 -pix_fmt bayer_rggb8 -i raw.bin raw.bmp

    直接显示 ffplay -f rawvideo -s 1920*1080 -pix_fmt bayer_rggb8 -i raw.bin

    2. python2

    import numpy as np

    import cv2

    #pip install numpy

    #pip install opencv-python==4.2.0.32

    type = 'uint8'

    width = 1920

    height = 1088

    channels = 1

    image = np.fromfile('D:/fb3_y0_1920_1080_1.bin', dtype=type)

    image = image.reshape(height, width, channels)

    convertedImage = cv2.cvtColor(image, cv2.COLOR_BAYER_BG2RGB)

    cv2.imshow('img', convertedImage)

    cv2.waitKey()

    相关文章

      网友评论

          本文标题:raw rgb转换为bmp

          本文链接:https://www.haomeiwen.com/subject/crtzqltx.html