Showing posts with label Google Earth. Show all posts
Showing posts with label Google Earth. Show all posts

Friday, 4 April 2008

Viewfinder

The University of Southern California Interactive Media Team have recognised the difficulty of aligning photographs in Google Earth for PhotoOverlays and have made it the target of their Viewfinder project. They state their objective as "to provide a straightforward procedure for geo-locating photos of any kind" and specify that "a 10-year-old should be able to find the pose of a photo in less than a minute".

Aligning PhotoOverlays in Google Earth can be a very time-consuming job. For example, my Abbey Road and Gliding PhotoOverlays were very tricky to set up, even with the help of flickr photos showing me exactly where the camera is for the former, and a bit of messing about with Imagemodeler for the latter.

To get a good match, not only do you have to figure out the position on the map where the photograph was taken, you also have to determine how high off the ground the camera was, its orientation (pitch, roll and yaw) and the characteristics of the lens used. With so many variables you can end up tweaking for ages and still not get things exactly right.

The Viewfinder team have focussed on two 'pose finding' methods. The 2D-to-2D method starts with the user selecting the position from which the photo was taken on Google Maps, then using a browser-based tool that feeds back the equivalent Google Earth view to refine the position and orientation of the camera. A screen shot from Google Earth is then loaded into a second tool in which the translation and scaling of the photo can be fine tuned to achieve the best match.

Even more amazing is the 2D-to-3D method, in which a 3D model of an element in the scene is brought into correspondence with the photograph by dragging model vertices to their projected positions, in a manner reminiscent of canoma.

The Viewfinder team's progress report makes fascinating reading, and hopefully is a taste of things to come. It isn't mentioned in the progress report as a related program, but I think there would be obvious benefits to linking Viewfinder with PhotoSketch.

Thursday, 20 September 2007

GE Object Movie Snapper

Update: The GEAirlines plugin and Vista don't seem to like eachother, so it looks like XP only.

I've uploaded the web page utility I use to make QTVR and Flash object movies from Google Earth. The GE Object Movie Snapper automates the process of grabbing a set of still images suitable for compiling into an object movie.

There are still a few enhancements I want to make to this, such as giving some feedback of progress. There also seems to be an issue with the eye altitude jumping about with terrain height on some movies. For a future version I want to include the ability to look outwards and grab images for 360° panoramas.

Before it can be used you will need:

Note: The page works with IE7 and FF2. Opera doesn't like the plugin and Safari doesn't like the javascript.

At the bottom of the page are a number of input boxes. You can set the parameters in any order, but I find the following sequence works well:

First set the root filename for the image set. Images are saved in the form 'filename_<row>_<col>.bmp', where <row> and <col> are the row and column numbers of the image, counting from zero.

Navigate to the desired location and click 'Get Position' to load the latitude, longitude and range. These parameters can be set manually if desired.

If a full azimuth object movie is needed leave the Minimum and Maximum Azimuth settings as they are, otherwise set them as desired. Buttons are provided for each to grab the current view.

Set the number of Azimuth steps. The default of 24 results in full azimuth object movie stills taken at 15° intervals.

Set the Top and Bottom Elevation angles. An elevation angle of 0° is looking straight down and one of 90° is a horizontal view. Usually it is best to set the Bottom Elevation angle to a couple of degrees less than 90 to avoid the viewpoint going underground.

Finally set the Altitude of the point at which the object movie will focus on. This value is in meters relative to the ground at the chosen latitude and longitude.

Note that using the "Get Position", "Get Latitude" and "Get Longitude" buttons after a non-zero altitude is set will result in their values changing to the point on the ground projected beyond the elevated focus point from the current view point!

Click the Preview button and the view will cycle through the image views you have defined. This has the added bonus of pre-loading the Google Earth cache.

Once you are happy with the settings make sure the browser window is large enough to show the entire plugin box and click the Snap Image Set button. The screen grab won't work properly if the whole image isn't visible! The instructions at the top of the page will disappear and the images will get saved to C:\Documents and Settings\USERNAME\Local Settings\Temp\GEAPlugin.

Hover over the bottom left of the image area until the navigation gadgets fade out before snapping the image set, otherwise it will appear on all the images. The snapped image size is 640x480 pixels, and is fixed in the "content" div size. The script does very little range and sanity checking on the input parameters. Crazy in, crazy out.

