supplierdeeply

EXIF data of dng and jpg are not the same. which is right?

  • 5 Replies
  • 1713 Views
  • Publish
    EXIF data of dng and jpg are not the same. which is right?
    « on: 25 / July / 2010, 00:46:13 »
    Advertisements
    If I run exiftool on a set images in JPEG format, I get ExposureTime:
    1/640 1/500 1/400 1/320 1/250
    then if I run exiftool on the same set images but in DNG, I get:
    1/645 1/512 1/407 1/323 1/256

    The exposure time's returned for the jpgs agree with what's show on the screen.

    A still more vexing problem is the aperture data. I'm shooting in manual mode with a constant f/5.6, but running exiftool on the dngs returns 5.3, 5.8, or 5.9; whereas, for jpgs it reports 5.6 for every file. I'm trying to test the linearity of my CCD, so I took a photo at every possible Tv keeping everything else fixed.

    __exif data for JPG__
    Tv = [1/1250 1/1000 1/800 1/640 1/500 1/400 1/320 1/250 1/200 1/160 1/125 ...
            1/100 1/80 1/60 1/50 1/40 1/30 1/25 1/20 1/15 1/13 1/10 1/8 1/6 1/5 ...
            1/4 0.3 0.4 0.5 0.6 0.8 1 1.3 1.6 2 2.5 3.2 4 5 6 8 10 13 15].';
    Av = 5.6 for every photo.

    __exif data for DNG__
    Tv = [1/1290 1/1025 1/813 1/645 1/512 1/407 1/323 1/256 1/203 1/161 1/128 ...
            1/102 1/81 1/64 1/51 1/40 1/32 1/25 1/20 1/16 1/13 1/10 1/8 1/6 1/5 ...
            1/4 0.3 0.4 0.5 0.6 0.8 1 1.3 1.6 2 2.5 3.2 4 5 6.3 8 10.1 12.7 16].';
    Av = [5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 ...
            5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.3 5.8 5.9 ...
            5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9 5.9].';

    Which numbers are right?

    Will the camera change the Av by itself even in manual mode? I'm using manual focus, and I can hear that the camera is not autofocusing. Maybe it's adjusting the aperture diameter? I have an A590, which doesn't have a neutral density filter.

    *

    Offline reyalp

    • ******
    • 9955
  • Publish
    Re: EXIF data of dng and jpg are not the same. which is right?
    « Reply #1 on: 25 / July / 2010, 01:42:13 »
    In theory, the real 'stops' of Tv values should be powers of 2, e.g. 1/16 1/32 1/64

    However, for marketing (?) reasons camera manufacturers call these 1/15th, 1/30th etc. The actual difference in exposure between say 1/125th and 1/128th is going to be imperceptible, and quite possible unmeasurable on these cameras.

    The DNG code calculates these as:
    pow(2,-tv/96.0) where Tv is the APEX96 value from PROPCASE_TV

    You can find out what the canon firmware does for a given value by examining the original canon apex2us function. The actual shutter time may be recorded in the maker note somewhere too.

    Not sure about the Av values.
    Edit: The DNG AV values come from
    pow(2,av/192.0) of the PROPCASE_AV value.
    « Last Edit: 25 / July / 2010, 01:44:09 by reyalp »
    Don't forget what the H stands for.

  • Publish
    Re: EXIF data of dng and jpg are not the same. which is right?
    « Reply #2 on: 25 / July / 2010, 05:43:57 »
    Thanks.

    Well by looking at my graph of "average counts" versus Tv I see that the plot is linear for the f/5.3 values, then the line's slope abruptly changes at f/5.8 and continues on with that new slope until the CCD saturates. So I have to say that the aperture values in the DNG EXIF data are the correct ones. Apparently even though I'm in manual mode, the camera still fine-tunes the exposure. Further details on the reasons for this would be appreciated if anyone knows more about it.

    *

    Offline fudgey

    • *****
    • 1705
    • a570is
  • Publish
    Re: EXIF data of dng and jpg are not the same. which is right?
    « Reply #3 on: 25 / July / 2010, 08:20:14 »
    Apparently even though I'm in manual mode, the camera still fine-tunes the exposure. Further details on the reasons for this would be appreciated if anyone knows more about it.

    I don't know about fine-tuning of exposure time, but it's worth noting that fine tuning of white balance happens in all white balance modes except custom. Tuning range is of course quite limited in modes other than auto white balance, but it will propagate into CHDK DNG for cameras that we have camera WB support for DNG.

    As reyalp hinted, you can find both exposure time values from the JPEG exif tag. Some examples from my recent shots:

    exiftool -Makernotes:ExposureTime -Exposuretime *.JPG
    ======== IMG_6577.JPG
    Exposure Time                   : 1/16
    Exposure Time                   : 1/15
    ======== IMG_6578.JPG
    Exposure Time                   : 1/256
    Exposure Time                   : 1/250
    ======== IMG_6580.JPG
    Exposure Time                   : 1/512
    Exposure Time                   : 1/500
    ======== IMG_6585.JPG
    Exposure Time                   : 1/108
    Exposure Time                   : 1/100
    ======== IMG_6586.JPG
    Exposure Time                   : 1/54
    Exposure Time                   : 1/50
    ======== IMG_6587.JPG
    Exposure Time                   : 1/215
    Exposure Time                   : 1/200
    ======== IMG_6588.JPG
    Exposure Time                   : 1/27
    Exposure Time                   : 1/25
    ======== IMG_6589.JPG
    Exposure Time                   : 1/431
    Exposure Time                   : 1/400

    It's worth noting that many of the above images were shot with CHDK continuous mode Tv bracketing override, making them a little bit bad examples.


  • Publish
    Re: EXIF data of dng and jpg are not the same. which is right?
    « Reply #4 on: 25 / July / 2010, 21:23:36 »
    I'm using a custom/fixed white balance. If anybody can explain the change in the f-number for faster shutter speeds I'd like to hear it. I can see how narrowing the aperture would make a faster shutter speed possible, but f/5.3 means a wider aperture


    I just looked through all the EXIF data and I found that the fastest shutter speeds have still more exposure times/shutter speeds. I'm guessing it has something to do with the difficultly of physically moving the shutter quickly and precisely. However, the exposure time given by the DNG EXIF isn't found in the JPEG EXIF for the faster speeds.

    The fastest available shutter speed at the zoom I was using:

    exiftool -a -u -g1 img_1340.jpg | grep -i -E "exposure time|shutter speed"
    Exposure Time                   : 1/1250
    Shutter Speed Value             : 1/1244
    Target Exposure Time            : 1/1244
    Exposure Time                   : 1/1272
    Shutter Speed                   : 1/1250

    exiftool -a -u -g1 img_1340.dng | grep -i -E "exposure time|shutter speed"
    Exposure Time                   : 1/1290
    Shutter Speed Value             : 1/1290
    Shutter Speed                   : 1/1290

    -----

    The slowest shutter speed:

    exiftool -a -u -g1 img_1383.jpg | grep -i -E "exposure time|shutter speed"
    Exposure Time                   : 15
    Shutter Speed Value             : 15
    Exposure Time                   : 16
    Shutter Speed                   : 15


    exiftool -a -u -g1 img_1383.dng | grep -i -E "exposure time|shutter speed"
    Exposure Time                   : 16
    Shutter Speed Value             : 16
    Shutter Speed                   : 16


    *

    Offline fudgey

    • *****
    • 1705
    • a570is
  • Publish
    Re: EXIF data of dng and jpg are not the same. which is right?
    « Reply #5 on: 26 / July / 2010, 05:01:44 »
    Quote
    I just looked through all the EXIF data and I found that the fastest shutter speeds have still more exposure times/shutter speeds. I'm guessing it has something to do with the difficultly of physically moving the shutter quickly and precisely. However, the exposure time given by the DNG EXIF isn't found in the JPEG EXIF for the faster speeds.

    The most dramatic differences in Av/Tv/ISO values found in EXIF tags can be expected to be those between the user interface Av/Tv/ISO values and values that have actually been used for shooting. When using CHDK to override exposure (which is done by writing to certain propcases at certain stages of the shooting process), the camera is fooled and the user interface values from EXIF are no longer valid at all. It may be of interest to you to see what happens to each of those Tv values you found from the EXIF when you activate a Tv override.

    Anyway, I find it rather unlikely that the camera's mechanical performance would be measured by the camera in order to get more accurate exposure time values for JPEG development. AFAIK, these cameras have electronic shutters and only need to cover the CCD mechanically during data readout in photo mode, meaning the shutter's mechanical performance isn't an issue.

    My first guess for the source of a third Tv value is that exiftool is translating decimal numbers to fractional with different precision compared to the camera or that the values are simply stored in different precisions or formats (string, fractional, decimal, integer, floating point). See http://www.sno.phy.queensu.ca/~phil/exiftool/under.html#conversions .

    My second guess is rounding errors in limited precision arithmetic for values coming up from different algorithms of the exposure process.

    My third guess is that the camera's exposure time timer has limited resolution and can't precisely realize the desired (target?) value when Tv is very fast (or at certain ranges). Statistical analysis of existing shots could help determining whether this is the case or not (probably not... if my memory serves, extra long exposure code deals with microseconds).

    Some old threads about EXIF you may or may not have read:
    http://chdk.setepontos.com/index.php/topic,138.0.html
    http://chdk.setepontos.com/index.php/topic,3996.0.html
    Threads about overrides (very high shutter speed overrides in particular) may be of interest as well if you haven't read them.


     

    Related Topics