New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible error in the flat field algorithm #5848
Comments
I believe this part of code is approximately in here: RawTherapee/rtengine/rawimagesource.cc Line 2398 in 60034aa
|
From RawPedia: Applying a flat-field image can cause nearly-overexposed areas in the image to become overexposed due to the correction. Activating the Clip Control option will keep the flat-field image from clipping the actual image. Areas in the actual image which were already clipped before the application of the flat-field image may acquire a color cast, therefore as a rule of thumb, if your photo contains overexposed areas it is better to not use Clip Control. |
https://github.com/Beep6581/RawTherapee/blob/dev/rtengine/rawflatfield.cc#L266 |
Wouldn't that be an inverse flatfield correction (brightening the already bright regions even more and vice versa for the darker regions) ? |
I wonder why would it cause color cast? Maybe use another color space and adjust only brightness? In addition, this algorithm I provided should only decrease brightness, not increase, so clipping will be impossible (I think). I am assuming that flat field is always grey and has no color(r=g=b). |
This is the correct behavior. Dark frames work best when they are shot under similar conditions as the image. Usually, the image and the flat-field are shot under different conditions, so it doesn't make sense to apply the same dark frame to both. Maybe what you want is a new feature which allows you to apply a different dark frame to the flat-field.
I believe this is because clip control darkens the image without adjusting the white level. It's like setting the white level too high. When there are clipped highlights and the white level is too high, you get a color cast (often magenta). Please note that this is also expected behavior. |
Unfortunately I couldn't find that part of the code with this particular algorithm, so writing in here.
I am suspecting that dark frame might be not subtracted from the the flat field, so flat field might remain "dirty".
Also as I understood correctly, this should be the algorithm, assuming each variable is vector, as in matlab:
The response might include just a link to the file so I could check myself.
Otherwise I get somewhy too much noise and too bright image with low contrast when applying flatfield to very dark photos,
btw auto clip control looks broken in flat fields tab, it doesn't normalize definitely clipped photos.
The text was updated successfully, but these errors were encountered: