Overmix icon indicating copy to clipboard operation
Overmix copied to clipboard

Handle lighting differences in merged image

Open spillerrec opened this issue 5 years ago • 0 comments

Some scenes makes each frame lighter or darker in some part of the frame, for example making the top part lighter. If there are enough frames it tends to be able to smooth it out, but otherwise it ends up showing as lines in the image. This most often happen when there are no movement in the start or end (causing the error to build up), or using the skip render where the result ends up being completely broken.

Steps to fix:

  • Make some simulated stitches!
  • Calculate for each pixel in the frame how much it differs from the merged image
  • Based on this for each image, build an average map on how much to correct the effect
  • Most likely will need a few iterations to be correct
  • Apply this map when rendering

Hard questions:

  • What kind of blending is used in those images? (i.e. what to do to reverse it)
  • How do we add that map as a preprocessing step for each image?

Especially the second question is difficult.

  1. We could add it as a mask, but that would make it ambiguous.
  2. We could instantly apply it on all images, but that would ruin the input images if they ended up being wrong.
  3. We could add a new mask type, but that would require us to support it in all renders
  4. We could add support for cached preprocessing in ImageContainer (perhaps even supporting lazy loading so we don't need to keep the original image in memory).

spillerrec avatar Mar 28 '19 06:03 spillerrec