Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw Images: minor update #1317

Merged
merged 2 commits into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/aliceVision/sfmDataIO/compatibilityData/scene_v1.2.3.abc
Binary file not shown.
37 changes: 20 additions & 17 deletions src/software/pipeline/main_cameraInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,32 +452,35 @@ int aliceVision_main(int argc, char **argv)

std::string imgFormat = in->format_name();

if (dcpDatabase.empty() && (imgFormat.compare("raw") == 0) && errorOnMissingColorProfile)
{
ALICEVISION_LOG_ERROR("The specified DCP database for color profiles does not exist or is empty.");
// No color profile available
boost::atomic_ref<char>{allColorProfilesFound} = 0;
}

// if a color profile is required check if a dcp database exists and if one is available inside
// if yes and if metadata exist and image format is raw then update metadata with DCP info
if((rawColorInterpretation == image::ERawColorInterpretation::DcpLinearProcessing ||
rawColorInterpretation == image::ERawColorInterpretation::DcpMetadata) &&
hasCameraMetadata && !dcpDatabase.empty() && (imgFormat.compare("raw") == 0))
hasCameraMetadata && (imgFormat.compare("raw") == 0))
{
image::DCPProfile dcpProf;

if(dcpDatabase.getDcpForCamera(make, model, dcpProf))
if (dcpDatabase.empty() && errorOnMissingColorProfile)
{
view.addDCPMetadata(dcpProf);

#pragma omp critical
viewsWithDCPMetadata++;
ALICEVISION_LOG_ERROR("The specified DCP database for color profiles does not exist or is empty.");
// No color profile available
boost::atomic_ref<char>{allColorProfilesFound} = 0;
}
else if(allColorProfilesFound)
else if (!dcpDatabase.empty())
{
// there is a missing color profile for one image or more
boost::atomic_ref<char>{allColorProfilesFound} = 0;
image::DCPProfile dcpProf;

if (dcpDatabase.getDcpForCamera(make, model, dcpProf))
{
view.addDCPMetadata(dcpProf);

#pragma omp critical
viewsWithDCPMetadata++;
}
else if (allColorProfilesFound)
{
// there is a missing color profile for one image or more
boost::atomic_ref<char>{allColorProfilesFound} = 0;
}
}
}

Expand Down
5 changes: 0 additions & 5 deletions src/software/utils/main_imageProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ int aliceVision_main(int argc, char * argv[])
image::EImageColorSpace outputColorSpace = image::EImageColorSpace::LINEAR;
image::EStorageDataType storageDataType = image::EStorageDataType::Float;
std::string extension;
bool applyToneCurve = false;
image::ERawColorInterpretation rawColorInterpretation = image::ERawColorInterpretation::LibRawNoWhiteBalancing;
std::string colorProfileDatabaseDirPath = "";
bool errorOnMissingColorProfile = true;
Expand Down Expand Up @@ -678,9 +677,6 @@ int aliceVision_main(int argc, char * argv[])
("errorOnMissingColorProfile", po::value<bool>(&errorOnMissingColorProfile)->default_value(errorOnMissingColorProfile),
"Rise an error if a DCP color profiles database is specified but no DCP file matches with the camera model (maker+name) extracted from metadata (Only for raw images)")

("applyToneCurve", po::value<bool>(&applyToneCurve)->default_value(applyToneCurve),
"Apply color profile embedded tone curve if any.")

("storageDataType", po::value<image::EStorageDataType>(&storageDataType)->default_value(storageDataType),
("Storage data type: " + image::EStorageDataType_informations()).c_str())

Expand Down Expand Up @@ -801,7 +797,6 @@ int aliceVision_main(int argc, char * argv[])
options.rawColorInterpretation = rawColorInterpretation;
}
options.colorProfileFileName = view.getColorProfileFileName();
options.applyToneCurve = applyToneCurve;
demoulinv marked this conversation as resolved.
Show resolved Hide resolved

// Read original image
image::Image<image::RGBAfColor> image;
Expand Down