-
Notifications
You must be signed in to change notification settings - Fork 211
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
use GPS exif data to guess scale of image placement #176
Comments
// Create an ElevationService
var elevator = new google.maps.ElevationService(), lat = 42, lng = -71;
elevator.getElevationForLocations({'locations':[ {lat: lat, lng: lng} ]
},function(results, status) {
console.log(results[0].elevation);
}
) This works! |
OK, we can guess field of view is ~50 degrees, and we can now get height above ground. Trigonometry!!!! |
I have implemented it this far, but my console says:
|
If guessing is okay, you can probably get closer to the field of view most of the time. EXIF data includes the focal length for each photo, but does not include the size of the sensor, so the field of view is unknown. You could look up the sensor size of that camera model (given in the EXIF data), but it might be a pain to make that table. Most PowerShots that people fly have the same size sensor, and many other low-end point & shoots have the same size sensor (1/2.3 inch). So you could assume the sensor size and compute field of view from that and the focal length. When it fails, e.g. with a phone camera with a tiny sensor, it will fail miserably. |
I've just implemented this and it's "working" -- but hard to assess how good our estimates are (such as an est. default 50 degree field of view -- what do you think, Chris?) without running some images through it. I agree that field of view can dramatically affect our guesses in a way that just GPS precision wouldn't as much. |
about to push into production... done! |
For a typical PowerShot, the widest focal length is equivalent to 28mm. That converts to a diagonal field of view of 75°. For an S90 to S120, the widest focal length is equivalent to 24 mm, which converts to a diagonal field of view of 85° |
I'm not sure which field of view I should work with -- average? Diagonal is On Thu, May 21, 2015 at 10:16 AM, Fastie notifications@github.com wrote:
|
For typical small PowerShot, horizontal FOV is 63.3, vertical FOV is 48.9, mean=56.1 |
Hmm, so perhaps 60 degrees would be a better default. On Thu, May 21, 2015 at 10:25 AM, Fastie notifications@github.com wrote:
|
For reference, Chris, here are all the EXIF tags from a very fully EXIF provided image:
|
The Ricoh G7 SE has the typical point & shoot sensor (1/2.3 inch), but the EXIF data do not include that information. If you had assumed that or found it in a look up table, you could have calculated that a 5 mm focal length (given in the EXIF) produces the equivalent (35mm eq) of a 28 mm lens which has a horizontal FOV of 63.3° and vertical FOV of 48.9°. |
How widely do sensor sizes vary? i.e. how big would the lookup table be? |
There are CHDK versions for 130 PowerShot models. Probably most of those used for mapping have 1/2.3" sensors, and most of the rest that any aerial mappers use have 1/1.7" sensors (or maybe one or two other sizes). That table might exist somewhere or would not be too hard to make if you like boring tasks. If your fov algorithm worked only for PowerShots you might succeed for 70 to 90% of MapKnitter maps. There are a lot of other camera makes and models out there, so a comprehensive table would be a lot of work (unless someone had already done it) and it might not add much to your success rate. |
Are you looking at a reference somewhere about the sensor sizes? How do you On Sun, Jun 7, 2015 at 3:15 PM, Fastie notifications@github.com wrote:
|
I have not found a list of camera model and sensor size. I have to search for each model. Reviews at DPreview.com always include the sensor size. |
Here is a start for your lookup table: |
New possibility: sourcing from https://github.com/perliedman/elevation-service which sources from lots of different places: http://www.imagico.de/map/demsearch.php -- suggested via @ebarry via @mojodna Eventually want to use OpenTerrainMap. This works! : curl -i http://data.cykelbanor.se/elevation/geojson -X POST -H "Content-Type: application/json" -d '{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}}' returns: {"type":"Feature","geometry":{"type":"Point","coordinates":[125.6,10.1,130.00000000012065]},"properties":{"name":"Dinagat Islands"}} Haven't been able to figure out posting from jQuery in the right format yet, but I'm just being a bit dumb: $.post('http://data.cykelbanor.se/elevation/geojson', {
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}}); |
it'd be great to use the altitude from GPS to roughly scale images.
But this is tough because GPS offers only altitude over sea level, so we'd have to subtract the ground elevation. We'd also probably want to know the camera's field of view if we want to get a closer fit.
Maybe we could use Google's Elevation Service in their Google Maps JS API.
The text was updated successfully, but these errors were encountered: