I am running an example of reconstruct 3D object from images from here .
When I tries to get the focal length of the picture as the article shows:
exif_data = {
PIL.ExifTags.TAGS[k]:v
for k, v in exif_img._getexif().items()
if k in PIL.ExifTags.TAGS}
#Get focal length in tuple form
focal_length_exif = exif_data['FocalLength']
#Get focal length in decimal form
focal_length = focal_length_exif[0]/focal_length_exif[1]
My code reports an error saying "'IFDRational' object does not support indexing"
and this focal_length_exif has a structure like this:
should I use focal_length = focal_length_exif.real which is 399/100? (I am not very clear about the format of focal length)