Sigma 8-16mm f4,5-5,6 DC HSM pour Pentax

Started by gwinru, December 13, 2010, 12:13:35 PM

Previous topic - Next topic

killes

Hi Phil!

Quote from: Phil Harvey on January 02, 2012, 07:22:02 PM


Was the EXIF:FocalLength equal to 0 before you processed the file?

exiftool /mnt/karte/DCIM/108_2612/IMGP4921.JPG -G4:1| grep oca
[ExifIFD]       Focal Length                    : 0.0 mm
[ExifIFD]       Focal Length In 35mm Format     : 0 mm
[Pentax]        World Time Location             : Hometown
[Pentax]        SR Focal Length                 : 10 mm
[Composite]     Focal Length                    : 0.0 mm

Yes.

What is strange is that [Pentax]        SR Focal Length is 10mm.
Maybe that is because the Pentax only records Focal Length down to 10mm?

Quote

  After the 1st command, what were the values of all tags that contribute to the scale factor calculation?:

FocalLength
FocalLengthIn35mmFormat
Composite:DigitalZoom
FocalPlaneDiagonal
SensorSize
FocalPlaneXSize
FocalPlaneYSize
FocalPlaneResolutionUnit
FocalPlaneXResolution
FocalPlaneYResolution
ExifImageWidth
ExifImageHeight
CanonImageWidth
CanonImageHeight
ImageWidth
ImageHeight

- Phil

cp /mnt/karte/DCIM/108_2612/IMGP4921.JPG /tmp/IMGP4921_2.JPG

exiftool -focallengthin35mmformat= '-focallength<$copy2:focallength' -if '$focallength# == 0' /tmp/IMGP4921_2.JPG

Focal Length                    : 5.0 mm
FocalLengthIn35mmFormat doesn't seem to exist

Composite:DigitalZoom doesn't seem to exist

FocalPlaneDiagonal doesn't seem to exist

SensorSize doesn't seem to exist

FocalPlaneXSize  doesn't seem to exist

FocalPlaneYSize  doesn't seem to exist
FocalPlaneResolutionUnit  doesn't seem to exist
FocalPlaneXResolution  doesn't seem to exist
FocalPlaneYResolution  doesn't seem to exist

ExifImageWidth
Exif Image Width                : 3872

ExifImageHeight
Exif Image Height               : 2592

CanonImageWidth   doesn't seem to exist

CanonImageHeight   doesn't seem to exist

ImageWidth 3872

ImageHeight 2592

So I guess presence of various of these items depends on the camera
model and my K10D is just too old.

Wouldn't it be possible to determine the focal length based on the
lense model alone? It is a prime lense after all.

I have already configured the lense in .ExifTool_config's
UserDefined::Lenses.

Cheers,
   Gerhard


Phil Harvey

Hi Gerhard,

It appears that the K10D doesn't store the SensorSize information that is needed for the technique you were using.  So instead, for the K10D you will need to set the FocalPlaneResolution tags appropriately as per the previous technique I detailed in this thread.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

killes

Hi Phil!

I've been doing now:

exiftool -focallengthin35mmformat= -focalplanexresolution=5206 -focalplaneyresolution=5206 -focalplaneresolutionunit=inches '-focallength<$copy2:focallength' -if '$focallength# == 0' IMGP4921.JPG
exiftool '-focallengthin35mmformat<focallength35efl#' -if 'not $focallengthin35mmformat' IMGP4921.JPG


and the result is

exiftool IMGP4921.JPG -G4:1  | grep ocal
[ExifIFD]       Focal Length                    : 5.0 mm
[ExifIFD]       Focal Plane X Resolution        : 5206
[ExifIFD]       Focal Plane Y Resolution        : 5206
[ExifIFD]       Focal Plane Resolution Unit     : inches
[ExifIFD]       Focal Length In 35mm Format     : 10 mm
[Pentax]        SR Focal Length                 : 10 mm
[Composite]     Focal Length                    : 5.0 mm (35 mm equivalent: 10.0 mm)
[Composite]     Hyperfocal Distance             : 0.30 m

I beliee that is still wrong: the focal length of the lense should be 4.5mm and the 35mm equivalent then 6.75mm.

I probably need different numbers of the resolution values.

I tried the value 3782 which is the max # of pixels:

[ExifIFD]       Focal Length                    : 5.0 mm
[ExifIFD]       Focal Plane X Resolution        : 3872
[ExifIFD]       Focal Plane Y Resolution        : 3872
[ExifIFD]       Focal Plane Resolution Unit     : inches
[ExifIFD]       Focal Length In 35mm Format     : 7 mm
[Pentax]        SR Focal Length                 : 10 mm
[Composite]     Focal Length                    : 5.0 mm (35 mm equivalent: 7.0 mm)
[Composite]     Hyperfocal Distance             : 0.21 m

this is better. Is the focal length always an integer?

Cheers,
Gerhard


Phil Harvey

Hi Gerhard,

Yes, the K10D will have a different focal plane resolution, but it isn't simply the number of pixels.  It is the number of pixels divided by the size of the sensor in inches.  (The sensor pitch in pixels per inch.)

FocalLength is rational64u (rational, 64-bit, unsigned), so it supports non-integral values.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

fs999

Hello,

I am trying to specifically change the focal length of my Pentax K5 dng files, but only when it is the Sigma 8-16mm lens and focal length = 0.

The problem is the AND in the if expression. I am not familiar with Perl and I cannot find a good tutorial.

The command line (dos) is : exiftool -@ Sigma816.txt -common-args -overwrite-original-in-file -P file.dng

the argfile is

-focallengthin35mmformat=
-focalplanexresolution=5206
-focalplaneyresolution=5206
-focalplaneresolutionunit=inches
-focallength<$copy2:focallength
-if $lenstype# == 8 18 AND $focallength# == 0
-execute
-focallengthin35mmformat<focallength35efl#
-if not $focallengthin35mmformat


The error is :
No file specified
     1 image files updated

But no change in the exif...

Frederic

Phil Harvey

Hi Frederic,

Try this:

-if
$lenstype# eq '8 18' and $focallength# == 0


Note that the -if argument must be on a separate line in the argfile.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

fs999

Thank you !

I tried this
-focallengthin35mmformat=
-focalplanexresolution=5206
-focalplaneyresolution=5206
-focalplaneresolutionunit=inches
-focallength<$copy2:focallength
-if
$lenstype# eq '8 18' and $focallength# == 0
-execute
-focallengthin35mmformat<focallength35efl#
-if
not $focallengthin35mmformat


but now the error is :
No file specified
    1 files failed condition

Frederic

Phil Harvey

Hi Frederic,

Check your spelling of the -common_args and -overwrite_original_in_place option names.  (Make sure you use underlines.)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

fs999

I am confused ! Thank you so much ! it works !

Frederic