Exif Metadata from Raspberry Pi Camera Problem...

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Andros
Posts: 2
Joined: 2015-01-28T10:54:33-07:00
Authentication code: 6789

Exif Metadata from Raspberry Pi Camera Problem...

Post by Andros »

Hi all,

I am newbie here, but I need your help. Actually I am using exiftool to extract exif data from some images created with Raspberry Pi camera. Here is my output from exiftool:

Code: Select all

root@raspi /usr/freeware # time exiftool /tmp/snapshot.tmp.jpg
ExifTool Version Number         : 8.60
File Name                       : snapshot.tmp.jpg
Directory                       : /tmp
File Size                       : 107 kB
File Modification Date/Time     : 2015:01:28 19:30:05+02:00
File Permissions                : rw-r--r--
File Type                       : JPEG
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : RaspberryPi
Camera Model Name               : RP_OV5647
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Modify Date                     : 2015:01:28 19:30:04
Y Cb Cr Positioning             : Centered
Exposure Time                   : 0.7
F Number                        : 2.9
Exposure Program                : Aperture-priority AE
ISO                             : 400
Exif Version                    : 0220
Date/Time Original              : 2015:01:28 19:30:04
Create Date                     : 2015:01:28 19:30:04
Components Configuration        : Y, Cb, Cr, -
Shutter Speed Value             : 0.7
Aperture Value                  : 2.9
Brightness Value                : 0
Max Aperture Value              : 2.9
Metering Mode                   : Other
Flash                           : No Flash
Focal Length                    : 3.6 mm
Maker Note Unknown Text         : (Binary data 313 bytes, use -b option to extract)
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 1920
Exif Image Height               : 1440
Interoperability Index          : R98 - DCF basic file (sRGB)
Exposure Mode                   : Auto
White Balance                   : Auto
Compression                     : JPEG (old-style)
Thumbnail Offset                : 1032
Thumbnail Length                : 24576
Image Width                     : 1920
Image Height                    : 1440
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 2.9
Image Size                      : 1920x1440
Shutter Speed                   : 0.7
Thumbnail Image                 : (Binary data 24576 bytes, use -b option to extract)
Focal Length                    : 3.6 mm
Light Value                     : 1.5

real    0m8.161s
user    0m3.910s
sys     0m0.080s
The problem with this tool (exiftool) is that is extremely slow especially if you are run it from a Raspberry Pi, So I decided to turn to imagemagick identify but unfortunately I cannot find "Light Value" data as before. Even if I run identify -verbose I cannot find such similar value in any field. Any idea how can I find or calculate it?

You can always take an image from my Raspberry Pi camera from: http://users.otenet.gr/~kcr58/snapshot.jpg

Thanks for your time.

Code: Select all

root@raspi /usr/freeware # identify -verbose /tmp/snapshot.tmp.jpg

Image: /tmp/snapshot.tmp.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: DirectClass
  Geometry: 1920x1440+0+0
  Resolution: 72x72
  Print size: 26.6667x20
  Units: PixelsPerInch
  Type: TrueColor
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 255 (1)
      mean: 11.8298 (0.0463913)
      standard deviation: 26.7468 (0.104889)
      kurtosis: 46.5051
      skewness: 6.27543
    Green:
      min: 0 (0)
      max: 255 (1)
      mean: 10.2748 (0.0402935)
      standard deviation: 24.5483 (0.0962677)
      kurtosis: 56.2607
      skewness: 6.89832
    Blue:
      min: 0 (0)
      max: 255 (1)
      mean: 4.20187 (0.0164779)
      standard deviation: 17.7321 (0.0695376)
      kurtosis: 99.0793
      skewness: 9.06196
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 8.76883 (0.0343876)
      standard deviation: 23.3269 (0.0914781)
      kurtosis: 62.5181
      skewness: 7.2892
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 1920x1440+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 61
  Orientation: Undefined
  Properties:
    date:create: 2015-01-28T20:08:05+02:00
    date:modify: 2015-01-28T20:08:05+02:00
    exif:ApertureValue: 30705/10000
    exif:BrightnessValue: 0/100
    exif:ColorSpace: 1
    exif:ComponentsConfiguration: 1, 2, 3, 0
    exif:Compression: 6
    exif:DateTime: 2015:01:28 20:08:04
    exif:DateTimeDigitized: 2015:01:28 20:08:04
    exif:DateTimeOriginal: 2015:01:28 20:08:04
    exif:ExifImageLength: 1440
    exif:ExifImageWidth: 1920
    exif:ExifOffset: 192
    exif:ExifVersion: 48, 50, 50, 48
    exif:ExposureMode: 0
    exif:ExposureProgram: 3
    exif:ExposureTime: 738814/1000000
    exif:Flash: 0
    exif:FlashPixVersion: 48, 49, 48, 48
    exif:FNumber: 28984/10000
    exif:FocalLength: 35976/10000
    exif:ImageLength: 1440
    exif:ImageWidth: 1920
    exif:InteroperabilityIndex: R98
    exif:InteroperabilityOffset: 884
    exif:ISOSpeedRatings: 400
    exif:JPEGInterchangeFormat: 1020
    exif:JPEGInterchangeFormatLength: 24576
    exif:Make: RaspberryPi
    exif:MakerNote: 101, 118, 61, 45, 49, 32, 109, 108, 117, 120, 61, 45, 49, 32, 101, 120, 112, 61, 55, 51, 56, 56, 49, 52, 32, 97, 103, 61, 49, 48, 50, 52, 32, 102, 111, 99, 117, 115, 61, 50, 53, 53, 32, 103, 97, 105, 110, 95, 114, 61, 49, 46, 48, 48, 48, 32, 103, 97, 105, 110, 95, 98, 61, 49, 46, 48, 48, 48, 32, 103, 114, 101, 101, 110, 110, 101, 115, 115, 61, 48, 32, 99, 99, 109, 61, 48, 44, 48, 44, 48, 44, 48, 44, 48, 44, 48, 44, 48, 44, 48, 44, 48, 44, 48, 44, 48, 44, 48, 32, 109, 100, 61, 50, 32, 116, 103, 61, 55, 49, 50, 51, 32, 55, 49, 50, 51, 32, 111, 116, 104, 61, 48, 32, 48, 32, 98, 61, 48, 32, 102, 61, 55, 49, 50, 51, 32, 55, 49, 50, 51, 32, 102, 105, 61, 48, 32, 73, 83, 80, 32, 66, 117, 105, 108, 100, 32, 68, 97, 116, 101, 58, 32, 74, 97, 110, 32, 49, 52, 32, 50, 48, 49, 53, 44, 32, 49, 57, 58, 52, 54, 58, 50, 52, 32, 86, 67, 95, 66, 85, 73, 76, 68, 95, 73, 68, 95, 86, 69, 82, 83, 73, 79, 78, 58, 32, 56, 51, 52, 49, 56, 101, 98, 48, 51, 53, 98, 56, 99, 98, 55, 54, 50, 101, 55, 100, 49, 98, 102, 53, 102, 98, 49, 48, 99, 48, 57, 101, 99, 102, 50, 53, 56, 97, 48, 52, 32, 40, 99, 108, 101, 97, 110, 41, 32, 86, 67, 95, 66, 85, 73, 76, 68, 95, 73, 68, 95, 85, 83, 69, 82, 58, 32, 100, 99, 52, 32, 86, 67, 95, 66, 85, 73, 76, 68, 95, 73, 68, 95, 66, 82, 65, 78, 67, 72, 58, 32, 109, 97, 115, 116, 101, 114, 32
    exif:MaxApertureValue: 30705/10000
    exif:MeteringMode: 255
    exif:Model: RP_OV5647
    exif:ResolutionUnit: 2
    exif:ShutterSpeedValue: 436716/1000000
    exif:WhiteBalance: 0
    exif:XResolution: 72/1
    exif:YCbCrPositioning: 1
    exif:YResolution: 72/1
    jpeg:colorspace: 2
    jpeg:sampling-factor: 2x2,1x1,1x1
    signature: dcc063eaf5dadf9ce635394ab91e1abff08c1b482c49b8c0345d7f54eb5139b8
  Profiles:
    Profile-exif: 25602 bytes
  Artifacts:
    filename: /tmp/snapshot.tmp.jpg
    verbose: true
  Tainted: False
  Filesize: 109KB
  Number pixels: 2.765M
  Pixels per second: 1.562MB
  User time: 0.870u
  Elapsed time: 0:02.769
  Version: ImageMagick 6.7.7-10 2014-04-09 Q16 http://www.imagemagick.org
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Exif Metadata from Raspberry Pi Camera Problem...

Post by magick »

The light value is a calculated value: log2 (f-number^2 / shutter speed / ISO/100). We don't calculate it, but you can from the EXIF metadata.
Andros
Posts: 2
Joined: 2015-01-28T10:54:33-07:00
Authentication code: 6789

Re: Exif Metadata from Raspberry Pi Camera Problem...

Post by Andros »

Thanks a lot guys. Anyway I wrote a bash script that can do this calculation automatically:

Code: Select all

#!/bin/bash

ALL=( `identify -format "%[EXIF:FNumber] %[EXIF:ShutterSpeedValue] %[EXIF:ISOSpeedRatings]" $1` )

ALL=( `convert xc: -format "%[fx:${ALL[0]}] 1/%[fx:floor(pow(2,${ALL[1]}))]" info:` ${ALL[2]} )

echo "l((( ${ALL[0]} ) ^ 2) / (${ALL[1]}) / (${ALL[2]} / 100) ) / l(2)" | bc -l
Just run this script with your .jpg as argument:

Code: Select all

# script snapshot.jpg
13.84941189781605230136

#
And as I expect, is far away faster than to run exiftool. Enjoy :)
Post Reply