使用Lightroom,我知道如何将相机配置文件(*.dcp文件)应用于我的*.DNG图像。
我想在我正在编写的应用程序中也这样做,所以我想一个很好的起点是将这个功能附加到dng_validate.exe应用程序中。
所以我开始补充:
#include "dng_camera_profile.h"接着又补充说:
static dng_string gDumpDCP; 并将以下内容添加到错误打印中:
"-dcp <file> Load camera profile from <file>.dcp\"\n"然后,我添加了函数来从cli读取dcp:
else if (option.Matches("dcp", true))
{
gDumpDCP.Clear();
if (index + 1 < argc)
{
gDumpDCP.Set(argv[++index]);
}
if (gDumpDCP.IsEmpty() || gDumpDCP.StartsWith("-"))
{
fprintf(stderr, "*** Missing file name after -dcp\n");
return 1;
}
if (!gDumpDCP.EndsWith(".dcp"))
{
gDumpDCP.Append(".dcp");
}
}然后从磁盘行421加载配置文件。
if (gDumpTIF.NotEmpty ())
{
dng_camera_profile profile;
if (gDumpDCP.NotEmpty())
{
dng_file_stream inStream(gDumpDCP.Get());
profile.ParseExtended(inStream);
}
// Render final image.
.... rest of code as it was那么,我现在如何使用概要文件数据来更正呈现和写入校正的图像?
发布于 2017-06-08 10:17:24
所以在玩了几天之后,我找到了解决办法。实际上,底片可以有多个相机轮廓。因此,对于negative->AddProfile(profile),您只需添加一个。但如果这不是第一份资料的话就不会用了!因此,我们首先需要清理配置文件,而不是添加一个。
AutoPtr<dng_camera_profile> profile(new dng_camera_profile);
if (gDumpDCP.NotEmpty())
{
negative->ClearProfiles();
dng_file_stream inStream(gDumpDCP.Get());
profile->ParseExtended(inStream);
profile->SetWasReadFromDNG();
negative->AddProfile(profile);
printf("Profile count: \"%d\"\n", negative->ProfileCount()); // will be 1 now!
}下一件事,得到正确的图像是有正确的白平衡。这可以通过非公开或事后进行。对于我的应用程序与4个不同的相机,结果是最好的使用后,白色平衡校正。因此,我发现了4对(温度,金币)对使用照明。
问题是如何在dng_validate.exe程序中添加这些值。我就是这样做的:
#include "dng_temperature.h"
if (gTemp != NULL && gTint != NULL)
{
dng_temperature temperature(gTemp, gTint);
render.SetWhiteXY(temperature.Get_xy_coord());
}得到的图像与Lightroom的结果略有不同,但足够接近。另外,相机和摄像机的区别现在也消失了!:)
https://stackoverflow.com/questions/44310986
复制相似问题