Python中的RAW图像处理 [英] RAW Image processing in Python
本文介绍了Python中的RAW图像处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何Pythonic解决方案来读取和处理RAW图像。即使它只是访问原始照片文件(例如cr2或dng),然后将其输出为jpeg。
Are there any Pythonic solutions to reading and processing RAW images. Even if it's simply accessing a raw photo file (eg. cr2 or dng) and then outputting it as a jpeg.
理想情况下是python的dcraw绑定,但其他任何可以完成它的东西也足够了。
Ideally a dcraw bindings for python, but anything else that can accomplish the came would be sufficient as well.
推荐答案
前一段时间我写了一篇名为 rawpy 。这很容易使用:
A while ago I wrote a libraw/dcraw wrapper called rawpy. It is quite easy to use:
import rawpy
import imageio
raw = rawpy.imread('image.nef')
rgb = raw.postprocess()
imageio.imsave('default.tiff', rgb)
它本身适用于numpy数组并支持许多选项,包括直接访问未处理的Bayer数据。
It works natively with numpy arrays and supports a lot of options, including direct access to the unprocessed Bayer data.
这篇关于Python中的RAW图像处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文