使用geotag对照片加水印并根据坐标创建shapefile?


Answers:


15

您可以使用python获取EXIF信息:

from PIL import Image
from PIL.ExifTags import TAGS
from pprint import pprint

def getexif(im):
    res = {}
    try:
       img = Image.open(im)
       info = img._getexif()
       for tag, val in info.items():
           dec = TAGS.get(tag, tag)
           res[dec] = val

    except IOError:
       print im
    return res
    pprint res 

然后使用python ImageDraw模块绘制文本或其他内容。

import ImageFont, ImageDraw

def drawtext(im):
   op = ImageDraw.Draw(im)
   fnt = ImageFont.truetype("tahoma.ttf", 12)
   op.text((5, 5), "YourText", font=fnt)
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.