Automatic Panoramas in Montreal

October 5th, 2009 No comments

I used the automated panoramic photography rig (or Panoramaker, for short) in order to make some panoramas here in Montreal.

After having the rig working, I went out on my bike with my tripod, my laptop, my digital camera and the panoramic photography ri. I decided I wanted to capture the sunset at Mount Royal but when I was halfway there, I noticed that the sun became completely covered by clouds.  So I decided to shoot some other panoramas instead.

CCA

Here is a nice 360 deg view of the Maison Van-Horne Shaughnessi (a.k.a. The Canadian Centre for Architecture). This building is located here. Keep in mind that you can click on the title in order to see the panorama full-screen.

View code
Title: Maison Van-Horne Shaughnessi
Description: A 360 deg panorama shot from the sidewalk.

When watching carefully, it is possible to notice a little parallax error near the base of the descriptive plate in front of the building. I could have corrected this but I noticed it too late and I am extremely lazy. You can also see some cars blending with their surroundings as Hugin, the panorama stitching program, tries to make sense of a changing scene (with cars passing by).

Place Ville-Marie

This is a panorama of Place Ville-Marie taken at the central fountain.

View code
Title: Place Ville-Marie
Description: A 360 deg panorama shot at the Place Ville-Marie fountain.

The parallax errors in this one are much more significant, but then again, laziness got the best of me. They are mainly caused by the fact that the camera was not perfectly flat on the tripod when shooting this.

If you want to know what are the tools used to create these panoramas, please read my previous posting on Making Panoramas.

Share and Enjoy:
  • Digg
  • StumbleUpon
  • Reddit
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Print
Categories: Project Tags:

Panoramaker

October 4th, 2009 No comments

As promised before, 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, 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,  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

Download
# Adding the path to the lib_pololu.py file to your modules path.
# Assuming that the file is at /your/path/to/the/library/lib_pololu.py
import sys
sys.path.append(‘/your/path/to/the/library’)

# Import the lib_pololu module
import lib_pololu

# Import the serial communication and time modules
import serial
import time

# Open serial port
port = serial.Serial(‘/dev/ttyUSB1′)
port.baudrate=2400 #set an appropriate baudrate

# Camera Code (from vmlaker.org)
import os, re
from subprocess import call, Popen, PIPE

def run(command):
    print ‘Running:’, command
    p = Popen(command, shell=True, stdout=PIPE)
    lines = p.stdout.readlines()
    for line in lines:
        print ‘Stdout :’, line,
    return lines
def capture():
    c = ‘gphoto2 –capture-image’
    sout = run(c)
    firstLine = sout[0]
   
    expr = ‘New file is in location (.*?) on the camera’
    comp = re.compile(expr, re.DOTALL)
    path = re.findall(comp, firstLine)[0]
    dir, fname = os.path.split(path)
   
    c = ‘gphoto2 –get-file %s –folder %s’%(fname, dir)
    run(c)
   
    c = ‘gphoto2 –delete-file %s –folder %s’%(fname, dir)
    run(c)
   
    c = ‘gphoto2 –storage-info’
    run(c)

# Calibration Parameters
# These parameters set the limits and reference positions of the rig.
# They have been obtained trough trial and error.
horizontal = 93.5
front = 95.5
back_l = 84.5
back_r = 107
top = 70
bottom = 110

# Create two motors
# There are associated to the panning and tilting motion of the rig.
tilt = lib_pololu.Servo(port, 0, 1150, 4650)
pan = lib_pololu.Servo(port, 1, 1200, 4987)

# Define a capture routine
# This is a simple loop that takes pictures in order to produce a
# 360 deg panorama.
def capture_pano():
   
    # Capture parameters
    steps_h = 16
    steps_v = 4
    step_h = (back_r – back_l)/steps_h
    step_v = (bottom – top)/steps_v
    pos_v = bottom

    while (pos_v >=top):
        tilt.set_pos(pos_v)
        pos_v = pos_v – step_v
        pos_h = back_l
        while(pos_h <= back_r):
            pan.set_pos(pos_h)
            pos_h = pos_h + step_h
            time.sleep(2)
            capture()

