DNG meta data determining RAW converter crop behavior often of mediocre quality - page 2 - General Discussion and Assistance - CHDK Forum

DNG meta data determining RAW converter crop behavior often of mediocre quality

  • 31 Replies
  • 20084 Views
*

Offline reyalp

  • ******
  • 14126
Advertisements
Just a quick note: the "partially shaded border" is much less shaded on images taken with zoom. It exists because vignetting correction is not applied to the border area.
So some (but not all?) of the vignetting correction is applied to the raw? I vaguely remember something about this in one of Stick's threads.

edit:
This probably explains some of the "amp glow" in the corners, since it can't avoid amplifying and dark current as well (see http://chdk.setepontos.com/index.php?topic=11062.20). Obviously not all of it, since the "amp glow" effect generally isn't symmetric.
« Last Edit: 31 / August / 2014, 20:57:02 by reyalp »
Don't forget what the H stands for.

Just a quick note: the "partially shaded border" is much less shaded on images taken with zoom. It exists because vignetting correction is not applied to the border area.
So some (but not all?) of the vignetting correction is applied to the raw? I vaguely remember something about this in one of Stick's threads.
Really?

If that is true,  then the RAW information in a CHDK raw file is not really the pixel information from the sensor.

This is the first time I have heard a suggestion that some processing is applied to the sensor data prior to CHDK capturing it.   Seems a bit strange.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14126
This is the first time I have heard a suggestion that some processing is applied to the sensor data prior to CHDK capturing it.   Seems a bit strange.
It seems like it would be pretty easy to implement in the readout process (just adjust the values according to some pre-defined function that roughly matches the vignetting), so it's not totally silly. As I said, I think this was discussed in one of Sticks threads, but the implication didn't sink in for me.

edit:
See http://chdk.setepontos.com/index.php?topic=8801.msg99227#msg99227
« Last Edit: 21 / April / 2017, 23:53:00 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4451
There's at least one more kind of pre-processing done on the raw data before it's written to RAM: sensor defect and bad pixel compensation. Bad pixels are either marked as bad (in most cameras) or fixed on-the-fly (newer models in certain modes). I haven't seen marked pixels (nor half-shaded border) in RAW images from my DIGIC 6 camera. All this pre-processing is done by the DIGIC (DSP part), not by the sensor or other external circuits.
I'd like to note that newer DIGICs appear to have several noise reduction methods (debug strings indicate this), perhaps some of those can be applied during pre-processing...

edit: Attachment is a corner of a raw image taken with ixus115 (200% magnification), marked bad pixels only appear in the inner part which also received vignetting correction.
« Last Edit: 01 / September / 2014, 16:45:51 by srsa_4c »

*

Offline koshy

  • *****
  • 1096
I had to think about this for a while and there is more going on here than meets the eye. Maybe the nature of some of this can be proven... I came up with a simple test scenario:

- take a cam and override Exposure time, ISO and ND-Filter/Aperture
- take two DNG photos of an evenly lit surface (e.g. white screen portion, out of focus)
    - 1) zoomed out
    - 2) zoomed in

I took SD850 @5.8mm and 23.2mm. The lens has a printed label saying that it's aperture is 1:2.8-5.5. One would thus expect the zoomed in photo to be ~1.5 times darker in terms of linear intensities than the zoomed out. It is not. The two photos seem identical in terms of intensities reaching the sensor. They can't be.

- take exiftool and do "exiftool -BlackLevel= - ActiveArea= *.dng" on the two DNGs
- in PS levels brighten the image by factor 8 (highlight 255>31) this combs up our histogram.

We're only interested in the fully covered black sensor areas. They should be the same, no matter the zoom level. They are not as can be seen in the attached graphic. So the zoomed in photo got amplified to even out the exposure difference between zooming out and zooming in.

Now comes the interesting question. When and how was it amplified? If it was amplified after analog/digital conversion that would have combed the histogram, meaning that there should still be about the same count of different tones of noise (just broadened in terms of histogram. This would be a bad design because it would effectively lessen the bit depth of the sensor when zooming in by 1 to 2 bit. It turns out that does not seem to be happening. Counting colors on the fully masked pixels I found 133 values in the green channel when zoomed out and 282 values when zoomed in. That is impossible to do digitally.

That amplification has to be done in the analog realm prior to a/d conversion. My working theory is that there is a second factor parallel to ISO that depends on the Zoom level which gets multiplied with the amplification factor derived from the ISO setting. The two together control the analog signal amplification prior to A/D conversion. The implication of that would be that it's impossible to shoot at what equals the cam's lowest ISO when zoomed in and also impossible to use the sensor's highest analog amplification when zoomed out. In other words shot noise will increase in zoomed in photos and decrease in zoomed out ones. Can this thing whatever it is be identified / maybe even get its own override in the future?
« Last Edit: 02 / September / 2014, 20:26:22 by koshy »
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline srsa_4c

  • ******
  • 4451
Can this thing whatever it is be identified / maybe even get its own override in the future?
This seems to be really low-level stuff. Playing with this might be easier in live view / video recording, you'd probably need to dig deep down in fw routines to apply it for stills.
There are event procedures with names like SetSensorPreGain, SetCDSGain, SetCDSGainStep (etc.), which may indicate multiple sensor gain related hardware.

*

Offline koshy

  • *****
  • 1096
I had to actively hunt for this thread, it has the most interesting findings I contributed to the project years ago. (RAW != RAW)

The vague feature request remains: Is it possible to create an override that enables actually shooting at the base ISO of a Canon compact camera no matter the zoom's sate? Using Zebra and +/- EV useful exposure settings can be dialed in I would expect, but for that an override probably has to affect both live view and still capture.
There are event procedures with names like SetSensorPreGain, SetCDSGain, SetCDSGainStep (etc.), which may indicate multiple sensor gain related hardware.
This will not be trivial but intriguing.
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline philmoz

  • *****
  • 3450
    • Photos
- take a cam and override Exposure time, ISO and ND-Filter/Aperture
- take two DNG photos of an evenly lit surface (e.g. white screen portion, out of focus)
    - 1) zoomed out
    - 2) zoomed in

I took SD850 @5.8mm and 23.2mm. The lens has a printed label saying that it's aperture is 1:2.8-5.5. One would thus expect the zoomed in photo to be ~1.5 times darker in terms of linear intensities than the zoomed out. It is not. The two photos seem identical in terms of intensities reaching the sensor. They can't be.


I must be missing something here.


If you overrode shutter speed, aperture, ND and ISO, then both images should be the same - you've taken two images with the same exposure settings so you should get the same result.


Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

*

Offline koshy

  • *****
  • 1096
If you overrode shutter speed, aperture, ND and ISO, then both images should be the same - you've taken two images with the same exposure settings so you should get the same result.
If the lens were a fixed aperture design yes but it's not.

@5.8mm it is f2.8
@23.2mm it is f5.5 - let's say f5.6 for easy factors

Zoomed out it lets ~four times as many photons reach the sensor as zoomed in. If you override shutter speed, aperture, ND and ISO that should show. It doesn't the image stays as bright. We established way back when that that's due to another amplification factor, that is not ISO but combined with it seems to control the actual pre A/D conversion analog gains. Where srsa_4c pointed to items like "SetSensorPreGain" in the event procedures. The amplification of noise in fully covered sensor areas demanded such an explaination.
Koshy had a little ELPH which wasn't white as snow but everywhere that Koshy went the ELPH was sure to go. (actually an SD, but that detail ruins the rhyme...)

*

Offline philmoz

  • *****
  • 3450
    • Photos
If you overrode shutter speed, aperture, ND and ISO, then both images should be the same - you've taken two images with the same exposure settings so you should get the same result.
If the lens were a fixed aperture design yes but it's not.

@5.8mm it is f2.8
@23.2mm it is f5.5 - let's say f5.6 for easy factors

Zoomed out it lets ~four times as many photons reach the sensor as zoomed in. If you override shutter speed, aperture, ND and ISO that should show. It doesn't the image stays as bright. We established way back when that that's due to another amplification factor, that is not ISO but combined with it seems to control the actual pre A/D conversion analog gains. Where srsa_4c pointed to items like "SetSensorPreGain" in the event procedures. The amplification of noise in fully covered sensor areas demanded such an explaination.


If you override the aperture then the same aperture is used for both shots (assuming the override is within the aperture range for the zoom level).
The maximum aperture that the lens can use at each end of the zoom is irrelevant.


That's how exposure is supposed to work - nothing unexplained going on that I can see.


Phil.


CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal © 2008-2014, SimplePortal