Category Archives: My Projects

Picture Earth From Space

Earth, From Space

For some reason, today I decided to make a picture of the earth from space, using the NASA Blue Marble Next Generation dataset, some infrared satellite data (from today, no less) and my trusty homebrew raytracer. Ten minutes of work, and I got the image on the right. Not too bad, even if it doesn’t include any atmospheric effects.

Just my ten minute hack of the day.

[tags]Computer Graphics,NASA,Blue Marble Next Generation,Mapping[/tags]

Addendum: Want to do a better job? Check out this paper.

Addendum2: Check out this picture of the shadow of the moon on the earth taken from the ISS.

A Little GPS Hacking..

Today I learned something interesting while surfing the web: that somebody had made a simple program that can be used to compile your own custom maps for Garmin GPSes. Since I picked up a Garmin Legend CX recently, I thought that would be a good thing to play around with. So, tonight, I tried to see how far I could go in trying to get some simple road data compiled and downloaded to my GPS.

My GPS with My Custom MapWell, as you can see from the result on the right, I managed to get fairly far. I’ll prepare a writeup on how to do this when I get the maps refined, but basically, I wrote a simple perl script that used the Geo::ShapeFile library to parse road data that I downloaded from the US Census bureau. I then (stumblingly, I’m no perl expert, I’m more of a python guy…) wrote this out in a format that could be compiled by cgpsmapper (links tomorrow, when I’m more awake) and compiled the map, downloaded it to my GPS with sendmap, et voila! You can see the street names surrounding Pixar’s location in downtown Emeryville!

It’s very cool! I’ll try to get a tutorial written up on how to do this sometime later, along with links to all the necessary software, and make my Bay Area street maps available.

[tags]GPS,Garmin,Custom Maps,Hacks,My Projects[/tags]

Addendum: Well, it’s morning, I haven’t even had coffee, but here are some links that you’ll find helpful:

  1. cGPSmapper is the most important bit: a compiler that can convert a simple textual representation of maps into the right format for downloading to your Garmin GPS
  2. MapCenter has some pre-made user contributed maps that were compiled with cGPSmapper and are available for download.
  3. I downloaded the  necessary road maps from this website, which provides a convenient interface for downloading TIGER data from the U.S. Census Bureau.
  4. The Geo::ShapeFile library will make parsing the files that you downloaded above much simpler, even if you are a perl neophyte like myself.

These resources were enough for me to create a simple script that converted the Alameda county road data into something I could download.  I need to review some of the TIGER documentation to figure out what other data I need (in myuser map, things like shortlines aren’t represented at all) but I really think that the core of what you need is very simple.   I’ll keep you all posted.

Weekend Musings

Did you ever have one of those weekends when you had too much rattling around in your skull to make any headway on any of it? That’s sort of what I’m up to this weekend. Rather than let it all rattle, I’ll toss some of it out here:

  1. I heard that OfficeDepot was liquidating their stock of the Zyxel 2000W wireless VOIP phones for $59.04. I went to my local Office Depot and picked one up. I might still give a more thorough review, but the bottom line is “don’t bother”. It works fairly well as far as audio quality (although at the default gain settings you get some echo), but the deal breakers are really miserable battery life (I doubt you could get an hour of talk time, and slightly less than 24 hours of standby time) and problems hopping onto open access ports. It’s just rough product all around.
  2. In a somewhat work related thread, I’ve been studying a bit about anamorphic camera lenses. Lenses like this are used to film widescreen 2.39:1 film onto regular 35mm stock, and then a similar projection camera lens is used to “undistort” the image back upon projection. Pixar has done many of its films in Cinemascope, so it’s of some interest. Anyhoo, I found that in my junk box of optical crap, I had an old Bell and Howell anamorphic projection lens. Somewhat on a whim, I decided to try placing it in front of my ordinary miniDV video camera, and seeing if it would work. It seems to: I need to make a jig to hold the lens in place in front, and then maybe I’ll shoot some video. Stay tuned for that.
  3. While I was doing some further research, I found a thread about people manufacturing their own anamorphic projection “lenses”. I put lenses in quotes because the way this works is by passing light through two different prisms, made from glass and filled with turpentine and water, respectively. As part of my telescopemaking endeavors, I learned quite a bit about optical design before, but I hadn’t really studied this kind of anamorphic system before, so I went to work trying to write the design equations for this kind of setup. I think I roughly understand what’s going on. I never really studied prisms much, but basically they are trying to create an achromatic prism. To really design such a thing, you need to know the index and dispersion (Abbe number) of the two materials, and do a bit of spreadsheet math. I might doodle around with that later today.
  4. I did a bit of geocaching yesterday. I was going to try to download some of my tracks and plot them with Google Maps. Maybe I’ll get to that later too.
  5. Oh, and I have Weight Watchers weigh-in today. My weight is up, and I’m feeling annoyed and deprived.

That’s what’s rattling around in my skull, now, the incredibly diverse tags.

[tags]Geocaching,Anamorphic Lens,Weight Watchers,VOIP,Zyxel 2000W[/tags]

I’ll be at the San Mateo Maker’s Faire in April

It looks like I’ll be attending the Maker’s Faire in San Mateo coming up on April 22nd and 23rd. My proposal to show my Atari 2600 Enigma Machine was accepted, so I guess I get to setup a little table display and yack at people about writing programs for the old Atari 2600. If I get all my prep done, I’ll be demonstrating how you can assemble code using P65, the perl assembler, run it with the Stella emulator, and then burn it onto an EEPROM for execution in the real machine.

More details as it gets closer, but if you read my blog and are in the neighborhood, I’d be thrilled if you stopped in to say hi.

[tags]My Projects,Hacking,Retro Video Games,Atari 2600,Enigma Machine[/tags]

Addendum:   Bonus link to an Atari 2600 inspired music video.  Found it with Technorati.   Rockin’!

Pencil Drawing

Josh over at tinyscreenfuls is digging some of the fancy “pencil sketch” effects that the Mac can do with its internal camera.  Back in 1998, I experimented with writing some filters that did much the same, with some examples that I generated shown on the right.   Macintosh?  I don’t need no steekin’ Macintosh. 🙂

And now, for your next project, render an entire feature length film.   Beneath your desk, you’ll find a pencil, a yellow pad, and a C compiler…

What I know and don’t know about Asterisk…

Well, I haven’t got it all figured out yet, but here is what I know:

  1. It’s not hard to compile asterisk for the amd64, but…
  2. You need to be careful compiling the ztdummy kernel module: in particular, you must define USE_RTC when compiling, because the sourcefile incorrectly only checks for USE_RTC if __i386__ is defined, which is not the case for 64 bit machines.
  3. Getting mpg123 to compile seems hopeless on the amd64.
  4. You can get a phone number for $11/month, with unlimited incoming calls and about $.02 a minute for outgoing calls to the United States via VoicePulse Connect!.
  5. I can, with a minimum of effort, create a simple dialplan that allows incoming calls from that number to be forwarded to some phones attached to my hacked Linksys PAP2 adaptor.
  6. BestBuy has a nice 5.8 ghz phone on sale for $25 with a $10 rebate.
  7. I can make calls from my Linux console (using a headset) to those phones.

What I don’t know:

  1. While the phones attached to the PAP2 can receive calls, I haven’t figured out how originate calls from them.  There is obviously something stupid about configuring them that I don’t understand.
  2. Sometimes the voice quality from the console seems bad, which I suspect is some kind of codec mismatch.

Ultimately, I’d like to make a simple “dialplan compiler” that allows you to enter some basic information, (account numbers, logins and the like) and generates the necessary asterisk configuration files.  I’ll probably write it in Python…

Hopefully, I’ll have this up and ready for human testing in the next week or so.  Then, I’ll unveil the deeper purpose!  Stay tuned.

[tags]Asterisk,VOIP[/tags]

My new PC…

Over the last couple of months, I had gradually decreased the number of computers in my office to just two (well, computers that have X86 architecture anyway), and I decided that I would like to have a new amd64 based machine. I priced out the cost of just building one from components, and found that I probably couldn’t do better than the HP a1310n, so I just went out and bought one. I’ve purged the windows infestation off it, and installed Fedora Core 4 on it. I’ve got a number of projects that can benefit from its high speed, including goofing around with MythTV and Asterisk. I got the ivtv driver working on my WinTV PVR150 MCE card and even have accelerated X running on it, so progress is being made. Last night I had some difficulty with Asterisk, the ztdummy driver that provides timing information seems not to load for reasons that escape me. But the hardware seems to be quite nice, I only wish the onboard video had NTSC outs, then this machine would be ideal as a front end for MythTV.

Using FFMPEG to make PSP video

I spent a little while trying to figure this out, apparently the -r argument is significant:

ffmpeg -i superman_the_mechanical_monsters.mpeg \
    -title "Superman: The Mechanical Monsters" \ 
     -s 320x240 -b 512 -ar 24000 -ab 64 -r 29.970030 -f psp M4V12345.MP4

The -title seemed fubarred, but the rest seems to work. I’ll refine this more later.

Filenames apparently need to be of the form M4VXXXXX.MP4, where the X’s are digits.

Mistake Number…

Well, the last 48 hours has been fun. I am taking a few day off before Christmas to go visit my mom and brother up in the Portland area, and I flew in Sunday night. I thought that I might document the few mistakes that I made during the trip so that others might be better prepared for their holiday. Mistakes will be documented in red so that others may learn.

I actually began promisingly. While still at the airport in Oakland, it was announced that due to inclement weather in Portland, we wouldn’t actually know if we were landing in Portland until after we were airborne. It was conceivable that we might have to divert to Seattle-Tacoma. I called my brother to tell him to not bother meeting me at the airport, that I’d rent a car when/if I got in, and I’d drive out to see him. This was the appropriate decision, and not a mistake. But don’t worry, they will come soon enough.

I thought to myself, gee, I could either rent a car, or I could take Max (the Portland light rail) to a location close to my brother, and he could pick me up there. Uh huh, you guessed which one I took. The next decision was to either rent a 4 wheel drive vehicle or save money by renting a little Camry. Yep. I did at least get the damage waiver. Leaving the airport I tried to decide how to get to my brothers house, after getting on 205, I decided I could either go through downtown Portland, potentially crossing many icy bridges, or take 205 south and then get on I-5 northbound. I’m not marking either one of these choices as a mistake, since I suspect either was bad. Initially I-205 seemed fine, and an appropriate choice. The temperature climbed to a balmy 37 degrees, and in spots the roads were almost dry. I began to get cautiously optimistic. Then I got on I-5 northbound. A parking lot. I watched as the guy behind me lost control of his car at one mile per hour and did a nice 180 spin in slow motion. The road was very slick, particularly in the exit lanes. Net result: nobody could/would exit. I then made a smart choice, I realized that I had a friend Jeff who

  • lived in the area
  • was freshly back from his vacation in Maui
  • was in possession of a 4WD Explorer
  • and liked driving in crappy weather

It was about this time that I realized my cell phone batter was really low and I didn’t bring my car charger. I called him, he was home, I told him to meet me at exit 289 (which I was approaching at 0.02mph), and I’d park my car somewhere safe, and we could come pick it up in the morning. This was also a very good idea, and not a mistake. Still, as I approached the exit 289, I saw a truck pulled off to the right of the exit lane, and a matching one just opposite on the left side, leaving a space about two car widths wide between the two. I watched as three different individuals in front of me tried to thread the needle. I watched as each spun out slowly, nearly crashing into one of both of the other two cars as they went sideways.

I decided not to run the gauntlet, and to try my luck at the next exit. In retrospect, I found this also not to be a mistake. Creeping along at a snails pace, it took me the better part of an hour to reach the next exit. I watched my precious cell phone battery usage, hoping that Jeff would call me back soon, especially since I hadn’t bothered to get his cell phone number. This was a mistake, but a harmless one. He did call, and said he was approaching exit 290. I told him he should exit, and wait to see if I could get off at that exit. A half an hour later, I managed to shift lanes over, and by driving in the gutter and slowly, slowly slowly creeping accross the exit lane, managed to get my car off the highway. Jeff was waiting for me at the Taco Bell.

The mistakes were over. We parked my rental in a residential neighborhood well out of harms way, and his 4WD Explorer and his DVD navigation system plotted an excellent non-I5 course back to my mom’s house. I picked up the car today, none the worse for wear.

Someday, I’ll have to relate the story of freezing rain that didn’t end so nicely.

For now, my thanks are with Jeff, and I’m having fun visiting with Mom and Kevin. Still, it will be good to be back to Carmen and Adam for Christmas.

Happy Holidays everyone, keep your cell phone charged and stay out of the freezing rain!

Anaglyphs, in color!

Stereo Pair of My Desk

Check these out with the red/blue 3D glasses. Kind of cool, huh?

If you followed my tutorial on how to do this with black and white images, you can probably figure out how to do this. The source pair
Basically, the red image is just the red channel of the left image, and the green and blue channels are the green and blue channels of the right image. Combine them using “Add” or “Screen modes”. You can get some eyestraining effects when certain objects are strongly green or red, but overall, the effect works rather nicely.

Give it a try.

Addendum: Others are on the same wavelength as me.

Fun with ball bearings…

A couple of days ago I published some images that I made by shooting video of a shiny metallic juggling ball. I went out yesterday in search of a better reflector. I visited a couple of specialty industrial suppliers, hoping to score some nice shiny ball bearings, maybe 2″ in diameter. Unfortunately, 1″ ball bearings seemed to be the largest that they had in stock. They were also a bit dingy, and didn’t seem to reflect very well (although they are much more spherical, the tolerance on this is 0.0000256 inches). When I got home, I dug out a batch of cerium oxide polish, and hit one up with a bit of it on a rag, which brightened the reflection quite a bit. I then snapped the following picture (shrunk here):

Macro Photo of a Ball Bearing

with my Nikon 4500. While of a boring subject, and in poor light, it showed good detail. Good enough to make the following virtual environment:

Much better than my previous attempt. A 2″ ball bearing would be even better.

Bad Video Panorama

I’ve been playing a bit of with video taping reflections from a shiny reflecting ball, and then undoing the map to construct a 360 degree view. You can either view these as normal jpeg images:

Or you can load them into a java applet like PTViewer:

Or, you can use the individual frames to make a really boring movie.

Happy Birthday Hack O’ the Day

Baseball HackI’ve been meaning to do a unique (well, fairly unique) hack for a while. I’ve had the database of major league baseball players from The Baseball Archive loaded in mysql for a while, and I’ve thought of creating a little sidebar gadget that shows all the major leaguers who were born on today’s date.

Well, if you go over the right and scroll below, you’ll see that I’ve spent five minutes and finally done it. Listed are the players first and last name, as well as any nicknames they have, and the year in which they were born. You can click on their name, and that will carry you to the Baseball Almanac baseball-reference.com page for that player. Fun.