# Initialize the motors
tilt.set_pos(horizontal)
pan.set_pos(front)
time.sleep(2)

# Capture the panorama
capture_pano()
 

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

Share and Enjoy:
  • Digg
  • StumbleUpon
  • Reddit
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Print

Panoramic Camera – Prototype

September 29th, 2009 No comments

Update:

Read the follow up posts: Panoramaker, where I expose the software, and Automatic Panoramas in Montreal, where the final result can be seen.

I have finally completed my second project sponsored by RobotShop. I apologize for the immense delay, I really missed my promise of rolling out a new project every two weeks. Let’s just say that I had a lot going on lately and I could barely keep up with my obligations, let alone blogging or building new projects.

Place Ville Marie Panorama

Place Ville-Marie Panorama

This time, I built a panoramic camera. My main objective was to have a platform that can be used with pretty much any camera and that can produce panoramas with a minimum of work. If there is enough interest from the public and if this prototype is well received by the DIY community, I’m planning to produce (and hopefully sell) kits that would include all the parts to build this device.

Materials

Putting It Together

Panoramic Camera Mount

Panoramic Camera Mount

The first step was to put together the ServoCity Pan and Tilt system. This took away much of the building work since it is really simple to put together in no time at all. Nevertheless, I applied some modifications to it: I discarded the bottom plate that should be attached to the panning servo (since I am using a larger winch servo that would not fit otherwise), and I drilled a hole on the top plate in order to be able to fasten the camera to the rig. Note that I also included a little piece of neoprene that was lying around in order to prevent the bottom of my camera from getting scratched.

The mounting hole for the camera must be placed so that the lens’ pupil is at the centre of rotation. This way, the horizontal rotation axis will be close to the no-parallax-error point  (or whatever it is called) of the camera and will minimize the parallax errors.

