Skip to content

Commit

Permalink
Merge pull request #740 from alicevision/dev/keyframeSelectorPadding
Browse files Browse the repository at this point in the history
[keyframe] KeyframeSelector: add padding in created filenames
  • Loading branch information
fabiencastan authored Feb 8, 2020
2 parents e625d22 + 0f14177 commit b05535f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit b05535f

Please sign in to comment.