from PIL import Image import os # 定义输出的yuv文件名 output_file = 'output_hecheng_car.yuv' # 创建一个用于写入yuv文件的空文件 output = open(output_file, 'wb') # 遍历1到250的文件夹 for i in range(1, 101): folder_name = str(i) image_path = os.path.join(folder_name, '0_BatchNormalization_107_640x480_nv12.yuv') # 读取NV12格式的yuv图像 with open(image_path, 'rb') as f: yuv_data = f.read() # 将图像数据写入到输出yuv文件中 output.write(yuv_data) # 关闭输出文件 output.close() print('所有图片已经写入到', output_file)
07-22
1621
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-01