0
\$\begingroup\$

I am having a huge series of images, where each shot consists of two photos:

  • 001_left.jpeg & 001_right.jpeg
  • 002_left.jpeg & 002_right.jpeg
  • ...

Now, I'd like to create a time-lapse from these pictures. But first, I need to stitch these pairs together. I, therefore, wrote a PowerShell script to automate this task. Let me describe the current steps involved.

My current approach:

  1. Load one image pair into Hugin's UI (simple view), run align and save the project file, e.g. template.pto
  2. Create groups of images (with the help of the script) and run nona -o 001_result.jpeg -m JPEG template.pto 001_left.jpg 001_right.jpg on each of them.
  3. Run ffmpeg on the resulting files and create a video

This process works so far, however, it is flawed:

Flaws of this approach

  1. When the brightness close to the seam increases, artifacts are introduced (sun raising high and getting close to the seam). Please see example images and video. At around 17 seconds the problem should be visible right in the middle of the video.

  2. Even on my beefy machine (Intel Xeon E5-1620 v2 @ 3.70GHz) stitching a pair takes roughly 4 seconds. I'll have to stitch around 97'500 images, resulting in 4.5 days of processing time!

Questions

  1. How can I harmonize the stitching process (control points?) across the set of images?
  2. How can improve stitching performance?
\$\endgroup\$
4
  • \$\begingroup\$ Problem possibly due to shadows that are more visible/contrasted than normal features. If the left & right pictures are taken by two cameras that are fixed relative to each other the transformations required for a stitch are the same for all pairs, so maybe there is a way to avoid recomputing this, which saves processing time and lets you pick the best pair to compute the transform. But how this can be done (and separated from the equalizing of the lighting for each pair) is "left as an exercise to the reader" :) \$\endgroup\$
    – xenoid
    Mar 18, 2022 at 10:37
  • \$\begingroup\$ Thanks for replying. Each pair of images is taken by a Tikee 3 Pro, which contains two fixed lenses in one box. See here for more information enlaps.io/fr/tikee-3-pro-time-lapse-camera.html. \$\endgroup\$ Mar 18, 2022 at 10:49
  • \$\begingroup\$ Currently, I am not creating a template for each pair of images, but reusing a single one for all of them. Maybe it would help to create e.g. three templates for each extreme light situation and split the stitching parts also into three parts. \$\endgroup\$ Mar 18, 2022 at 10:51
  • \$\begingroup\$ The only solution for a beefy computational task is beefy hardware. CGI animation studios have entire render farms dedicated to making the drafts and final renders of films and it still takes quite a while. You might be able to profile to determine if you're bound by CPU, I/O, memory, drive, network, etc. and upgrade as appropriate, or, use the 4.5 days to go take more pictures! \$\endgroup\$
    – FreeMan
    Mar 21, 2022 at 18:19

1 Answer 1

2
\$\begingroup\$

Thanks, everyone for replying. I was able to fix the artifacts, the actual issue was with the blending.

From the documentation:

nona can do rudimentary assembly of the remapped images, but a much better tool for this is enblend, feed it the images, it will pick seam lines and blend the overlapping areas:

So switching to enblend solved it.

nona -o out -m TIFF_m -z NONE template.pto 000001_left.jpg 000001_right.jpg
enblend --compression=100 --output 000001_stitched.jpg out0000.tif out00001.tif

Un-cropped and strongly compressed... demo only :-)

https://www.youtube.com/watch?v=Mj-mSNqce80&feature=youtu.be

\$\endgroup\$
1
  • \$\begingroup\$ Hi Matthias. Thanks for coming back and posting your solution. Because your solution solved your question, please don't forget to go ahead and accept your answer. Answering your own question, and even marking your answer as the accepted answer, is absolutely ok at Stack Exchange. If it is the best answer to the question, it's absolutely encouraged! Thanks. =) \$\endgroup\$
    – scottbb
    Mar 20, 2022 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.