User avatar
jbeale
Posts: 3254
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

raspicam JPEG: EXIF field "Light Value"

Thu May 23, 2013 7:10 pm

I am curious about the "Light Value" reported in the EXIF data from a raspicam JPEG file. Is this number an absolute measurement of scene illumination, like EV (exposure value)? I am seeing numbers like 8.4 on an outdoor scene, and 0.7 on a dark interior. Is there a direct mapping between this value and "Shutter Speed", assuming I don't adjust exposure manually?

example output (outdoor photo) from exiftool :

Code: Select all

ExifTool Version Number         : 9.29
File Name                       : LA0003.jpg
Directory                       : .
File Size                       : 267 kB
File Modification Date/Time     : 2013:05:21 22:53:14-07:00
File Access Date/Time           : 2013:05:23 11:57:38-07:00
File Creation Date/Time         : 2013:05:21 16:57:20-07:00
File Permissions                : rw-rw-rw-
File Type                       : JPEG
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Camera Model Name               : ov5647
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Modify Date                     : 1970:01:01 00:00:00
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/337
F Number                        : 0
Exposure Program                : Aperture-priority AE
ISO                             : 100
Exif Version                    : 0220
Date/Time Original              : 1970:01:01 00:00:00
Create Date                     : 1970:01:01 00:00:00
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 1/337
Aperture Value                  : 1.$
Brightness Value                : 3.37
Max Aperture Value              : 1.$
Metering Mode                   : Center-weighted average
Flash                           : No Flash
Focal Length                    : 0.0 mm
Maker Note Unknown Text         : (Binary data 303 bytes, use -b option to extract)
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 720
Exif Image Height               : 540
Interoperability Index          : R98 - DCF basic file (sRGB)
Exposure Mode                   : Auto
White Balance                   : Auto
Compression                     : JPEG (old-style)
Thumbnail Offset                : 996
Thumbnail Length                : 24576
Image Width                     : 720
Image Height                    : 540
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 1.#INF
Image Size                      : 720x540
Shutter Speed                   : 1/337
Thumbnail Image                 : (Binary data 24576 bytes, use -b option to extract)
Focal Length                    : 0.0 mm
Light Value                     : 8.4

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Fri May 24, 2013 2:47 am

Looking at my hand-held light meter, EV 8.7 at ISO 100 and shutter speed 1/377s would correspond to an f-stop of f/1.

Somehow I doubt the camera has a that large an aperture. For sure there’s some sort of APEX type of calculation going on, but is it being fed valid data?

And EV 8.7 is definitely not bright sunny outdoors. More like heavily overcast, or dusk.


boardhead
Posts: 2
Joined: Fri May 24, 2013 3:23 pm

Re: raspicam JPEG: EXIF field "Light Value"

Fri May 24, 2013 3:25 pm

There is something wrong with the ApertureValue of your image. I have no idea how a "$" sign could appear after the decimal. Could you show the output of "exiftool -v3" on this image. Or if you can send me the image I'll take a look myself. My mail is phil at owl.phy.queensu.ca

- Phil

Chris_Reynolds
Posts: 72
Joined: Mon May 14, 2012 7:25 am

Re: raspicam JPEG: EXIF field "Light Value"

Fri May 24, 2013 3:49 pm

I'm not sure I'd massively trust any of the EXIF data as yet as there are known issues with it that may be related to what the firmware is telling the userland code. http://www.raspberrypi.org/phpBB3/viewt ... 43&t=44879

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Sun May 26, 2013 1:56 am

I’ve plotted some timelapse jpgs as a function of BV
Image

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Sun May 26, 2013 10:47 pm

I’ve tried to aggregate all more or less sensible looking values from EXIF

Image

Brightness Value (BV) is Light Value as far as I can tell.

Strange that shutter speed seems to be fixed at 1/100 most of the time. Wonder if that is correct. But it varies

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Tue May 28, 2013 2:04 am

Hey jbeale, I’m trying to make light of this (pun intended).

In the APEX system, the power-of-2 exposure calculation is made additive by introducing a log2 based unitless scale for each of aperture (Av), shutter speed (Tv), film speed (Sv), scene luminance (Bv), and famously the exposure value (Ev). In each of these scales 1 corresponds to one stop.

Looking into the jpgs there’s a diagnostic string in the binary EXIF:MakerNote field

Code: Select all

ev=-1 mlux=-1 exp=1203 ag=256 focus=255 gain_r=1.519 gain_b=1.214 greenness=14 ccm=7818,-3234,-442,-1106,5488,-284,238,-2652,6514,0,0,0 md=0 tg=225 225 oth=0 0 b=0 f=225 225 fi=0
Unforch some values are unset here as in the properly exposed EXIF values. But I managed to map some of these.
  • exp is Exif:ShutterSpeed * 1e6 and the inverse of that gives the familiar 1/30s notation
  • ag is a weird map of sensitivity. ag=256 is ISO100 and ag=2048 is ISO 1250. The values ramp up very gradually in much finer steps than EXIF:ISO, but there’s a good match after binning.
  • EXIF:BrightnessValue is weird. There’s a convention that Bv + 5 gives EV at ISO100, which might be a solution to your question already. but plotting BV gives a non-monotonous function as dusk sets in. It’s got to be something else
So I’ve tried to map these to APEX to get a grip on the exposure calculation.
  • Bv = EXIF:BrightnessValue
  • Sv = log2(ag)-3
  • Tv = -log2(exp / 1e6)
Now plotting these across dusk I got this

Image

Shutter speed decreases as dusk set in, and at some point it stops and stays at 1/30s and ISO is ramped up slowly. When ISO reaches 1250 it bottoms out.

What puzzles me is that Bv bottoms out only after ISO and shutter speed have reached their max. Now when we combine them all as plot(bv - sv + tv) we get this

Image

Which I think could theoretically be the real Ev. But this does not make sense because in the exposure calculation

Ev = Bv + Sv

I’ll have to compare this with my real light meter.

User avatar
jbeale
Posts: 3254
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: raspicam JPEG: EXIF field "Light Value"

Tue May 28, 2013 6:51 am

I like the graphs! Wondering what your still settings are; my camera seems to go to ISO 800 and 1/8 second in the dark using default settings, but not beyond.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Tue May 28, 2013 11:43 am

Ah, right! This is with --metering matrix --awb off and --exposure night. It’s strange. I’ll have to repeat that with default settings.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17569
Joined: Sat Jul 30, 2011 7:41 pm

Re: raspicam JPEG: EXIF field "Light Value"

Tue May 28, 2013 1:10 pm

jbeale wrote:I like the graphs! Wondering what your still settings are; my camera seems to go to ISO 800 and 1/8 second in the dark using default settings, but not beyond.
Different exposure modes will apply different limits to ISO and exposure time. Not sure specifically what does which and when. Will add it to list of stuff to figure out. It's a long list.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Tue May 28, 2013 2:40 pm

Sorry bout that James. We're piling up stuff to look into and you've become the bottleneck.

One more thing, the EXIF gives a max of ISO 1250, but the ag values from the binary tag stop at 800. But it's obvious they are a transformation of each other.

Image

User avatar
jbeale
Posts: 3254
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: raspicam JPEG: EXIF field "Light Value"

Wed May 29, 2013 5:07 am

towolf wrote:Ah, right! This is with --metering matrix --awb off and --exposure night. It’s strange. I’ll have to repeat that with default settings.
I did not have good luck using your settings just now, with a dim outdoor scene lit only by a streetlight. The "Light Value" seems very random; the actual scene illumination did not change between shots. Having manual control of ISO and Shutter Speed certainly would be nice.

raspistill -w 960 -h 720 --metering matrix --awb off --exposure night -o capture.jpg
Exiftool: ISO 640, Shutter Speed 1/6173, Light Value 9.9
Image: completely black

raspistill -w 960 -h 720 -o capture.jpg
Exiftool: ISO 500, Shutter speed 1/8, Light Value 0.7
Image: dim shapes visible
Last edited by jbeale on Wed May 29, 2013 5:31 am, edited 1 time in total.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Wed May 29, 2013 5:16 am

Actually that’s something I wanted to raise here as well. --exposure night is quite effective in video mode but seems pretty ineffectual for stills. I’ve turned "night" off now and will analyze the behaviour when I collected more samples.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17569
Joined: Sat Jul 30, 2011 7:41 pm

Re: raspicam JPEG: EXIF field "Light Value"

Wed May 29, 2013 7:18 am

towolf wrote:Sorry bout that James. We're piling up stuff to look into and you've become the bottleneck.
Going to get worse - I actually have to do some proper work or I'll probably get a rollicking! I've probably got two weeks solid work just in the requests and bugs so far...
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Wed May 29, 2013 1:47 pm

jamesh wrote:
towolf wrote:Sorry bout that James. We're piling up stuff to look into and you've become the bottleneck.
Going to get worse - I actually have to do some proper work or I'll probably get a rollicking! I've probably got two weeks solid work just in the requests and bugs so far...
And why can’t your superiors just give the green light to put you on fixing the raspberry pi camera up for two weeks? In some sense we are customers too and Broadcom could definitely use some good PR in the Linux community.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Wed May 29, 2013 4:16 pm

As I thought, in stills mode -ex night seems to have no particular effect. I was using a bash loop with -t 2000 and not the timelapse mode with -tl, which seems to do weird things.

Image
Image

For explanation of the different shape of the curve, picture of yesterday and today at 06:45
Image
Image

Would love to be able to use the video mode again, bit with the wider binned mode.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17569
Joined: Sat Jul 30, 2011 7:41 pm

Re: raspicam JPEG: EXIF field "Light Value"

Wed May 29, 2013 4:39 pm

towolf wrote:
jamesh wrote:
towolf wrote:Sorry bout that James. We're piling up stuff to look into and you've become the bottleneck.
Going to get worse - I actually have to do some proper work or I'll probably get a rollicking! I've probably got two weeks solid work just in the requests and bugs so far...
And why can’t your superiors just give the green light to put you on fixing the raspberry pi camera up for two weeks? In some sense we are customers too and Broadcom could definitely use some good PR in the Linux community.
Because the customers that pay us 10's of millions are more important than the customers who pay us millions! We have a hell of a lot of work on both on current projects (money now) and future software development (money later) and not enough time to do it (timescales are always too short in the mobile market).

Broadcom have very graciously donated a hell of a lot of manpower to Raspberry Pi - in cost terms more than they have made back in chip sales. Having a go at them about PR is counter productive. The future will show just how much Brcm had donated to Raspberry Pi.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: raspicam JPEG: EXIF field "Light Value"

Thu May 30, 2013 4:16 am

towolf wrote: I was using a bash loop with -t 2000 and not the timelapse mode with -tl, which seems to do weird things.
Speaking of which, is it only for me that the --timelapse mode goes off with exposure with wild abandon shortly after it was started? It goes in both directions (severely overexposed or severely underexposed) and it doesn’t matter which --expsoure or ..metering I choose.

Short example: https://www.youtube.com/watch?v=41heLr_R-0g

The line used for this one

Code: Select all

raspistill -v -n -q 90 -tl 3000 -t 259200000 -o /mnt/live/jpg5/%08d.jpg
Another one in the other direction that had -ex night on: https://www.youtube.com/watch?v=FiXxdOd2EuU

Did I break it somehow?

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 10 guests