Saturday, 15 September 2007

Automated Object Movie Creation

Having made a couple of object movies from Google Earth by hand, I don't particularly want to repeat the experience! It is repetitive and takes ages: select a viewpoint; grab the screen; give it a filename; repeat 168 times. I had a look at the Google Earth COM API which allows scripting of view positions, but unfortunately its screen capture capabilities are limited to black and white images, with an automatic degradation in image quality every so often.

Fortunately, Luca Rocchi at Google Earth Airlines has come up with a nifty plug-in that allows GE to run in a browser, exposing its interface to javascript. The even nicer thing about it is that it supports proper screen grabs

After a bit of playing I now have a script that automatically generates the image set Pano2QTVR needs to create an object movie. Once its been tidied up and given it a more user friendly interface I'll post it up

For now, here's a preview:

(Drag on the image to stop that annoying autorotation)

Wednesday, 12 September 2007

Google Earth Quicktime Object Movie

This little experiment captures a tiny corner of Google Earth in a Quicktime object movie. I chose London's Battersea power station as the subject, though with hindsight that was probably not the most glamorous of places I could have picked. Nevertheless it is instantly recognisable (to the British and Pink Floyd fans at any rate ;) and there's a very good model of it in the 3D Warehouse.

It will need a few seconds to load, then, provided you have Quicktime installed, you will be able to change the view point by dragging on the image:

The object movie was created with Pano2QTVR, a utility that allows both QTVR panoramas and object movies to be constructed.

An extension to Pano2QTVR allows the object movie to be output in flash format:

The source images for the object movie have to be laboriously captured one at a time with Ctrl+Alt+S (or the mac equivalent) from Google Earth. View positioning is accomplished via the use of this kml file. This will allow easy positioning over most of a hemisphere in 24 azimuth steps at each of 7 elevations. It stops a couple of degrees short of ground level to avoid plunging the viewpoint underground. Note that the values of YOUR_LONGITUDE, YOUR_LATITUDE and YOUR_RANGE will need to altered to your chosen location before the file is any use!

If anyone knows a way to automate the image capture process, please drop me a line.

Sunday, 9 September 2007

Starship Enterprise NCC-1701-D

Update: It appears that the latest version of Google Earth, v4.2.0196.2018 beta released 12th September, breaks the GroundOverlay. Hopefully they will get this fixed in the next version. Thanks to Frank Taylor at Google Earth Blog for the tip.

Who says GroundOverlays are for overlaying the ground? It's been a busy week and no posts since Monday, but I haven't been idle. I've put together a multi-overlay of the Starship Enterprise, based on an original set of blueprints by Ed Whitefire that I came across in an article by Phil Broad @ cloudster.com, a site devoted to resources for sci-fi model builders.

Ed has very kindly allowed me to use his artwork for this project, which has generated some quite striking visuals:

View in Google Earth

The overlay actually contains 43 layers, one for every deck, but only half of them are active by default. This should spare those of us with older PCs and graphics cards - those of you with computer power rivalling the Starship Enterprise may like to enable more of the layers!

The flash video below gives an idea of what it looks like:

I've chosen to place the Enterprise at Point Nemo, which distinguishes itself as the point at sea furthest from any land. I chose that location in the hope that the lack of high resolution ground images would help things along performance-wise. It looks great when navigated with a SpaceNavigator mouse, though is a bit more difficult to view with standard mouse and keyboard controls. I originally had the Enterprise at a much higher altitude, but dropped it much closer to sea level after some feedback from Ed.

The blueprints used in this are much lower resolution than the originals, which are of much higher quality. Those interested in printed copies of the blueprints should check out the Cloudster link above for details.

Monday, 3 September 2007

Affleck Castle in Stacked Overlays

Whilst scouting about for some simple floor plans to experiment with in Google Earth I came across a site about Affleck Castle in Monikie, Angus. It has an interesting description of the castle complete with a set of floor plans. A little image editing was required and then it was a simple matter to stack the plans.

View in Google Earth

The effect is achieved by setting the white areas of the images to 50% transparency and leaving the black areas opaque. I tried several alternatives to this scheme - another that looks pretty good is to make the white areas completely transparent. This remains readable as GE leaves a fine white outline.

View in Google Earth

Sunday, 2 September 2007

