ilia3101 / MLV-App

All in one MLV processing app.
https://mlv.app/
GNU General Public License v3.0
281 stars 29 forks source link

Add flat frame correction #154

Open ilia3101 opened 5 years ago

ilia3101 commented 5 years ago

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?

masc4ii commented 5 years ago

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...

ilia3101 commented 5 years ago

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 commented 5 years ago

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

bouncyball-git commented 5 years ago

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.

dannephoto commented 5 years ago

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?

masc4ii commented 5 years ago

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! 😄

ilia3101 commented 5 years ago

@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?

masc4ii commented 5 years ago

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

dannephoto commented 5 years ago

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.

bouncyball-git commented 5 years ago

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

ilia3101 commented 5 years ago

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

masc4ii commented 5 years ago

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