Moving Average to Picture from Video
Hello!
I have a (bad) Video Camera that I want to use to take Pictures.
I use dx.grab Objects and OpenGL to make Screenshots.
Now my idea is to grab a Video of a certain length e.g 30 Frames and then calculate an average Value for each pixel to minimize artefact.
What would be an aproach to do so?
Thanks,
A.B
You could try [jit.op @op +]
Use a "sum" matrix that has high limits for each element, as you'll be going over the maximum values when summing the images. Once you get to 30, use [jit.op @op /] and get the average. (Or multiply by the reciprocal which should be faster). Store the result in a final image matrix.
Will take some tweaking but should be fairly straightforward. Likely there are more clever ways too, and maybe a dedicated object that does it already.
jit.slide with a high values will smooth the transition between frames, it could be useful.
Hello Pedros,
That looks like a great solution. But what exactly do the slide options manipulate? E.g if I put a 50 what does that mean?
Short values make the accumulation effect minimal, changes are almost instant.
Higher values make the system slower to react, the accumulation effect is more pronounced and changes to the image take longer to notice.