从树莓pi jpeg+raw文件中提取原始bayer数据的库
picamraw的Python项目详细描述
picamraw
用于从树莓pi jpeg+原始文件中提取原始拜耳数据的库。
可从PyPI安装;无摄像头硬件可用。
用法示例
提取原始拜耳阵列
frompicamrawimportPiRawBayer,PiCameraVersionraw_bayer=PiRawBayer(filepath='path/to/image.jpeg',# A JPEG+RAW file, e.g. an image captured using raspistill with the "--raw" flagcamera_version=PiCameraVersion.V2,sensor_mode=0)raw_bayer.bayer_array# A 16-bit 2D numpy array of the bayer dataraw_bayer.bayer_order# A `BayerOrder` enum that describes the arrangement of the R,G,G,B pixels in the bayer_arrayraw_bayer.to_rgb()# A 16-bit 3D numpy array of bayer data collapsed into RGB channels (see docstring for details).raw_bayer.to_3d()# A 16-bit 3D numpy array of bayer data split into RGB channels (see docstring for details).
测试
这个包是用^{pip install tox
,然后运行tox
。
注意:此代码仅针对使用v2型摄像机和传感器模式0拍摄的图像进行了测试。
归因
这个库是从PiCamera包派生的,经过了大量修改。