如何创建原始合成图像

How to create raw synthethic images

我想对我的相机进行颜色校准。这就是我搜索去马赛克算法的原因,它可以提供最接近真实物体颜色的颜色。这就是我想要的原因:

我使用 libraw 解压原始图像,使用 OpenCV 处理和存储它们。

所以,问题是,是否有一个库可以为我提供不同的去马赛克算法(我准备好将我的合成图像从 Mat 转换为 C 样式数组),其中我可以传递我的马赛克图像并接收去马赛克图像。我认为可以将我的图像从 tiff 转换为 dng 并使用 RawTherapee 进行去马赛克,但它看起来更复杂。

我使用 dng sdk 解决了这个问题。

在答案末尾使用 link 中的 class 的管道在这里:

DngCreator creator;
cv::Mat mosaic = //some method that returns Bayer RGGB mosaic
creator.BuildDngImage(mosaic);
creator.setCameraProfile();
creator.setExifTags();
creator.setXmp();
creator.setMosaicInfo();
creator.WriteDng("output.dng");

可以看出我使用 opencv 创建马赛克图像

有classDngCreator的源码,写的是最简单的dng。我没有用所有需要的标签做出好的 dng,但 RawTherapee 成功地红色了我的 dng。 引用代码:https://pastebin.com/M4GRBfUG