Does anyone have workflow for dark frame subtraction for video

Started by David Goldwasser, May 27, 2015, 08:28:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

David Goldwasser

My use case for this is for FPS override video. As shown on this post http://www.magiclantern.fm/forum/index.php?topic=15205.0 I have bad pixels that are very evident when using FPS, in particular if I'm in the 0.2 to 1.0 FPS range. If I were shooting with intervalometer I would jsut use camera's (550d) built in dark frame subtraction or post process the photos. Since I'm shooting videos for FPS Override I'd like to avoid converting to still and then back to video.

It would be really great if there was a way ML could do this as it captures the video, but nto sure that is possible. I can try opening up aperature (using ND filter) and then maybe shooting faster FSP, and then speeding up in post processing?

Levas

You can try to shoot a same length and settings video with the lenscap on.
Now you need a video editor with compose option (2 layers of video where you can substract the lower layer from the above layer of video). Most video editors can do this, a free option is davinci  resolve lite. Hard to learn, but lots of tutorials available on youtube.

David Goldwasser

Thanks, I'll look into that. I'd even be ok with a static black frame image (even if not perfect it would be better). Do black frame algorithms fill the bad pixel with surrounding colors? Wonder if I take a copy of the video and heavily blur it, then use the black frame as mask for that blurred version of video, that then sits on top of the original video?

DaVinci Resolve looks great, thanks for top on that.

Levas

Black or dark frame substraction litterally substracts.
If you got for example a hot pixel in your normal video and in your darkframe you get:
Pixelvalue 255(value for white in case of 8 bit movie) - pixelvalue 255= pixelvalue 0 (which is the color black).
So with this method you are removing hot or stuck pixels and they become black pixels.

dmilligan

Dark frame subtraction only works with raw (linear) data. You can't perform dark frame subtraction on H.264, JPEG, or other non-raw data. It won't work because that data is non-linear. It also doesn't work because you've already subtracted out the 'black level' offset present in raw data (there is no black level offset in non-raw data, black is just 0).

If you record your time-lapse as raw video (MLV) or use the raw silent picture (silent.mo) with the intervalometer and save using the MLV format, the mlv_dump tool has an option to apply a dark frame to an MLV file.


mlv_dump INPUT.MLV -s DARK.MLV -o OUTPUT.MLV


However...

Dark frame subtraction will not fix bad pixels. To fix a bad pixel you need to detect it and perform an interpolation based on neighbor pixel values. Simple subtraction can't do this.

Bad pixels also need to be fixed from the raw data; once you are in H.264, JPEG, etc. it becomes much harder to find and fix them (main reason is that demosaicing will interpolate those bad pixels into neighboring pixels, also it's much easier to detect cold pixels before black level is subtracted, because they will have a value well below the black level).

MLVFS has bad pixel correction for MLV (I'm not sure about other conversion tools). However, most post processing apps (ACR/Lightroom, Resolve (except free version), Premiere, etc.) automatically remove bad pixels (because as mentioned above, bad pixels need to be removed before demosaicing).

David Goldwasser

Thanks, I just installed the mlv modules on the camera and am playing with test video with MLVFS that tI shot both with raw video and silent pictures. If I set bad pixel to on or aggressive should the .dng files coming out have some changes made? or does this just writing something to the .idx files?

Looks like there are some good tutorials out there. I'll look into them.

dmilligan

Quote from: David Goldwasser on May 29, 2015, 09:28:20 AM
If I set bad pixel to on or aggressive should the .dng files coming out have some changes made?
Yes. But you only need to use it if your post processing tool doesn't get rid of them itself. The free version of Resolve doesn't remove them, but ACR/AE/Lightroom, Premiere (only when you render, you'll still see them in preview), SpeedGrade, and the full version of Resolve should.

David Goldwasser

I've been playing around with slight picture and intervalometer. I've been playing around with saving as MLV. I have been using MLV to convert to DNG, and then I've been using RawTherapee to convert to process and then Time Lapse Assembler to make the movie files. Seems to work pretty well. Seems to handle bad pixels well; seem noise at first but post processing seems to clean it up well. When I have something I really care about for now I'll still use shutter and intervalometer, but I'll try this a lot as well. Haven't tried out slight picture on longer exposure night shot yet. If I'm shooting stars I probably want all of the resolution.

Thanks for all the help, in a few weeks when I have time hopefully I'll post some shots using various techniques.