-
-
Notifications
You must be signed in to change notification settings - Fork 829
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
New LDR2HDR software #613
New LDR2HDR software #613
Conversation
("targetExposureTime,e", po::value<std::string>(&target), | ||
"target exposure time for the output HDR image to be centered") | ||
("threshold,t", po::value<float>(&threshold)->default_value(threshold), | ||
"threshold for clamped value (0 for no correction, 0.5 for inside lights and 1 for outside lights"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maxLightingWeight for pixels saturated in all images: use 0 for no correction, 0.5 for interior lighting and 1 for outdoor lighting.
|
||
|
||
image::writeImage(outputHDRImagePath, image, image::EImageColorSpace::NO_CONVERSION); | ||
if(!outputResponsePath.empty()) response.write(outputResponsePath); | ||
|
||
|
||
// test of recovery of source target image from HDR | ||
// recoverSourceImage(image, response, channelQuantization, "/s/prods/mvg/_source_global/samples/HDR_selection/MPC/0/Mikros/recovered_test.exr", meanVal); | ||
recoverSourceImage(image, response, channelQuantization, "/s/prods/mvg/_source_global/samples/HDR_selection/terrasse_2/Mikros/Centrage_expos/recovered_from_Gros_bonsCoeff_meanCurve.exr", meanVal); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a debug option for that, if the optional argument is empty skip the export.
return _radiance[group]; | ||
} | ||
|
||
private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add doxygen doc on member variables
* @brief | ||
* @param[in] groups | ||
* @param[out] response | ||
* @param[in] times |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params doc
//initialize radiance | ||
for(std::size_t g = 0; g < ldrImageGroups.size(); ++g) | ||
{ | ||
merge.process(ldrImageGroups[g], times[g], weight, response, _radiance[g], targetTime, threshold, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it makes sense to expose the threshold
parameter used here.
for target exposition and clamped values
for(auto& entry: fs::directory_iterator(fs::path(imageFolder))) | ||
|
||
// const std::vector<std::string> validExtensions = {".jpg", ".jpeg", ".png", ".cr2", ".tiff", ".tif", ".rw2"}; | ||
const std::regex validExtensions("\\.(?:jpg|jpeg|png|cr2|tiff|tif|rw2)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const std::regex validExtensions("\\.(?:"
// Basic image file extensions
"jpg|jpeg|png|tiff|tif|"
// RAW image file extensions:
"3fr|" // Hasselblad
"arw|" // Sony
"crw|cr2|cr3|" // Canon
"dng|" // Adobe
"kdc|" // Kodak
"mrw|" // Minolta
"nef|nrw|" // Nikon
"orf|" // Olympus
"ptx|pef|" // Pentax
"raf|" // Fuji
"R3D|" // RED
"rw2|" // Panasonic
"srw|" // Samsung
"x3f" // Sigma
")"
);
@@ -101,10 +101,10 @@ void DebevecCalibrate::process(const std::vector< std::vector< image::Image<imag | |||
Vec x = solver.solve(b); | |||
if(solver.info() != Eigen::Success) return; // solving failed | |||
|
|||
std::cout << "system solved" << std::endl; | |||
// std::cout << "system solved" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ALICEVISION_LOG_TRACE("DebevecCalibrate: system solved");
And same for all other cout.
std::vector<std::string> stemImages; | ||
std::vector<std::string> nameImages; | ||
|
||
const std::regex validExtensions("\\.(?:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const std::string validExtensions(
// Basic image file extensions
"jpg|jpeg|png|tiff|tif|"
// RAW image file extensions:
"3fr|" // Hasselblad
"arw|" // Sony
....
);
const std::regex validExtensionsExp("\\.(?:" + extensions + ")");
} | ||
if(inputImagesNames.empty()) | ||
{ | ||
ALICEVISION_LOG_ERROR("No valid input images. Please give a list of LDR images or a folder path containing them (accepted formats are: .jpg .jpeg .png .tif .tiff .cr2 .rw2"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ALICEVISION_LOG_ERROR("No valid input images. Please give a list of LDR images or a folder path containing them (accepted formats are: " << validExtensions << ")")
image::readImage(imagePath, ldrImages.at(i), image::EImageColorSpace::SRGB); | ||
|
||
// test image conversion to sRGB | ||
// image::writeImage(std::string("/s/prods/mvg/_source_global/samples/HDR_selection/terrasse_2/Mikros/sources/JPG/" + nameImages.at(i) + ".jpg"), ldrImages.at(i), image::EImageColorSpace::NO_CONVERSION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
// Debevec and Robertson algorithms use shutter speed as ev value | ||
float shutter; | ||
try | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: in the future, we should use EVs instead of just shutter speed.
switch(calibrationMethod) | ||
if(!inputResponsePath.empty()) | ||
{ | ||
goto MERGE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use goto.
{ | ||
goto MERGE; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(inputResponsePath.empty())
merge.process(ldrImageGroups_sorted.at(0), ldrTimes_sorted, fusionWeight, response, image, targetTime, false, clampedValueCorrection); | ||
|
||
|
||
image::writeImage(outputHDRImagePath, image, image::EImageColorSpace::NO_CONVERSION); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ToukL Add metadata from the input image used as target exposure.
Features list