Magic Lantern Forum

Using Magic Lantern => Raw Video => Raw Video Postprocessing => Topic started by: Frank7D on February 11, 2017, 05:39:18 PM

Title: Dark Frames for RAW video--Optimal Opacity?
Post by: Frank7D on February 11, 2017, 05:39:18 PM
I make my own dark frames to remove FPN rather than using the tools people have shared here, but I hope my question is still generally relevant and is somewhat apples to apples (even if perhaps McIntosh to Granny Smith).

It seems as though when subtracting the dark frames, a crucial decision is how strongly to apply them. So in Photoshop or After Effects for example, after putting the dark frame layer above the video layer and setting the blending mode to "subtract," you would adjust the dark frame's opacity to the value that removes the most FPN.

What I have noticed is that there is inevitably a compromise between FPN vertical lines in the lighter areas and the darker ones. As you reduce the opacity the lighter areas improve but the darker ones get worse. Obviously this is most problematic in high-contrast scenes.

My question: Is this a general characteristic of all dark frames?
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: a1ex on February 11, 2017, 05:42:13 PM
Best guess (as I don't use these tools):

When you place the dark frame in a Photoshop layer, the image data is no longer linear; also, values below 0 are clipped. Therefore, a simple subtraction will probably not do the trick.

Subtracting the dark frame before debayering should do the trick (regardless of what tool you use to do that).
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: Frank7D on February 11, 2017, 05:45:49 PM
a1ex, thanks for the insight! I will explore that possibility.
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: DeafEyeJedi on February 11, 2017, 06:04:51 PM
Also don't forget to check out @Danne's latest cr2hdr.app (https://www.magiclantern.fm/forum/index.php?topic=15108.0cr2hdr.app) which does wonders in DarkFraming average process.
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: Frank7D on February 11, 2017, 06:59:21 PM
Jedi: Thanks for the tip. I'm on Windows though so can't use Danne's app.

a1ex: In my current workflow (with After Effects) I found that if I apply a curves effect to the dark frame I can adjust its "linearity" to improve matters. A more perfect solution will have to wait for another day.

Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: Danne on February 11, 2017, 07:13:48 PM
Could you elaborate on how you apply the darkframes in AE or Photoshop? I want to try out some filters in FFmpeg which could work outside the MLV container workflow. Could you perhaps do a step by step description here?
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: Frank7D on February 11, 2017, 11:11:59 PM
Danne, there's not much to it.
1 - Put the dark frame above the video (or photo) and set the blending mode to "subtract."
2 - Adjust the dark frame's opacity if needed. Sometimes 100% works fine.
3 - After a1ex's tip about linearity, I tried applying the "curves" effect to the dark frame and found a curve that seemed to result in equal FPN reduction in light and dark areas of the noisy image. Below is a picture of it. Maybe it will need to be adjusted for every image.
(https://photos-3.dropbox.com/t/2/AADyQnapxLGL_v9eGFAh8-qAqYRpksRnbVbHuzWxo5m_0w/12/349513414/jpeg/32x32/1/_/1/2/DarkFrameCurve.jpg/EKmb0t4CGBIgAigC/LyoKWUluy17gVoenWKJSrUVGOXQYnZPJuhiNWDzbmj0?size=800x600&size_mode=3)
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: Danne on February 12, 2017, 02:03:23 PM
Ok, thanks.
Is the picture showing? Can,t see it on my cell phone at least.
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: Frank7D on February 13, 2017, 04:15:11 AM
I'm having trouble with it. Maybe this link will work:
https://www.dropbox.com/s/yj4nsm2drx4433w/DarkFrameCurve.jpg?dl=0
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: SpcCb on February 13, 2017, 06:00:12 AM
Quote from: a1ex on February 11, 2017, 05:42:13 PM
Best guess (as I don't use these tools):

When you place the dark frame in a Photoshop layer, the image data is no longer linear; also, values below 0 are clipped. Therefore, a simple subtraction will probably not do the trick.

Subtracting the dark frame before debayering should do the trick (regardless of what tool you use to do that).
I agree, it's the optimal and the most simple way.

However, after debayering _theoretically_ if there's no clipping|scaling in the dynamic, and if the process of dark frames and light frames are the same (log, etc.), it should _relatively_ match.
In all cases, if you make a *master dark frame* (average of several frames), it will better work. And maybe a small Gaussian smoothing could help too, to correlate with the Gaussian distribution of light frames.
Title: Re: Dark Frames for RAW video--Optimal Opacity?
Post by: Brawl on February 26, 2017, 11:20:11 PM
is it possibile to do Dark Frames for RAW video workflow with Premiere or Davinci? thx!