Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects temporal median for background subtraction?

  • temporal median for background subtraction?

    Posted by Philipp Hahn on June 25, 2018 at 3:44 pm

    hi,
    i’m a little surprised i found almost nothing about this, maybe it’s the wording? anyway:
    i want to key using background subtraction (in ae it’s called “difference matte”), but as my matte i do not want to use a still image or a video from another source but the very same video, only with a temporal median applied – so each pixel is calculated from the median color value at its location of eg. 50 frames back and forth. the result of this should be, that i only key stuff, that moves at a certain pace whereas very slow changes in the shot (eg. moving light from the moving sun) will still be keyed out.
    this technique is also often used to remove people in crowded shots, eg.: https://www.shutterstock.com/blog/photoshop-remove-people

    how would i do this in after effects? or is there any other software i should be looking at?
    thanks for any help in advance!
    p

    Roei Tzoref replied 7 years, 9 months ago 3 Members · 8 Replies
  • 8 Replies
  • Steve Bentley

    June 25, 2018 at 6:11 pm

    I haven’t seen the code but given how we have used Mocha in the past I would imagine this is being employed at some point in the pipeline. To be fair, we have pro, so I’m not sure how robust the one that comes with AE is.

  • Roei Tzoref

    June 26, 2018 at 12:07 am

    here’s a tutorial using difference matte from the same video. if you have a shot for us to see and test and can share, please do

    Roei Tzoref
    2D/VFX Generalist & Instructor
    ♫ AeBlues Tutorials ♫
    http://www.tzoref.com

  • Philipp Hahn

    June 26, 2018 at 4:55 pm

    thanks for your help but, um, which of these tutorials should i be looking at? there are four 10+ minute tutorials behind this link and at least on first sight, none seems to say anything about temporal median… or did i miss something?
    best
    p

  • Roei Tzoref

    June 26, 2018 at 8:13 pm
  • Philipp Hahn

    July 8, 2018 at 6:09 pm

    hello again,
    sorry for the delay, for future reference:
    roei’s tutorial video uses photoshop to create a median clean plate, which does work nicely for individual clips/shots but unfortunately i’m dealing with a lot of frames and photoshop crashes on these quantities.
    the solution i’m currently exploring and which seems most promising is not using after effects or photoshop at all but to do it from the command line using G’MIC, details are explained here: https://discuss.pixls.us/t/a-guide-about-computing-the-temporal-average-median-of-video-frames-with-gmic/1566

    again, thanks for all the help and have a wonderful day!
    p

  • Philipp Hahn

    July 8, 2018 at 6:57 pm

    sorry, forgot something, also interesting: https://github.com/zo7/median-video

  • Philipp Hahn

    July 25, 2018 at 10:12 pm

    for reference: still not completely done with this but close – i now do it through command line scripts with a combination of imagemagick, gnu parallel and ffmpeg… i went for imagemagick simply because it appeared the most flexible.

  • Roei Tzoref

    July 26, 2018 at 1:12 am

    well don’t forget to show us the result when you are done ☺

    Roei Tzoref
    2D/VFX Generalist & Instructor
    ♫ AeBlues Tutorials ♫
    http://www.tzoref.com

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy