From the category archives:

Linux/Ubuntu

If you want to post some JPEG pictures but you’re worried that they might have metadata like location embedded in them, here’s how to strip that data out.

First, install exiftool using this command:

sudo apt-get install libimage-exiftool-perl

Then, go into the directory with the JPEG files. If you want to remove metadata from every file in the directory, use

exiftool -all= *.jpg

The exiftool will make copies, so if you had a file called image.jpg, when you’re done you’ll have image.jpg with all the metadata stripped plus a file called image.jpg_original which will still have the metadata.

{ 31 comments }

When the Kinect launched, Adafruit Industries ran a contest for the first person who released open-source code to extract video and depth from the Kinect. Adafruit also ended up donating to the EFF after the contest was over.

When I was in grad school, I would have loved to have a device like the Kinect. So I decided to run my own contest:

The first $1000 prize goes to the person or team that writes the coolest open-source app, demo, or program using the Kinect. The second prize goes to the person or team that does the most to make it easy to write programs that use the Kinect on Linux.

It’s time to announce the prize winners. There’s been so many cool things going on with the Kinect that instead of two winners, I ended up declaring seven $1000 winners.

Open-source Application or Demo

I picked two winners in this category.

People that have made it easier to write programs for the Kinect

A ton of people have made the Kinect more accessible on Linux or helped the Kinect community. I ended up picking five winners.

All of these individuals pushed things forward so others can develop great programs on the Kinect more easily. Congratulations to all the winners, and to everyone doing neat things with their Kinect!

{ 20 comments }

I’m starting a contest for people that do cool things with a Kinect. See the details below.

Open Kinect Logo

Before I joined Google, I was a grad student interested in topics like computer vision, motion self-tracking, laser scanners–basically any neat or unusual sensing device. That’s why I was so excited to hear about the Kinect, which is a low-cost ($150) peripheral for the Xbox. The output from a Kinect includes:
- a 640×480 color video stream.
- a 320×240 depth stream. Depth is recovered by projecting invisible infrared (IR) dots into a room. You should watch this cool video to see how the Kinect projects IR dots across a room. Here’s a single frame from the video:

IR Projection

but you should really watch the whole video to get a feel for what the Kinect is doing.
- the Kinect has a 3-axis accelerometer.
- the Kinect also has a controllable motor to tilt up and down plus four microphones.

What’s even better is that people have figured out how to access data from the Kinect without requiring an Xbox to go with it. In fact, open drivers for the Kinect have now been released. The always-cool Adafruit Industries, which offers all sorts of excellent do-it-yourself electronics kits, sponsored a contest to produce open-source drivers for the Kinect:

First person / group to get RGB out with distance values being used wins, you’re smart – you know what would be useful for the community out there. All the code needs to be open source and/or public domain.

Sure enough, within a few days, the contest was won by Héctor Martín Cantero, who is actually rolling his reward into tools and devices for fellow white-hat hackers and reverse engineers that he works with, which is a great gesture. Okay, so where are we now? If I were still in grad school, I’d be incredibly excited–there’s now a $150 off-the-shelf device that provides depth + stereo and a lot more.

It’s time for a new contest

I want to kickstart neat projects, so I’m starting my own contest with $2000 in prizes. There are two $1000 prizes. The first $1000 prize goes to the person or team that writes the coolest open-source app, demo, or program using the Kinect. The second prize goes to the person or team that does the most to make it easy to write programs that use the Kinect on Linux.

Enter the contests by leaving a comment on this blog post with a link to your project, along with a very-short description of what your project does or your contribution to Kinect hacking. The contest runs until the end of the year: that’s Dec. 31st, 2010 at midnight Pacific time. I may ask for outside input on who should be the winner, but I’ll make the final call on who wins.

To get your ideas flowing, I’ll offer a few suggestions. Let’s start with the second contest: making the Kinect more accessible. In my ideal world, would-be hackers would type a single command-line, e.g. “sudo apt-get install openkinect” and after that command finishes, several tools for the Kinect would be installed. Maybe a “Kinect snapshot” program that dumps a picture, a depth map, and the accelerometer values to a few files. Probably some sort of openkinect library plus header files so that people can write their own Kinect programs. I would *love* some bindings to a high-level language like Python so that would-be hobbyists can write 3-4 lines of python (“import openkinect”) and start trying ideas with minimal fuss. To win the second contest, you could write any of these libraries, utilities, bindings or simplify installing them on recent versions of Linux/Ubuntu (let’s say 10.04 or greater).

Okay, how about some ideas for cool things to do with a Kinect? I’ll throw out a few to get you thinking.

Idea 1: A Minority Report-style user interface where you can open, move, and close windows with your movements.

Idea 2: What if you move the Kinect around or mount it to something that moves? The Kinect has an accelerometer plus depth sensing plus video. That might be enough to reconstruct the position and pose of the Kinect as you move it around. As a side benefit, you might end up reconstructing a 3D model of your surroundings as a byproduct. The folks at UNC-Chapel Hill where I went to grad school built a wide-area self-tracker that relied on a Kalman filter to estimate a person’s position and pose. See this PDF paper for example.

Idea 3: Augmented reality. Given a video stream plus depth, look for discontinuities in depth to get a sort of 2.5 dimensional representation of a scene with layers. Then add new features into the video stream, e.g. a bouncing ball that goes between you and the couch, or behind the couch. The pictures at the end of this PDF paper should get you thinking.

Idea 4: Space carver. Like the previous idea, but instead of learning the 2.5D layers of a scene from a singe depth map, use the depth map over time. For example, think about a person walking behind a couch. When you can see the whole person, you can estimate how big they are. When they walk behind the couch, they’re still just as big, so you can guess that the couch is occluding that person and therefore the couch is in front of the person. Over time, you could build up much more accurate discontinuities and layers for a scene by watching who walks behind or in front of what.

Idea 5: A 3D Hough transform. A vanilla Hough transform takes a 2D image, looks for edges in the image, and then runs some computation to determine lines in the image. A 3D Hough transform finds planes in range data. I’ve done this with laser rangefinder data and it works. So you could take a depth data from a Kinect and reconstruct planes for the ground or walls in a room.

Idea 6: What if you had two or more Kinects? You’d have depth or range data from the viewpoint of each Kinect and you could combine or intersect that data. If you put two Kinects at right angles (or three or four Kinects around a room, all pointing into the room), could you reconstruct a true 3D scene or 3D object from intersecting the range data from each Kinect?

I hope a few of these ideas get you thinking about all the fun things you could do with a Kinect. I’m looking forward to seeing what cool ideas, applications, and projects people come up with!

{ 88 comments }

If you’re on Linux (say Ubuntu 10.04, also known as Lucid Lynx), you can switch between the developer (dev) and beta channels of Chrome like this:

Switch from Beta to Dev:
sudo apt-get install google-chrome-unstable

Switch from Dev to Beta:
sudo apt-get install google-chrome-beta

That’s easier for me than going back for the .deb file and doing something with it.

Also, if you want to check whether a new dev version of Chrome is out, you can just repeat the same command:
sudo apt-get install google-chrome-unstable

and if there’s no new version, you’ll get something like this back:

Reading package lists… Done
Building dependency tree
Reading state information… Done
google-chrome-unstable is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I figured I’d document this in case I needed to remember how to do it in the future. :)

{ 12 comments }

I wanted to play with writing Android apps on my home Linux computer, which is currently running Ubuntu 9.04 (Jaunty Jackalope). These are mostly notes for myself, so don’t feel guilty if you skip this post. :)

- Make sure your system is up-to-date:

sudo apt-get update && sudo apt-get upgrade

- Install Java

sudo apt-get install sun-java6-jdk

- Switch Sun to be the default version of Java. It’s much faster than the built-in version, at least when I tried it.

sudo update-java-alternatives -s java-6-sun

- Make a directory, e.g. mkdir ~/android

- Download Eclipse from http://www.eclipse.org/downloads/ (I chose the “Eclipse Classic 3.5.1″ version). Move the code into that directory, then unpack it. Unpacking is enough–the software runs in place and doesn’t have to be installed onto the system other than unpacking it.

mv eclipse-SDK-3.5.1-linux-gtk.tar.gz ~/android
cd ~/android
tar xzvf eclipse-SDK-3.5.1-linux-gtk.tar.gz

- Download the latest Android SDK from http://developer.android.com/sdk/index.html and move it into that directory, then unpack it. I believe unpacking is enough–the software runs in place and doesn’t have to be installed onto the system other than unpacking it.

mv android-sdk_r04-linux_86.tgz ~/android/
cd ~/android/
tar xzvf android-sdk_r04-linux_86.tgz

- Edit your ~/.bashrc file and add a line to the bottom:

export PATH=${PATH}:/home/matt/android/android-sdk-linux_86/tools

Okay, now Java, Eclipse, and the Android SDK are installed. Now you need to install the Android Development Tools (ADT) for Eclipse.

- Run Eclipse. If you installed Eclipse in ~/android/eclipse then you can cd to that directory and run ./eclipse to start the program.

- Install the Android Development Tools (ADT) for Eclipse. Follow the excellent instructions at http://developer.android.com/sdk/eclipse-adt.html to get and install the ADT. Don’t forget the “Window > Preferences” step to tell Eclipse where the Android SDK is, so when you click “Browse…” you might navigate to /home/matt/android/android-sdk-linux_86 for example.

- Next, I installed a bunch of packages. In Eclipse, click “Window->Android SDK and AVD Manager.” In the resulting window, on the left-hand side will be an “Available Packages” option. I clicked on that, then clicked the checkbox beside the “repository.xml” package to select all available packages and then clicked “Install Selected.” 12 out of the 14 packages installed for me.

- Now you’re ready to create your first Android program . You’ll discover how to make an Android virtual device (AVD) along the way.

- If you want, you can get custom skins, e.g. a Nexus One skin for Android. You can unpack the .zip file in <your-sdk-directory>/platforms/android-x.y/skins/nexusone for example. Then create a new Android virtual device (AVD) and select the Nexus One as the skin.

- If you want to run your Android program on your own Android device, you’re pretty close. Follow step 10 of this walkthrough. When you’re done and the phone is disconnected from your Ubuntu machine, you’ll still have the executable, called an “android package” or .apk file on your phone. So you can show your friends your “Hello, World!” program. :)

Some resources that I found helpful (other than the official Android developer site) are below:
- http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html
- http://www.softwarepassion.com/setting-up-android-development-platform-on-ubuntu-linux-904/
- http://www.howtoforge.com/installing-google-android-sdk1.0-on-ubuntu8.04-desktop
- http://androidforums.com/developer-101/2321-installing-eclipse-android-sdk-ubuntu-8-04-8-10-a.html
- You might also want to watch this O’Reilly video or some of the official videos.

If you found this post at all interesting, you might also be interested in Google I/O too. Google I/O happens on May 19-20, 2010 in San Francisco.

{ 18 comments }