Then, I used an old heat sink as the main structure since it is sturdy and basically free. I used the trusty Dremel to adapt it and cut the proper holes and slots in order to mount all the remaining pieces. The pieces to be mounted on the aluminum plate are the battery holders, the Pololu servo controller, and the winch servo motor. (or whatever it is called

I encapsulated the Pololu servo controller in a small plastic container I got from for free while on a trip with my girlfriend to the beauty/ soap/cream shop. I also used two 2-AA battery holders in order to provide power for the servo motors. I used 29000 mAh NiMH rechargeable batteries that gave me several hours of autonomy. In order to connect the battery holders to the controller, I soldered a two-position female header and insulated the leads with heat-shrink tubing.

I used almost exclusively cable ties to tie everything on the aluminum plate except for the winch servo motor that I screwed in and the long nut that was also screwed in place (after being drilled sideways).  I also had to drill the bottom aluminum face in order to allow for the tripod screw to be inserted into the nut.

Operating it

Panoramic camera in action

Panoramic camera in action

This first prototype requires a laptop to be operated, which can be a little annoying.  I plan to use my EeePC in the immediate future and an embedded computer for an eventual commercial kit. It basically works as follows:

  1. The camera is set on the panoramic mount, which is fastened to the tripod.
  2. The servo controller and the camera are connected to the computer trough their respective USB cables.
  3. The controlling program is run.
  4. The user waits in awe while the camera takes pictures by itself.

In order to control the hardware, I use a python script that uses my Pololu library and gPhoto in order to operate the servos and the camera respectively. I chose gPhoto since it supports a very wide range of cameras and it is very easy to use.

For now, taking a full 360 panorama takes about 15 minutes. This is a very long time and is mostly due to the fact that my script was hastily put together without care about the performance and in very little time. I will, very soon, post a cleaner version of the code, as well as all the panoramas I took properly processes and in full format, similarly to what I did with my San Francisco panoramas.

Acknowledgements

RobotShop.com

RobotShop.com

I would like to thank the great people at RobotShop for providing the Pololu Micro Serial Servo Controller, the  ServoCity SPT200 Direct Drive Pan & Tilt System, and the Hitec HS-785HB Winch Servo Motor. This is the second (and hopefully not the last) project they sponsor here at Carlitos’ Contraptions. Without their help, I would have never been able to afford any of the materials (except for those that come straight from the garbage as usual).

They have also being very patient and understanding about my unexpected delay in rolling out this project.

http://carlitoscontraptions.com/2009/05/making-panoramas/
Share and Enjoy:
  • Digg
  • StumbleUpon
  • Reddit
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Print
Categories: Project, Robotics Tags: ,

Tux Laptop Sleeve

September 7th, 2009 No comments

The only defect of my new Vostro 1320 is that it did not come with a sleeve as the Eee PC does. Since I would like to protect the laptop from scratched and dust, a sleeve is absolutely required. So, from my perspective, the only solution to this problem was to do one myself.

I had an old blazer from my girlfriend’s father that was too oddly shaped to fit anybody I know, but I liked the fabric and I thought that it could become a very nice laptop sleeve. The only problem about that idea is that I do not know how to sew. Of course, not knowing how to do something, has never stopped me before and is not likely to stop me any time soon.

Tux laptop Sleeve

Tux laptop Sleeve

Materials

  • Old blazer
  • Zipper
  • Fabric Marker (not required but rather cool)

Doing it

Making this was surprisingly simple since I expected great difficulties coming from the sewing part. I decided to go with a design as simple as possible and to minimize the number of stitches, this resulted in making something extraordinary similar to a simple cousin.

I simply cut a rectangle big enough so that, when folded in half, it could contain my laptop from the blazer and then stitched the bottom and the side of the resulting pouch.  Then, I added a zipper to the top. I used zigzag stitches all the time and, of course, I sewed the sleeve from the inside.

Also, I chose a section of the blazed which had an internal and external pocked so I could use them to carry some extra stuff. Furthermore, I kept the (synthetic?) silk interior lining that looks better than the bare exterior wool.

Finally, I wanted to ad some decorations to the pouch so I decided to use my brother’s fabric markers (he is using for making pretty cool disguises) to ad the word “Linux” to one side of the sleeve. Then I asked him (since he is much more talented than me at drawing (and since I am very lazy) to draw Tux on the back. To achieve that he used a stencil made from the image below that I got from the internet.

Tux Stencil

Tux Stencil

I think the final result is pretty cool and very useful. The pockets are great, I can put all of the things that I usually need to carry with my laptop (e.g. mouse, headphones, USB keys) without any troubles. The only thing missing is perhaps a handle that I may add in the future.

My Brother Painting Tux

My Brother Painting Tux

Share and Enjoy:
  • Digg
  • StumbleUpon
  • Reddit
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Print
Categories: Project Tags: ,

New Laptop

September 6th, 2009 1 comment

Following some serious problems with my Eee PC, I acquired a new laptop, a real one. I was planning to use the Eee as may main and only computer but some very serious problems with its SDD (that I will describe in another post soon) prevented me form doing so.

I opted for a Dell Vostro 1320 and must say it is a beautiful machine. It is small, powerful, light, and most importantly shiny.

Vostro 1320

Vostro 1320

Some Specs:

  • Intel Core 2 Duo P8700 @ 2.53GHz
  • nVidia Corporation GeForce 9300M GS
  • 4GB RAM
  • 320 GB HDD
  • 13.3″ screen matte (I can’t stand glossy displays)
  • Intel wireless adaptor draft n
  • 12 cell battery
  • Mono integrated speaker (this is its only weakness)

I am running Kubuntu 9.04 with KDE 4.3.1 and it is absolutely marvelous. Everything works perfectly (except for the microphone). As a matter of fact, KDE is so absolutely mind blowing I’ll make a post exclusively about it soon (hopefully).

I know I am running late with my posts and answering messages but I’ll post some new projects very soon.

Share and Enjoy:
  • Digg
  • StumbleUpon
  • Reddit
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Print
Categories: General, Tools Tags: