Payload Metadata Matching - ngageoint/voxel-globe GitHub Wiki

There are three patterns used for associating a metadata filename with a payload filename. First ingest_voxel_globe.json is checked, then name matching without extension is used. Lastly alphabetical order is used to match up each pair of files. These patterns are implemented for VXL KRT cameras.

Pattern 1

ingest_voxel_globe.json is checked first in case the other two methods would have failed. If an image_camera_match object exists, every property in is treated as a key/value pair where the key is the image filename and the value is the metadata filename. In this sample, frame_00008.png will be loaded with the metadata from frame_00001.txt, and so on.

Pattern 2

The next method is to take every image filename, remove the extension and look for a metadata filename with the same name (after the extension is removed too). Most formats follow this pattern already, so it is a fairly robust pattern. In addition to removing the extension, all filenames are lowercased, to remove ambiguity (normally introduced by the Microsoft Windows operating systems).

Pattern 3

If no files are matched via Pattern 1 or 2, then all the filenames (lowercased and extensions removed) are put in natural alphabetical order, and matched across the board.

This is common for some algorithms, replacing long filenames with shorter enumerated names. Natural sorting means the filenames will be in the same order, with or without padded zeros.

For example, image the following list of images

Image Filename List Sorted List
B.jpg a.jpg(a)
a.jpg B.jpg(b)
c.jpg c.jpg(c)
Metadata Name List Sorted List
f_3.txt f_1.txt(f_1)
F_02.Txt f_02.Txt(f_2)
f_1.txt f_3.txt(f_3)

Resulting in the final list

Image Metadata
a.jpg f_1.txt
B.jpg f_02.Txt
c.jpg f_3.txt