Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify time offset for a camera that did not geotag #3

Open
bhousel opened this issue Nov 22, 2016 · 0 comments
Open

Specify time offset for a camera that did not geotag #3

bhousel opened this issue Nov 22, 2016 · 0 comments

Comments

@bhousel
Copy link
Contributor

bhousel commented Nov 22, 2016

If a camera did not geotag its images for some reason, we can interpolate geotags from the other cameras that did.

I wrote some hacky code that sort of did this in an automatic way:

            // Missing gps coordinates.
            // Try to grab coordinates from another camera at same time.
            if (!Array.isArray(coord) || coord.length < 2) {
                for (let k = 0; k < cameras.length; k++) {
                    if (k === i) continue;
                    let cameraAlt = cameras[k];
                    let fileAlt = alltimes[time][cameraAlt];
                    if (!fileAlt) continue;

                    let dataAlt = extractExif(allfiles[fileAlt].data);
                    let coordAlt = dataAlt.coord;
                    if (!Array.isArray(coordAlt) || coordAlt.length < 2) {
                        continue;
                    }

                    // offset slightly so they don't appear coincident
                    coord = coordAlt.map(c => c + 0.000001);
                    break;
                }
            }

But it doesn't really work because the misbehaving camera isn't necessarily timestamping in sync with the gps camera. It might be off by seconds. So we need to flag this as a warning and run a different command to fix the geotags after a reviewer supplies the offset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant