Category: Software

Software-centric projects.

Panoramaker

As promised before, buy viagra
here is the Python script that runs my panoramic camera hardware. It is a very quick prototype and is by no means intended for widespread use since it requires manual calibration. Nevertheless, cheapest
it might be very useful to those seeking to learn how to position the servos or control a digital camera through Python.

This script requires my Pololu library and includes some codes from here in order to control the camera. Besides the basic requirements of lib_pololu, pill
the script also requires gPhoto. If you are running Linux, you most likely already have it but in case you do not, you can install it through your favourite package manager or by using the console (e.g. for Ubuntu/Debian):

sudo apt-get install gphoto

If you are using some other OS, you can download gPhoto from here.

The Code

Again, many thanks to RobotShop who provided the hardware that made this project possible.

Pololu Python Library

The World’s Leading Source for Domestic and Professional Robot Technology.

Pololu Micro Serial Servo Controller
Pololu Micro Serial Servo Controller

I started writing a library for controlling the Pololu motor controllers with a computer trough a serial port.

I’m writing this in Python so the code can be cross-platform but I would be very glad to have some feedback about running it on other OSs than Linux. Actually, endocrinologist any feedback would be very welcome.

As of now it can interface with the Pololu Micro Serial Servo Controller that I got form RobotShop. I am planning to use this code in my upcoming project RobotShop is sponsoring. I will supplement this library as I get newer hardware to work with.

I know there is already a python interface for it but I really wanted to have an object oriented way of managing motors (i.e. they can be instantiated and controlled more easily).

You can download the library here: lib_pololu.py (you will need to change the extension of the file to .py instead of txt).

In order to properly use this library you will require:

  1. Python
  2. Pyserial

If you use a civilized OS you may be able to get all this by typing this in a command prompt:

sudo apt-get install idle python-serial

Here is a sample script that will use the library in order to control a servo: servo_example.py (you will need to change the extension of the file to .py instead of txt).

Note for Redmond OS (aka Window$) users: you will need the Win32 Python extension for pyserial to work.

Making Panoramas

A regular Canadian quarter.
In my trip to San Francisco, unhealthy I had the chance to see many beautiful things. And I wanted to be able to remember them and show them to my friends and family.

San Francisco Seen Form Twin Peaks Park
San Francisco Seen Form Twin Peaks Park

Besides taking simple photos, sometimes you need a wider view- angle to really capture the scenery. The obvious solution to this is making a panorama. This means you take many pictures of different sections of your subject and then align them and stitch them together so to form a bigger picture.

Many people believe this is a very difficult procedure and that the results are never as good as expected, and they are partially correct. In order to get a nice looking panoramic picture hat will align and stitch together correctly you need to follow some rules:

  • Make sure that contiguous pictures have a good 30% overlap between them.
  • Make sure the overlapping areas contains some hard object, like a building. If they overlap only over the sky or some water, then the stitching together will be more difficult.
  • Make sure you follow a simple pattern when shooting the photos. Follow a horizontal line, for instance, and shoot the pictures in order. Also, if your making a taller panorama, I suggest you shoot many horizontal lines that will stack up together. This will make things easier when recognizing which photos to stitch together.
  • Make sure all the pictures have a similar exposure. This should be no problem if you are shooting your pictures all at once.
  • Make sure your subject is always on the same focal plane. You can have many focal panes but it will make the stitching more difficult.

Once you have shot all the pictures you can start the stitching. In order to so so, you can use an excellent software package called Hugin. Of course since I’m using it, Hugin is open source and (thus) cross-platform. Is is a very intuitive program to use and since there are many good tutorials about it, I won’t be outlining the instructions on how to use it.

Once you stitched your images together (which can be done in the three steps the wizards takes you trough) you will end up with a big TIFF or JPG file. Now you are basically done. Now you just need to crop it and made any desired adjustments with a picture editing program lie Gimp.

The only problem is that if you want to share this picture it can be hard since it may be too big for sending by email and will take a long time to (upload and) download if you put it on a website.

Now you can use the Google Maps Image Cutter. This little Java program developed by UCL enables you to use the Google Maps engine as a picture viewing system. It creates many copies of your image at various resolutions and chops those images into small square pieces. Then when you view the image trough the google maps engine, you are only loading the small squares at which you are currently looking at the resolution corresponding to your zoom level.

Here you can enjoy a few examples I made (click on the title to view them in full screen).

Title: Downtown San Francisco
Description: A panorama shot from the Twin Peaks Park.
Title: Downtown and East San Francisco
Description: A larger panorama shot from the Twin Peaks Park.
Title: South San Francisco
Description: Another panorama shot from the Twin Peaks Park.

Keep in mind that Hugin is very powerful and can do much more than simply stitching a few images together. Also, there might be a few issues with the file writing routine when trying to run the Google Maps Image Cutter in Linux.