Extract lens mm used from Photo...

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
tackd
Posts: 42
Joined: 2013-12-30T07:39:08-07:00
Authentication code: 6789

Extract lens mm used from Photo...

Post by tackd »

Hello.

Is Image Magick able to extract the;

1. Lens focal length in mm used to take the photo
2. Determine if a cropped or full frame sensor was used in the photo ? e.g. 1.6x, 1.5x
3. Determine if the photo was cropped or skewed with a Tilt-Shift lens, or in software ?

For Example: Image


Thank you IM Experts.

Best regards.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extract lens mm used from Photo...

Post by snibgo »

That metadata isn't in that file. (I already looked, curious about the pincushion distortion.)

"identify -verbose" will tell you everything that IM can read. I generally use exiftool, because that can see more.
snibgo's IM pages: im.snibgo.com
tackd
Posts: 42
Joined: 2013-12-30T07:39:08-07:00
Authentication code: 6789

Re: Extract lens mm used from Photo...

Post by tackd »

Correct snibgo,

I am wondering if IM has the ability to determine #1-3 without metadata, I should have mentioned that.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extract lens mm used from Photo...

Post by snibgo »

From the image itself, ignoring metadata, it is not possible to determine the sensor size or lens focal length, or determine if the image has been cropped.

With intelligence and our knowledge of the subject, we can estimate if the field of view is "normal" or "wide-angle" or "telephoto". But these are only guesses about the image itself. A wide-angle photo can be cropped to be identical to be identical to a telephoto photo.

A tilt-shift lens might have two effects: shift can correct converging verticals etc ("perspective control"), and tilt can alter the plane of maximum sharpness. Detecting shift is not possible because a non-shift photo with a wider lens can be cropped to be identical.

Tilt could be used in this example to make the plane of best sharpness extend from the rooftop to the side of the road. Anything above or below that plane will be out of focus. In theory that can be detected. But not from such a small low-quality JPEG.

Similarly, detecting software transformations like skewing or perspective distortions is not possible from such a small low-quality JPEG.
snibgo's IM pages: im.snibgo.com
tackd
Posts: 42
Joined: 2013-12-30T07:39:08-07:00
Authentication code: 6789

Re: Extract lens mm used from Photo...

Post by tackd »

Understood, thanks snibgo.
Similarly, detecting software transformations like skewing or perspective distortions is not possible from such a small low-quality JPEG.
What size/dpi would one need to analyze software transformations like skewing or perspective distortions ?

Regards.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Extract lens mm used from Photo...

Post by snibgo »

I don't know. I've never examined an image, looking for evidence of software transformations like skewing or perspective distortions. But we might find stretching in some parts of the image and not others. For example if we point a camera up at a building we get converging verticals. We can correct this in software by stretching the top of the image to be wider. This might be visible as the stretching is horizontal only, not vertical.

But this effect would be difficult to detect in a small low-quality JPEG.
snibgo's IM pages: im.snibgo.com
Post Reply