Aligning Images

Standard

I recently wrote a program to align images using OpenCV in Python. I drew a rectangle with ten dots on it and took pictures of it at different angles. I used the locations where each of the corresponding dots moved to find a homography between the straight picture and each angled picture. I then warped the angled pictures using this homography to align them.

Here is a link to download the folder with the images and Python code in it as well as an image of the output. Make sure to download the whole folder and run the python code from within that folder.

perspective1output.png

 

 

 

 

 

Chess

Standard

I just finished creating a two player Chess game using Processing and Java where human players take turns at the computer.

To play Chess download the Chess folder from this link

Then download Processing for your operating system from this link

Open the Chess.pde file in the Chess folder you downloaded with Processing

2048 Game

Standard

I recently created a version of the popular online game 2048 using Processing and Java. The objective of the game is to combine two tiles with the same number until you get to the 2048 tile. When two tiles of the same number combine into one tile, the new tile’s number is the sum of both the original tile’s numbers. Pressing the arrow keys on your keyboard combines all the tiles in that direction. Every time an arrow key is pressed a new tile randomly spawns somewhere on the grid. The game ends when there are no tiles that can be combined and the board is full.

Here is a link to download Mac OSX and Windows versions of the game

Route Finder App Part 2

Standard

I finished my Route Finder Android app. It now finds the best driving route through a set of cities using Google Directions API data (I used this instead of the Google Distance Matrix API because it was easier to work with) and Google Maps API as well as an algorithm I wrote. The first city that is entered when the app starts is the city that the route starts and ends at. When a city is entered a marker is added to the map and the optimal route is recalculated to include that city.

The app still lags at times (the button sometimes has to be pressed multiple times to add a city to the map and find the optimal route). So there is still room for improvement, but at least it is in somewhat usable shape.

Here is a video demonstrating the app:

To run the app make sure you have an android device, go to the following link on the device and download the APK file. You will be prompted to install it.

Link to APK file

 

Route Finder App Part 1

Standard

I’m working on an Android app that helps to find the best route through a set of locations using Google Maps APIs and an algorithm I wrote.

So far it has a text field set up where the user can enter a location, it then adds a marker to the map, and adds the address to an array.

The next step will be to use the Google Distance Matrix API to find the distance between the locations so that my algorithm can be used.

To run the app make sure you have an android device, go to the following link on the device and download the APK file. You will be prompted to install it.

Link to APK file

NXT Self Driving Car

Standard

The Project

In this project I am making a self-driving car using Lego Mindstorms NXT and programming it using the Lego Mindstorms NXT programming software.

Video

How To Do It Yourself

Step 1 Build the Car:
To build the car first you need a Lego Mindstorms NXT set. You need to build a car with two motors. The one on the right of the car should be connected to port A on the Mindstorms NXT brick and the one on the left of the car should be connected to port C. The ultrasonic sensor should be at the front of the car and should be connected to port 4 of the NXT Brick.
Here’s a short video explaining it:

Step 2 Write the Program:
The program is written using the NXT Software. In the program I tell the car to keep moving if there isn’t a obstacle in front of it and go backwards and turn in a completely different direction if there is an obstacle in front of it. The car also makes a noise when an obstacle is encountered.

RaspiCam

Standard

The Project

The project is to take photos with a camera connected to my Raspberry Pi and stream live video from the camera via my Raspberry Pi to my iPad.

What is a Raspberry Pi?: http://www.raspberrypi.org/

Progress

 

July 24, 2014:

I finished the entire project today. This project was easy and wasn’t as challenging as the other projects I have done. The hardest part was finding out how to stream the video to my iPad. I researched on the internet and found an app called VLC which allows you to stream video. Then I installed VLC on the Raspberry Pi and typed in a command to stream the camera video. Then I entered the Raspberry Pi’s ip address to view the video on my iPad.

How To Do It Yourself

Step 1: Set up the camera

Step 2: How to take pictures and videos

To take a photo with the Raspberry Pi camera enter the following command into the LXTerminal after pointing the camera at what you want to take a picture of sudo raspistill -o filename.jpg This will save an image into your home directory. To view the image go to the file manager on your Pi and go to the home directory.

To take a video point at what you want to take a video of and enter sudo raspivid -o filename.h264 -t 10000  into the LXTerminal. This will save a video that is ten seconds long into your home directory. To change the duration of the video change the number after “-t” which is the duration of the video in milliseconds.

Step 3 Stream video to your iPad

To stream video first you need to install VLC on both the iPad and the Raspberry Pi. To install VLC on the Raspberry Pi enter
sudo apt-get install vlc  into the LXTerminal and wait for vlc to finish installing. To install VLC on the iPad go to the app store and download VLC.

Now to start streaming live video from the Raspberry Pi camera enter raspivid -o - -t 9999999 |cvlc -vvv stream:///dev/stdin --sout '#standard{access=http,mux=ts,dst=:8554}' :demux=h264 into the LXTerminal.

This will start the video stream. To view the video stream your Raspberry Pi must be connected to the internet with a wifi dongle.

Then you have to find out the ip address of your Raspberry Pi. This can be done by typing “ifconfig” into the LXTerminal.

Then go on VLC on your iPad and click “open network stream” and type in http://IPaddressOfRaspberryPi:8554 as the address. Replace where it says “IPaddressOfRaspberryPi” with your pi’s ip address. Then you should see video on your iPad.