Stumbling Toward 'Awesomeness'

A Technical Art Blog

Sunday, April 11, 2010

Splitting MPO Files with ExifTool and Python

Many stereo cameras are using the new MPO format to store multiple images in a file. Unfortunately, nothing really works with these files (Other than Stereo Photo Maker). Here is a simple python wrapper around ExifTool that will extract the Right and Left image, and return EXIF data as a dict. I think this is probably easier than explaining how to use ExifTool, but you can see from looking at the simple wrapper code.

import mpo
 
#Name of MPO file, name of output, whether or not you want all EXIF in a txt log
mpo.extractImagePair('DSCF9463.MPO', 'DSCF9463', True)
#>>Created DSCF9463_R.jpg
#>>Created DSCF9463_L.jpg
#>>Writing EXIF data

The above leaves you with two images and a text file that has all the EXIF data, even attributes that xnView and other apps do not read:

exif =  getExif('DSCF9463.MPO')
print exif["Convergence Angle"]
#>>0
print exif["Field Of View"]
#>>53.7 deg
print exif["Focal Length"]
#>>6.3 mm (35 mm equivalent: 35.6 mm)
posted by admin at 2:58 am  

1 Comment »

  1. Nice tool! I like python for the portability, so this is just what I needed. Thanks a lot!

    However, I have the feeling that for extractImagePair the left and right images are flipped. It looks like you take the first image to be right, while other tools take it as left, and looking at them left seems to make more sense.

    How did you decide which is which?

    Yours

    Dirk

    Comment by DirkR — 2010/07/03 @ 9:53 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

Powered by WordPress