Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使用文本文件中的纬度和经度对图像进行地理标记?_Python_Image_Gps_Exiftool - Fatal编程技术网

Python 如何使用文本文件中的纬度和经度对图像进行地理标记?

Python 如何使用文本文件中的纬度和经度对图像进行地理标记?,python,image,gps,exiftool,Python,Image,Gps,Exiftool,我用一个连在无人机上的照相机拍摄了一张照片。我使用的相机没有给我任何GPS数据,但是我的无人机有一个内置的GPS,我可以用它来获取拍摄图像的位置。我将此信息保存在文本文件中。如何将保存在文本文件中的纬度和经度添加到图像中?我正在用python编写代码。到目前为止,我只找到了有关在exiftool中使用csv或gpx文件的信息,而没有找到任何关于文本文件的信息。import exiftool et=exiftool.exiftool(“C:\Users\…\exiftool.exe”) et.ex

我用一个连在无人机上的照相机拍摄了一张照片。我使用的相机没有给我任何GPS数据,但是我的无人机有一个内置的GPS,我可以用它来获取拍摄图像的位置。我将此信息保存在文本文件中。如何将保存在文本文件中的纬度和经度添加到图像中?我正在用python编写代码。到目前为止,我只找到了有关在exiftool中使用csv或gpx文件的信息,而没有找到任何关于文本文件的信息。

import exiftool
et=exiftool.exiftool(“C:\Users\…\exiftool.exe”)
et.execute(“-GPSLongitude=10.0”,“picture.jpg”)
et.execute(“-GPSLatitude=5.78”,“picture.jpg”)
et.execute(“-gpsaltude=100”,“picture.jpg”)
终止
不带terminate()语句的And

将exiftool.exiftool(“C:\Users\…\exiftool.exe”)作为et:
et.execute(“-GPSLongitude=10.0”,“picture.jpg”)
et.execute(“-GPSLatitude=5.78”,“picture.jpg”)
et.execute(“-gpsaltude=100”,“picture.jpg”)
正如用户@StarGeek所说

您还必须设置GPSLatitudeRef和gpslngituderef值, 尤其是当该值位于西半球或南半球时。信息技术 可以用et.execute(“-GPSLongitudeRef=10.0”, “picture.jpg”)–StarGeek


您还必须设置
GPSLatitudeRef
gpslngituderef
值,尤其是在西半球或南半球。可以用相同的方法执行(“-GPSLongitudeRef=10.0”,“picture.jpg”)感谢您的建议。