PDA

View Full Version : Motion detection & resize filtering


Sygma21
14th August 2002, 20:57
Maybe a silly idea Based on the MAM plugin.

This plugin use Temporal or Spatial filtering following motions in à frame.

Basic :
1) Can we use this idea to detect the motion in a frame and apply a bilinear filtering on high motion frames and and bicubic filtering on low motion frames.

2) Apply diffrent filtering levels depend on motions (Bilinear,Soft Bicubic,Neutral, or Sharp)

Dreaming:

Apply this notions inside a single frame ?

So, It's completely crazy or not ? Difficult ? Impossible ?

Regards.

scorchED
16th August 2002, 02:42
nice idea, i had this idea too:
you don't need rezising-filter, you can smooth fast action scenes for example by using SmoothHiQ by using a higher number on the 5th otion than on the 3rd option


-----------example-----------
slowmotion=Source.SmoothHiQ(5,48,96,128,0).TemporalSmoother(2,1)
fastmotion=Source.SmoothHiQ(3,32,64,128,35)
-----------------------------

i personaly use other settings and complex filterchain, but it's only an example.

*special thanks to MarcFD for his nice work!

WarpEnterprises
16th August 2002, 08:34
The "swtching" between two clips (pixelwise!) can be done with
Layer(clip1, clip2,...)
You have clip1 and overlay clip2 which also has an alpha(transparency) channel to control which pixel comes from which clip.
To get the motion information you take the output of a motion detection filter (e.g. MotionMask from mpeg2dec) and convert in to that A-channel via Mask.
But be careful: too strong differences look like your high motion scenes are drowned in blurriness.

Belgabor
16th August 2002, 14:06
Just a funny idea, but cant you simply USE MAM? I mean put in the resizes
instead of filters. So far this is just an idea, i cant check atm if it
works.
(And if it doesnt, perhaps Marc can make it work ;) )

Cheers
Belgabor

Marc FD
18th August 2002, 15:55
i'm back :)

@belgador
no pb.

I'm currently working on a very powerfull avisynth-allaround-tools-pack wo whould allow anyone to design video filters without coding a line of C/C++/MMX . i'll open a thread

ACClarke
18th August 2002, 16:23
very interesting
When it's easy, it's for me......

c'est exactement ce qu'il faut pour un boulet comme moi :D

Marc FD
18th August 2002, 16:42
faut pas dire ca :)
(hehe, je suis pas très fort non plus... après tout je ne suis même pas majeur :D )

ACClarke
18th August 2002, 18:00
Originally posted by Marc FD
faut pas dire ca :)
(hehe, je suis pas très fort non plus... après tout je ne suis même pas majeur :D )
a la fin de l'année j'aurais un tres beau titre d'ingenieur maitre (iup) en info indus.
mais je suis pas capable de pondre un plugin pour koi que se soit.

there is no university courses to learn how to create an avisynth plugin :)

prefab
7th October 2002, 14:21
hi,

I have picked the info from WarpEnterprises and have made several tests with MotionMask/MaskedMix. As WarpEnterprises points out, this works exactly as documented: pixelwise. The result of MotionMask is a 2 color frame that depending on the configuration of the filter returns the moving parts.

In order to test what Sygma21 suggests it would be best to apply this on a field or frame basis. Is there a way to pick the 2 color frame from MotionMask and turn all pixels into one color, based on a threshold, ie if there is more than 60% of pixels indicating motion, turn all pixels into motion color, otherwise turn all pixels into still color. Than use this as a mask for MaskedMix and use the motion/still resizers that you prefer. I have read through the documentation but have not found how to do this (or if it is possible).

cheers
prefab

WarpEnterprises
7th October 2002, 16:25
Don't use MaskedMix but Layer() instead.
Layer() wasn't available when dividee made MotionMask.

The output from MotionMask can be transformed into the transparency mask using ResetMask and ColorKeyMask.

Take care: masks can only be used with RGB32, MotionMask works in YUY2 AFAIK.