Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - ghost0cnc

#1
Other experimental builds / Re: Cleaner ISO presets
December 11, 2019, 02:48:54 PM
I'm still experimenting with the settings, but so far I modified the engio_write_log, adtg_log and cmos_log functions to automatically adjust the settings depending on the current lens_info.raw_iso value.
Caution: This is probably racy! I haven't looked into the code much further.

I added an "autoconfig" option to the iso_regs module and hard-coded some settings which will be applied if the autoconfig-flag is set.

Camera: 5D Mark III

cmos_log: Shifts each selectable ISO-value by 1 stop.
switch (lens_info.raw_iso) {
case 64: cmos_gain = 0x003; break; // ISO 50 -> ISO 100 Gain
case 72: cmos_gain = 0x113; break; // ISO 100 -> ISO 200 Gain
case 80: cmos_gain = 0x223; break; // ISO 200 -> ISO 400 Gain
case 88: cmos_gain = 0x333; break; // ISO 400 -> ISO 800 Gain
...
}

When I select ISO 100 in the Canon settings (lens_info.raw_iso == 72), the CMOS-Gain is set to 0x113 which normally would be the correct value for Canon's ISO 200.
ISO 200 gets the CMOS-Gain of Canon's ISO 400 and so on.

So far, the images taken with ISO 50 to 6400 just get brighter by 1 stop.

To compensate for this I also adjusted the ADTG-Settings and stretched the usable range of the 14-bit format:

adtg_log:
- adtg_preamp = 2;
- adtg_fe = 4;
- adtg_gain = 1050; (except for lens_info.raw_iso == 64: adtg_gain = 1220;)
- black_reference = 2048;

adtg_fe=3 gives a little more highlight headroom but causes more banding in the shadows compared to adtg_fe=4.

engio_write_log:
- black_white_offset = 3058;
- saturate_offset = 118;
- digital_gain = 463;


The resulting images have about the same brightness as the original Canon settings but with less shadow noise (and ISO 50 is actually useful).

I haven't fully understood the black_reference, saturate_offset and black_white_offset settings, which causes issues in live-view mode.

Let's find some "optimal" settings and write a config that loads the best settings for each selected ISO-value. :)
#2
Yesterday I encountered serious vertical fixed-pattern banding on some images. On other images there was no banding at all.

5D Mark III 1.2.3 + ML crop_rec_4k.2018Mar10.5D3123
Canon EF80-200mm f/2.8L (very old lens)

Same exposure settings and iso_regs configuration on all images, iso_regs modified to enable the "CMOS-Patch".
AI Servo, 1/1000s, f/2.8, Canon ISO 3200, tweaked with the following overrides:

CMOS[3] = 2372 (0x944)
CMOS[4] = 792 (0x318)

ADTG-0xFE = 4
ADTG-Preamp (8/9/A/B) = 2 (2 is the lowest value that does not cause banding due to an underflow of one of the other parameters)
ADTG-Gain (8888) = 950
SaturateOffset = 1200 (caused some green tint issues on a few older images)



Top 800px of each image at +2EV and the same white-balance applied, images 1 + 2 with banding, 3 without:


Top "optical black" bars of the three images (dcraw -T -E -W -b 1 -g 50 500)
The fixed-pattern noise is pretty visible. The last ob-image (without banding) is far brighter - if these dcraw settings are not useful for a comparison, please tell me better settings and I will update the image.

Download the RAWs (90 MB, zip)



Do you have an idea what could have caused the fixed-pattern banding?

Brainstorming:
- Bad iso_regs settings
  -> critical value for SaturateOffset (?), but this should change the tint
  -> variations of ADTG-Preamp, if the offsets change and I fix the first vaule to 2, it could possibly cause an underflow of another value

- Electromagnetic interferences from the lens
  -> would cause horizontal banding (?)
  -> no fixed pattern

- Mobile-phone interferences
  -> also horizontal (?), non-fixed-pattern noise

- Voltage fluctuations due to AF-motor power-consumption

- Aliens



In this case a normal dark-frame subtraction will not work, as the intensity of the FPN exceeds the amount of FPN I could get from a "normal" dark-frame.

As the approach of correcting banding using data from the optical-black bars was mentioned earlier in this thread - is there a banding correction tool for CR2 files available yet?
If not, I will have a look at it. Just need to get into RAW de- and encoding.
#3
Quote from: theBilalFakhouri on July 23, 2018, 07:39:41 PM
Very nice clean shadows with little small clipping of highlights in contrasty scenes only (there are no clipping highlights in the example above).

From 800 ISO to 100 (Using ADTG Gain) the shadows is more cleaner but with losing dynamic range in highlights of course. Now I am trying to restore that dynamic range (highlights) at ISO 800 with the registers that related to the gain and I am not really sure if that possible.

The biggest increase in dynamic range I could get on my 5D3 was about one stop at ISO 200->100.

Let's assume you can also get about 1 EV of extra dynamic range by reducing the analog gain (like on the 5D3).

At ISO 400->100 or even 800->100 you will get about 1 EV of extra dynamic range (that was clipped before). The remaining 1 or 2 EV will just darken the photo.

Let's have a look at 400->100:

Basically you dropped the analog gain by 2 EV, which is 1 EV below the saturation point, and pushed that 1 EV back up in post-processing, effectively replacing 1 EV of analog gain with 1 EV of digital gain in post.

When using ISO 400->200, you can possibly get better noise levels [1] and more dynamic range than at 400->100 (at the same shutterspeed+aperture).

Just reducing the analog gain will not help reducing noise. After passing the sweet spot that allows you to capture more light and/or use higher "base"/CMOS ISOs (which will improve SNR), you just replace analog with digital amplification (which is a problem due to ADC noise and limited precision, as you only use a fraction of the 14 bit resolution, but can be better, depending on the analog amplifier noise).

Test on the 5D3:
Same subject and lighting, shutterspeed+aperture fixed. WB and all other settings except "Exposure" (in LR) are the same.
(Sharpening 33/1.0/25/25, Luminance NR disabled, Color NR 25/50/75)
a) ISO 800->400 (-1 EV, sweet spot)
b) ISO 800->200 (-2 EV, 1 EV below sweet spot)
Pushed both images in Lightroom to about the same brightness (a +4EV, b +5EV). I know the exposures are not 100% identical, but the difference should be small enough.
Noise levels are pretty similar (hard to compare as the color-rendering is a bit off), but photo "b" has much stronger banding.



Fine-tuning the ADTG parameters is another story. There are many combinations that result in the same amplification but differ in image quality. Sadly I haven't had time to analyze which settings work best.

[1] Better ADC SNR, as you have a stronger analog signal; depends on the noise generated by the analog amplifier vs ADC noise