This is a follow up to this question: Using GDAL to extract Corner Coordinates based on a jpg file's GPS EXIF data?
Per the answer I received to the above question, gdal_merge
cannot merge JPG images that a are produced my most Drone manufacturers. The reason is that usually, Drone images do not include Corner Coordinates. All the Drone image Merging applications rely upon and use the rich set of EXIF GPS coordinates inside Drone JPG images (includes altitude and camera angles).
Here is an example of drone image set that gdal_merge
cannot merge:
https://github.com/OpenDroneMap/odm_data_aukerman/tree/master/images
Is there any batch command line tool or code sample that can help to calculate and add Corner Coordinates to JPG images based on the rich set of EXIF GPS data that exists in Drone JPG images?
I am building a batch process and I cannot use GUI interactive tools like QGIS. I can create or call code in any language (Pathon, Node etc..) or preferably I can call another command line tool.
Here is an example of GPS EXIF data that gdalinfo
provides. Note the zero Corner Coordinates.
Driver: JPEG/JPEG JFIF
Files: 0.JPG
Size is 4896, 3672
Coordinate System is `'
Metadata:
EXIF_BrightnessValue=(7.53672)
EXIF_ColorSpace=1
EXIF_ComponentsConfiguration=0x01 0x02 0x03 0x00
EXIF_CompressedBitsPerPixel=(3)
EXIF_Contrast=0
EXIF_CustomRendered=0
EXIF_DateTime=2016:06:29 10:47:04
EXIF_DateTimeDigitized=2016:06:29 10:47:04
EXIF_DateTimeOriginal=2016:06:29 10:47:04
EXIF_DigitalZoomRatio=(1)
EXIF_ExifVersion=0230
EXIF_ExposureBiasValue=(0)
EXIF_ExposureMode=0
EXIF_ExposureProgram=2
EXIF_ExposureTime=(0.004)
EXIF_FileSource=0x03
EXIF_Flash=16
EXIF_FlashpixVersion=0100
EXIF_FNumber=(3.3)
EXIF_FocalLength=(4.45)
EXIF_GPSAltitude=(346.315)
EXIF_GPSLatitude=(41) (18) (13.7576)
EXIF_GPSLatitudeRef=N
EXIF_GPSLongitude=(81) (45) (1.6792)
EXIF_GPSLongitudeRef=W
EXIF_ImageDescription=
EXIF_Interoperability_Index=R98
EXIF_Interoperability_Version=0x30 0x31 0x30 0x30
EXIF_ISOSpeedRatings=100
EXIF_LensSpecification=(4.45) (44.5) (3.3) (5.9)
EXIF_LightSource=0
EXIF_Make=SONY
EXIF_MakerNote=SONY DSC
EXIF_MaxApertureValue=(3.44531)
EXIF_MeteringMode=5
EXIF_Model=DSC-WX220
EXIF_PixelXDimension=4896
EXIF_PixelYDimension=3672
EXIF_RecommendedExposureIndex=100
EXIF_ResolutionUnit=2
EXIF_Saturation=0
EXIF_SceneCaptureType=0
EXIF_SceneType=0x01
EXIF_SensitivityType=2
EXIF_Sharpness=0
EXIF_Software=eBee
EXIF_UserComment=
EXIF_WhiteBalance=0
EXIF_XResolution=(350)
EXIF_YCbCrPositioning=2
EXIF_YResolution=(350)
Image Structure Metadata:
COMPRESSION=JPEG
INTERLEAVE=PIXEL
SOURCE_COLOR_SPACE=YCbCr
Corner Coordinates:
Upper Left ( 0.0, 0.0)
Lower Left ( 0.0, 3672.0)
Upper Right ( 4896.0, 0.0)
Lower Right ( 4896.0, 3672.0)
Center ( 2448.0, 1836.0)
Band 1 Block=4896x1 Type=Byte, ColorInterp=Red
Overviews: 2448x1836, 1224x918, 612x459, 160x120
Image Structure Metadata:
COMPRESSION=JPEG
Band 2 Block=4896x1 Type=Byte, ColorInterp=Green
Overviews: 2448x1836, 1224x918, 612x459, 160x120
Image Structure Metadata:
COMPRESSION=JPEG
Band 3 Block=4896x1 Type=Byte, ColorInterp=Blue
Overviews: 2448x1836, 1224x918, 612x459, 160x120
Image Structure Metadata:
COMPRESSION=JPEG
GUI applications like QGIS can perfectly do this and there are many youtube vidoes (and paid courses) showing how to do that.
However, this question is looking for a sample code or command line application that I can call in my batch application.