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

[keyframe] KeyframeSelector: add padding in created filenames #740

Merged
merged 1 commit into from
Feb 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 4 additions & 1 deletion src/aliceVision/keyframe/KeyframeSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,10 @@ void KeyframeSelector::writeKeyframe(const image::Image<image::RGBColor>& image,
if(_feeds.size() > 1)
folder /= fs::path("rig") / fs::path(std::to_string(mediaIndex));

const auto filepath = (folder / fs::path(std::to_string(frameIndex) + ".jpg")).string();
std::ostringstream filenameSS;
filenameSS << std::setw(_padding) << std::setfill('0') << frameIndex << ".jpg";

const auto filepath = (folder / fs::path(filenameSS.str())).string();

mediaInfo.spec.attribute("Exif:ImageUniqueID", std::to_string(getRandomInt()));

Expand Down
2 changes: 2 additions & 0 deletions src/aliceVision/keyframe/KeyframeSelector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ class KeyframeSelector
unsigned int _nbTileSide = 20;
/// Number of previous keyframe distances in order to evaluate distance score
unsigned int _nbKeyFrameDist = 10;
/// Use padding on digits for exported frames
unsigned int _padding = 7;
/// Sharpness threshold (image with higher sharpness will be selected)
float _sharpnessThreshold = 15.0f;
/// Distance max score (image with smallest distance from the last keyframe will be selected)
Expand Down