raw rgb转换为bmp

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)