Skip to content

Commit

Permalink
[imageProcessing & cameraInit]
Browse files Browse the repository at this point in the history
Remove applyToneCurve parameter in imageProcessing
cameraInit: Test empty dcpDatabase only if dcp is required
  • Loading branch information
demoulinv committed Dec 14, 2022
1 parent b2abc45 commit 1da075e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
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;

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

0 comments on commit 1da075e

Please sign in to comment.