Showing posts with label gps. Show all posts
Showing posts with label gps. Show all posts

Saturday, April 30, 2011

A Different Perspective

Finally getting things to line up... but the perspective is not quite right. It looks fine on the top half of the mountain, but the horizontal trail should be much lower; in fact, part of it is behind the camera, which just ain't right...
This is the same view with placemarkers drawn in: the green cross is the GPS peak of Blackhead, which is the point where the photo is inserted. The red cross is the camera position (with compass and XYZ directions drawn in), and the pink cross is the peak of Black Dome mountain. There enlies the problem-

This is a side view of the whole thing, looking North. The red cross is still the camera, and the white line is where it's looking. Black Dome is behind the camera, but somehow the camera still sees it. I think this has to do with the ortho() function, again because the perspective on the path is not quite right. I've tried adjusting the clipping planes, but that doesn't change the perspective, only what renders and what doesn't render. So how the camera is seeing behind itself, I don't know...

But this is what it looks like with the "standard" perspective:

And this is where I think the trail should be:

Wednesday, April 27, 2011

Into the Void... aka Progress!



Making progress orienting the OpenGL virtual camera, and fixed the rotation of the image so it's [very nearly] square to the virtual camera. Note to self: degrees are not the same as radians.

In theory, all I need to do is make some fine adjustments to the image orientation to compensate for the pan and tilt of the real camera (when the picture was actually taken). And then get it to scale properly- the image should take up the whole gray area. And hopefully the perspective will correct itself with the scaling... hopefully being the key word.

Wednesday, February 23, 2011

Blackhead (annotated)

This is Blackhead Mountain in the Catskills, from a lookout on Black Dome, and somewhere in the middle is the trail that links the two. If I can figure out the scale of the photo, and the direction that the camera is pointing, I can use my GPS log to draw the trail.

I know the GPS position of the Blackhead peak and the camera, and using those I can calculate the distance and bearing between the two. But since the peak is off center, I need to figure out the direction the camera was pointing, even though it's only off by a few degrees.

The peak is offset by 114 pixels horizontally (the black triangle). If I can figure out the scale of the photograph accurately, I can use this to figure out angle the camera is pointing. Of course, the original image is much larger, but the ratios should stay the same.

If I can figure out the scale and rotation of the image, I should be able to line up the GPS log of the trail with the picture...

This is a crudely oriented view of the GPS trail. The red cross is the camera position, and the green cross is the peak of Blackhead. So all I really need to do is line up those two points over the picture... simple enough, right?


Ultimately it should look something like this, but with more picture and less black void...

Monday, February 7, 2011

Mt. Hight, New Hampshire

3D view
Elevation vs. Time


Total Time: 5:51:49
7.93 miles
1.36 miles / hour (not taking stops into account)

1472.1 feet (base elevation)
4706.5 feet (peak elevation)
4079.3 feet (elevation gain)

Red: <>Yellow: <>
Green: > 1.0 m/s

Friday, December 17, 2010

Pictures!

Updated the Elevation Profile part of the program... same GPS Log (Catskills Blackhead Range) with new graphics & live animated elevation marker...

Will elaborate later, but here's some pictures for now!


Monday, November 1, 2010

Hiking the Catskills in 4D!

This past weekend I had my first introduction to what is known among the hiking community as "Peak bagging". From wikipedia:

Peak bagging (also hill bagging, mountain bagging, Munro bagging, or among enthusiasts, just bagging) is an activity in which hillwalkers and mountaineers attempt to reach the summit of some collection of peaks, usually those above some height in a particular region, or having a particular feature.

We bagged three peaks, two of them twice, since we had to retrace our route to get back to the car. This is known as a lollipop loop:

This is the overhead 2D map view. Latitude vs. Longitude. Pretty simple. And now that I finally have some interesting altitude data, I started working on the third (and, inadvertently, fourth) dimension to my program-

This is the Altitude Profile of our hike. Altitude vs. Time. If you notice, the first two peaks and last two peaks are nearly mirror images of each other, which is an interesting result of the lollipop loop.

The heights of the peaks are the same, but the widths are different, probably because I was going faster on the way out. It was starting to get dark...

So, now I have two 2D abstractions of our hike. Now, all I need to do is mash them together (that's a technical term) and I'll have 3D!

Saturday, August 14, 2010

Hiding Things in Plain Sight

Spent several hours last night searching through the Android Source Code for their method of calculating GPS distances, to use in a Processing sketch I'm working on... very frustrating. If I knew what I was doing, I might have known intuitively where to look, but searching through an entire operating system worth of code is a very imposing task for an amateur. The Android javadocs are great, but a direct link to the source code would be very helpful.

Finally I came across this seemingly obscure forum, and without further adieu, the Android Java Core source code: platform/frameworks/base.git

And for those interested in the GPS capabilities, the Location class source:

The distanceTo() and distanceBetween() functions are part of the Location.java class, and both make use of the private computeDistanceAndBearing() function, which is certainly complex enough to justify having spent so long looking for it...

Anyway, the whole purpose of this is to make pretty pictures-

This is one of the early tests, just riding my bike, using GPSLogger for Android. I love this one, and the beauty is that it's completely unintentional. I just went for a bike ride around the park and through the neighborhood, and this is what came out.

The high point on the far left is a random GPS anomaly (read: error), but it really makes the picture. I think it looks like a fairy about to whack someone on the head...