MLV-App icon indicating copy to clipboard operation
MLV-App copied to clipboard

Add flat frame correction

Open ilia3101 opened this issue 5 years ago • 12 comments

I want to do this, I will implement the processing part. I am just so tired of dust (!!!😡😡😡)

I am not sure how it will work in GUI tho, probably same as dark frame hopefully can get some help.

Or am i dumb and it's already in there?

ilia3101 avatar Mar 14 '19 19:03 ilia3101

What is a flat frame correction? For correcting a vignette? Then we have something like that... But it has to be applied manually. Where I am still searching for is a Chromatic Aberation Correction. No idea how to do that...

masc4ii avatar Mar 14 '19 19:03 masc4ii

Flat field corrects any unevenness of exposure across the frame, which includes vignetting and dust particles (unless they're just completely black).

I imagine it works like this: Creating the flat frame: average a few frames of the sky or something completely flat + adjust the exposure so average pixel value is 1 + make it black and white To apply: Divide pixels in the normal frame by flat frame's pixels in the same location.

ilia3101 avatar Mar 14 '19 20:03 ilia3101

I mainly want to use it for these dust blobs I have

ilia3101 avatar Mar 14 '19 20:03 ilia3101

Also flat field processing is implemented in mlv_dump by g3gg0, so you can take a look there. I think @dannephoto has good experience of using FF.

bouncyball-git avatar Mar 15 '19 10:03 bouncyball-git

Oh, I've been through flat framing and my experience is that it's hard to use with ease. Not at all like darkframing. If you want to get rid of dust you might want to check the remove grain filter. It's very effective and works like an average median filter: https://www.magiclantern.fm/forum/index.php?topic=15774.msg208294#msg208294

Maybe something for Mlv App?

dannephoto avatar Mar 15 '19 14:03 dannephoto

Hm... but an 2D average median filter is already implemented in MLVApp. But wait some hours, I think I'll upload something very cool this evening! Need some testers then! 😄

masc4ii avatar Mar 15 '19 15:03 masc4ii

@dannephoto

Oh, I've been through flat framing and my experience is that it's hard to use with ease. Not at all like darkframing. If you want to get rid of dust you might want to check the remove grain filter. It's very effective and works like an average median filter: https://www.magiclantern.fm/forum/index.php?topic=15774.msg208294#msg208294

Maybe something for Mlv App?

Looks like something for small scale issues, not dust blobs at f4, would maybe help for f22 but I don't ever shoot like that. However I like a1ex's idea there. I wonder what effect it will have on moire.....

I also have some ideas for flat framing to fix issues I can imagine. What were your main difficulties?

ilia3101 avatar Mar 16 '19 17:03 ilia3101

The median filter can remove little moiree (some single color pixels at contrast lines)... but removes some detail too (like nearly all filters). For some moiree, the new recursive bilateral filter works great, have a look: Before: Bildschirmfoto 2019-03-16 um 19 37 12 After: Bildschirmfoto 2019-03-16 um 19 37 42

masc4ii avatar Mar 16 '19 18:03 masc4ii

Wow, bilateral ftw. Bouncyball. Firstly a custom flat frame for each lems is needed. Also needs testing regarding what f-stop to use. Not always best with same as the recorded file. Automation parameters will be difficult.

dannephoto avatar Mar 17 '19 12:03 dannephoto

Yeah... I remember that lot of hoop jumping is needed to properly use flat frame and have good results.

bouncyball-git avatar Mar 18 '19 08:03 bouncyball-git

Ok I am reconsidering a bit... also where is dark frame implemented, in llrawproc?

ilia3101 avatar Mar 18 '19 22:03 ilia3101

Yes. MLVApp/src/mlv/llrawproc/darkframe.c/.h

masc4ii avatar Mar 19 '19 08:03 masc4ii