Eden Project Visitor Guide Overlay

Back in 2005 I was trying to accurately geocode a bunch of photos I'd taken at the excellent Eden Project, but found at the time that the Google Earth imagery of the area showed little more than a quarry. I made a series of overlays from bits of more detailed and more up-to-date maps and finished off by aligning the map images from the guide book. These are a little out of date, but I thought they would be worth sharing.

The guide book images are used with the kind permission of Mike Petty, the Eden Project Publishing Manager.

View in Google Earth

I've left the two biome images hovering in the air and applied some transparency, which produces a pleasing effect.

Transparency and altitude offsets seem to be only very rarely used. I'm sure there are plenty of practical and artistic effects that could be generated by them - I think I will have to experiment.

Saturday, 1 September 2007

Poldark Mine Tunnels

The Poldark Mine just outside Helston in Cornwall is well worth a visit, and I can recommend the tour of the mine tunnels to anyone with even a vague interest in geology, mining or industrial history.

Their website has a detailed description of the mine workings, including a number of sketches showing the tunnel layout. To give them some additional context, I've overlaid them on the local landscape in Google Earth.

View in Google Earth

Many thanks to Richard Williams of Poldark Mines for his kind permission to use the map images.

The GE-copter and PhotoOverlay Transparency

Continuing the theme of messing about with PhotoOverlays in Google Earth, here's the first outing of the panovoyant GE-copter to Canary Wharf.

View in Google Earth

The cockpit started life as a series of screen grabs from Microsoft Flight Simulator X which were stitched together into a panoramic image with Realviz Stitcher. I cut the windows out in Photoshop, then applied the script that I described in a previous post to slice it up into tiles.

I reckon it would work with other aircraft too - maybe a microlight or hot air balloon. The back of Pegasus, Gwaihir or a dragon might be an intersting alternative!

Annotating PhotoOverlays and Worlds Within Worlds

Google Earth PhotoOverlays can potentially contain a huge amount of detail. I would like to see some method of applying annotations to points or areas of the PhotoOverlay, along the lines of the 'Add Note' facility at flickr.

On a broader theme, if the 'surface' of a PhotoOverlay could be treated in the same way as the surface of the GE globe, you could apply any of the GE annotation methods such as Placemarks, Paths and Polygons - maybe even other PhotoOverlays. Actually, this could apply equally well to ScreenOverlay and GroundOverlay elements, as well as surfaces of 3D models - in fact anything to which a coordinate system can be applied.

Imagine the possibilities. Worlds within Worlds!

Abbey Road Live Webcam Overlays

Here's a short comparison of three methods of aligning an image with the Google Earth scenery.

A while ago I attempted to create an overlay of the Abbey Road Studios live feed of the camera they have pointed at that famous zebra crossing. I plastered the image on a GroundOverlay and set the camera position to give a reasonable rendition of the crossing area, though of course most of the image appears distorted.

Next I tried a ScreenOverlay. Careful viewpoint positioning gives a fairly good result.

More recently, prompted and inspired by the work of Valery Hronusov over at GIS Planet I did a PhotoOverlay version.

I've collected all three together here for comparison:

View Abbey Road GroundOverlay in Google Earth

View Abbey Road ScreenOverlay in Google Earth

View Abbey Road PhotoOverlay in Google Earth

Clearly the PhotoOverlay gives the best fit (and I'm sure I could have done better with a bit more time), but despite having the positioning controls built into GE it is still quite a tricky business getting things aligned. When you adjust lat and long, the altitude relative to sea level remains constant, which means that the altitude above ground level changes as you move about. This happens regardless of the altitude reference type selected in the box. I'd like to see altitude relative to the ground stay constant, if that is the reference I am using.

Just to round things off, I couldn't resist placing a PhotoOverlay of the album cover too.

View album cover PhotoOverlay in Google Earth

St Mawes Castle Spherical PhotoOverlay

The source pano image is 8192 x 4096 pixels, decomposed into an ImagePyramid for display in a Google Earth PhotoOverlay using the Photoshop script. That means you can zoom in and enjoy the detail of the stone (except in the overexposed areas of course).

View in Google Earth

Unfortunately the implementation of spherical viewing isn't all it should be in 4.2beta, and the pano flips upside down when you stray too far from the initial heading. There also seems to be a bug which causes GE to crash if you launch a second instance of the same PhotoOverlay whilst still in viewing mode. Hopefully these issues will be cleared up before long.

Friday, 31 August 2007

Gliding at Upavon: Two PhotoOverlays

A shot of Upavon and my left knee from the cockpit of a DG1000 glider operated by the Wyvern Gliding Club.

I've compared two methods of embedding this image in a PhotoOverlay. The first kml file simply references the original photo. The second version references an ImagePyramid created from the photo.

The resolution of the image in the first method never equals that of the original photo, and appears blurred as you zoom in. The ImagePyramid version maintains high resolution as you'd expect. The odd thing is that you can zoom in on the plain, blurry image as far as you like, but the ImagePyramid version limits the amount of zoom you can achieve.

upavonglidingphotooverlay1.kmz

upavonglidingphotooverlay2.kmz

ImagePyramid Tiles from GMapImageCutter

For those without access to Photoshop, jpeg tiles for KML PhotoOverlays can be generated using the Google Maps Image Image Cutter by the UCL Centre for Advanced Spatial Analysis (CASA).

Pad your source image out so that it occupies the bottom left of a square image with a side length in pixels of a power of 2 (maximum size 8192x8192 pixels). Load it into Google Maps Image Cutter and set the 'Max Zoom Level' according to the image size as follows:

Size [px]Max Zoom Level
8192 x 81926
4096 x 40965
2048 x 20484
1024 x 10243

Create your tiles, which will be placed in a new folder.

All that is left to do is to run makepyr.bat from the same folder. It will create copies of the Image Cutter tiles, with names that are compatible with the KML2.2 ImagePyramid element. Ignore any file not found error messages.

One drawback with this approach is that it is likely to generate some unnecessary tiles at higher zoom levels from the image padding areas. These are pretty easy to spot (e.g. they are identical, uniform in colour and probably the smallest file size) and manually delete.

Photoshop Scripts for ImagePyramid Tiles

The KML2.2 PhotoOverlay supports ImagePyramid tiling, where large images are split into sets of 256x256 pixel tiles. Each set is at a different zoom level, with zoom level 0 containing a single tile with a small version of the whole image. Each increment of zoom level quadruples the number of tiles, until the highest level covers the entire image at full resolution. A better explanation is given in the Google Earth KML documentation.

As you can imagine, creating all those tiles can be something of a chore. For this reason I've tried my hand at writing Photoshop CS2 scripts to automate the task. Download MakeJPGImagePyramid.jsx and MakePNGImagePyramid.jsx and store them in your C:\Program Files\Adobe\Adobe Photoshop CS2\Presets\Scripts folder (or the equivalent Mac folder of course). Load your image, then run the png or jpg version of the script. Tiles will be placed in the same folder as the source image, with the source image file name postfixed with "_[level]_[row]_[col]".

The .png version will preserve any transparent areas of the image as transparent areas of the tiles.

These are the first Photoshop scripts I've attempted, so please forgive any silliness in their construction - I welcome any suggestions for their improvement!

The next stage is to do a script that saves in png when the tile has any non-opaque pixels and jpg otherwise. I'm not sure how to do this yet (check a histogram of the tile alpha channel perhaps, or select opaque pixels and check selection dimensions?), but I'll post it up when it's done.

Thursday, 30 August 2007

GE PhotoOverlays with Panoramic Spheres

For the last few days I've been experimenting in Google Earth 4.2beta with the KML2.2 PhotoOverlay element. I'll post some of the initial examples in the next few days, but I'll start with this evening's results.

A while ago Smithee over at Digital Urban came up with an excellent method of displaying 360x180 degree panoramic spheres in GE. I wondered what would happen if I tried to combine his panoramic spheres with the new PhotoOverlay element.

First download his Google Earth Trafalgar Square panorama and view it in GE. Then download this viewer photooverlay file, which has been set up with the same coordinates to place you at the centre of the sphere.

The results are a little disappointing, mainly because the implementation of spherical images in GE seems to be buggy. The image often moves jerkily and flips upside down when you stray too far from the neutral position. However, it does add an extra method of navigating the sphere and the ability to zoom in with the mouse wheel. I still much prefer viewing the spheres with a SpaceNavigator, but for those that don't have one this method gives an extra option.

viewerphotooverlay.kmz