Author Topic: Experiment - reducing aliasing in post using optical flow  (Read 4982 times)

Levas

  • Hero Member
  • *****
  • Posts: 1186
  • 6d - Nightly build user
Re: Experiment - reducing aliasing in post using optical flow
« Reply #50 on: November 24, 2017, 09:55:02 PM »
@Alex

Tested out median, I think it has a little edge compared to average, you get some fine noise/grain in the frame which gives it a little more sharpness perception.

I have uploaded all the 16 aligned PNG files, and the original PPM file for this particular frame on google drive:
Just in case you come up with some other methods of combining those 17 frames ;)
https://drive.google.com/drive/folders/1w9kYw-TgVdiJriVpnfkZ1J1PNv17n5mI?usp=sharing
I've also included the average and the Median files on google drive

Median:

Danne

  • Hero Member
  • *****
  • Posts: 4251
Re: Experiment - reducing aliasing in post using optical flow
« Reply #51 on: November 26, 2017, 08:49:31 AM »
@Levas
For comparison reasons I tested your png files by transcoding them to tiffs and ran them against this script(enfuse/hugin). It will average 6 files not all the 17 png files:
http://www.magiclantern.fm/forum/index.php?topic=21089.msg193629#msg193629

enfuse/hugin


Original


Levas

  • Hero Member
  • *****
  • Posts: 1186
  • 6d - Nightly build user
Re: Experiment - reducing aliasing in post using optical flow
« Reply #52 on: June 02, 2018, 08:13:48 PM »
@Alex,

Just curious, don't know if, and how much you did dive into the source files for pyflow (the 15 files in the SRC directory).
I see the files are readable code, so easy editable.
But do you know if it is possible to alter some settings in these files that motion is more blurred or something ?
When motion is in the frame, walking person for example, I end up with sharp curvy lines through the image, due to how the allignment and averaging is done.

Here's an example with lot's of those sharp curvy lines around the frame:

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 11473
  • 5D Mark Free
Re: Experiment - reducing aliasing in post using optical flow
« Reply #53 on: June 02, 2018, 08:28:31 PM »
Didn't dig much. There are some parameters, you can edit the source to adjust them, but to figure out what they do, one has to read the papers linked in the README. I've only skimmed the website.

For your issue, maybe some sort of thresholding (comparing the images before blending, to discard areas with differences above the noise floor) could work. You don't need to change the optical flow code for that - just the blending stage (I've used "convert -average"). You may even consider writing it from scratch (e.g. in octave).

Levas

  • Hero Member
  • *****
  • Posts: 1186
  • 6d - Nightly build user
Re: Experiment - reducing aliasing in post using optical flow
« Reply #54 on: June 02, 2018, 08:40:50 PM »
ah yes, you're right, the whole average step is done in the makefile written by you...the alignment is done by the pyflow code and creates the aligned images, doesn't put them together.

Enough info for me to dig some further into the average step.

Code: [Select]
# average
%-a.png: %.ppm %-n.png %-p.png %-n2.png %-p2.png %-n3.png %-p3.png %-n4.png %-p4.png %-n5.png %-p5.png %-n6.png %-p6.png
convert -average $^ $@

Thanks  :D

Levas

  • Hero Member
  • *****
  • Posts: 1186
  • 6d - Nightly build user
Re: Experiment - reducing aliasing in post using optical flow
« Reply #55 on: June 03, 2018, 12:22:01 AM »
For now, this seems like a quick solution that gives rather good results:

I added the bold tekst to the convert line.
convert -average -despeckle -statistic minimum 3x3 blur 2x2 $^ $@
-Despeckle helps a little and since the curvy lines are mostly highlights, the statistic minimum works rather well, after that a little blur is added and most of it is gone.