Pets, Plants, and Computer Vision
Header image




Here is some of the media from the Ingenuitas booth at the Detroit Maker Faire. I have been going through a bit of a family health emergency so I don’t have time to write everything about the faire that I would like to, suffice it to say we had a blast and my animation station application was a big hit. We got 183 separate animations. Also I have now been to the three big Maker Faires and Detroit is head and shoulders above the rest. I am so proud of the D and the work we are doing at Ingenuitas. The animation station should be available for download next week when we release SimpleCV 1.1 fully.



I’ve been so busy lately that I have had no time to write about all the projects I have been working on. Today I want to take a moment to announce the release of SimpleCV 1.0 by Ingenuitas. SimpleCV is shipped as a super pack that installs SimpleCV and all of the dependencies in a single shot on all of the most common operating systems(OSX, Windows, and Linux). The Ingenuitas team has been working hard to implement most the common image processing tasks one would need to do machine inspection; and to make the process of developing applications that use these operations as quick and painless as possible. This is a big milestone for us as it means we feel that we have a good initial feature set and we can start adding more advanced features to SimpleCV, features you won’t find in OpenCV or on the existing for-pay machine inspection systems. In our next development scrum I plan to roll out a whole host of new features that make it easy to perform image based classification tasks, and to make a first pass at camera calibration and measurement tasks. Our next release will also provide much tighter integration with the Microsoft Kinect. We are also going to work up quite a few really cool demos of SimpleCV for the Detroit Makers Faire and the World Makers Faire in New York City. The video above is a dry run of one of our demos at the Ann Arbor Makers Faire. This demo is shipped with SimpleCV so feel free to download the source code and give it a shot.



I’ve had this idea, that I have been working on for awhile, to make a system that can recognize fasteners (screws, nuts, bolts, nails, washers, etc) on the fly and then measure some of the descriptive statistics of the parts (e.g. length, width, inner and outer diameter etc). Today I finally got a prototype of the recognition system up and running. The system uses a raw threshold of the scene to extract the parts from the scene background and then does some operations to get the parts into a standard form (namely aligned to the major axis) and then extracts some basic statistics like edge length and orientation histograms, and Hu moments. This feature vector then gets piped into a support vector machine to do the recognition. Right now the system runs at about 8FPS at full resolution. The training error on the SVM was about 13% but the training data was really, really, poor and not that large (i.e. 75 samples with about 10% of those being basically misfires from an automatic data extraction module I wrote). I still have a long way to go, as the feature extractor could use some work and the whole data processing pipeline needs to be optimized. Right now there are some fairly costly image rotation operations that can be modified to improve performance. I also need to train the full set of features not just bolts and nuts.

Once the recognition system is working well I hope to use the ALVAR augmented reality library and its fiducials to determine the part dimensions by assuming that the part is effectively planar with the fiducial. The fiducial should also give us a three dimensional location for the recognized part. Right now I am doing this work for the CGUI lab at Columbia. Our end game is to wrap this code up into an augmented reality system for maintenance applications where there may be knowledge shared between a remote subject matter expert and an on-site maintenance technology. Our hope is that a system like this can speed up maintenance tasks by assisting the maintainer in identifying parts and locating them faster. Part of the problem of using AR in this domain is that head mounted displays really don’t have all that great of resolution which reduces your visual acuity and makes it difficult to recognize individual parts.

Beach classifier, I wish I was here.

I have been burning the midnight oil finishing up a project for my Computational Photography course at Columbia University. For this project we had to make two classification systems, one which classified beach and grassland imagery using a given feature vector description, and a second classifier for any two objects using whatever technique we wished to generate the feature vectors. It was suggested that we do our work in Matlab, but we had the option to work in C++. I opted for the latter as I really wanted to write something that I could possible re-use in another project. The final system was developed under Windows using Visual Studio 9, and makes liberal use of OpenCV 2.2 and LibSVM 3.0.

"Misclassification"

The beach / grassland images were classified by dividing the image into a three by three grid and calculating the color average, color standard deviation, and color skew for each of the HSV channels. This feature vector was then used in a support vector machine with a linear kernel. The overall error rate was 13.33%. For the beach images 11.67% were misclassified as grassland, while 15.00% of the grass images were classified as beach. The classification is written in the top, left corner. If the image was misclassified there are two values listed. The red value is the classification, and the green value is true value.

Correctly Classified Grassland

For the second part of the project I wrote a system that classifies images as either screws or nails. The system assumes that both of these objects are aligned to be roughly vertical. I wrote a separate class awhile back that would re-orientate the images based on the major axis of the extracted contour. To do the classification I first thresholded the gray scale image and then extracted the resulting contour. After doing this a few morphological operations were performed on the contour and the Hu-moments and a few other statistics were calculated. I also applied the Canny edge detector to the images and piped the results into a Hough line detector. The results of the line detector were then binned according to length and orientation. This data was used to generate a feature vector which was used for classification via a support vector machine with a linear kernel. The overall error rate was 3.58%. 1.33% of the screw images were misclassified as nails, while 7.27% of the nail images were misclassified as screws. The classification is written in the top, left corner. I used the letter “N” to indicate nails, and the letter “S” to indicate If the image was misclassified there are two values listed. Some results are shown below.

Samples from the screw / nail classifier


The complete set of beaches and grassland images can be found in my beach / grassland classification set on flickr along with the complete set of screw/nail classification results. The code is posted on my computational photography Google code page. The code was written under the gun so it isn’t nearly as clean as I would like it to be, and everything is very data set specific. Hopefully once the semester is over I can go back and refactor it to be a more general solution.



I am on my way back to New York from Michigan and it is time to make it official. I have accepted the position of Director of Research and Development at Ingenuitas in Ann Arbor, Michigan. Ingenuitas will be working though the summer to develop an open source hardware/software product for manufacturing inspection systems. We plan on having a demonstration of our early results in September. I will focus specifically on developing an easy to use computer vision system that brings a number of emerging computer vision techniques to the machine inspection domain. I will also seeking potential investors from the New York technology community. We hope to demonstrate that open source has the potential to dramatically reduce manufacturing costs and empower smaller companies to use techniques and quality control measures that were until recently only available to larger manufacturers. The Ingenuitas team also includes my friends Anothny Oliver and Nate Oostendorp. I am really excited for this team as I think we have the perfect mix of skills and experience to get this venture off the ground. Furthermore I am ecstatic to be working on an open source project that has the potential to dramatically change both computer vision and manufacturing for the better. I will post more thoughts about this project when I get a chance.

I came across this cool interactive feature in the New York Times: RPS Simulator. Basically you play rock, paper, scissors against an algorithm that has learned how to play an optimal game based on prior data. The trick is that humans try to think about the game, versus playing truly randomly. If you play a truly random game you should be able to at least tie the computer. To generate random numbers I moved my mouse around with my eyes closed and guessed my move based on the mouse location. Alternatively you could use the seconds hand on a clock and modulo the number by three.

For my machine learning class this week we have to write this algorithm given a training data set. I will post the code after the homework submission deadline.

My friends Tim and Greg’s startup Backyard Brains just got featured on Boing Boing. I am so happy for them. I am also totally psyched that some of my past research (a) is getting commercialized and (b) is getting commercialized for good not evil. Tim sent me a text message or the early results a couple of days ago. They still have a ways to go, but I so pleased about the results. Tim and Greg really are the guys I wanted to be as a kid, and they are doing some really important work that deserves much more attention.

Cyborg Cockroaches

Early Robo Roach Prototypes sponsored by DARPA

I just happened to have a few of the old specimens from when I made robo roaches for a DARPA project in undergrad (c. 2001). I took a few photos to show you how far the technology has progressed since I worked on it in 2000. Back then we had a simple “backpack” made from a phone jack and a length of microwire. This setup looks positively arcane when compared to Tim’s self-contained remote control. It is worth noting that the cockroaches in my picture are Gromphadorhina portentosa which are slightly larger than the species they are using at Backyard Brains.

Homework Fun

Posted by admin in Columbia | computer vision - (Comments Off)

Face Detector at Work

A good example of face detection in OpenCV 2.2


Here is the first homework from my computational photography course at Columbia. For this homework we had to use a freely available face detector to correctly rotate a set or images that had been rotated either 0, 90, 180, or 270 degrees. For each image we then needed to identify if the image was a photo of a group or of an individual. Finally we were required to use the face detector to extract a smoothed face image from a video. I did my project in C++ using the Haar cascade detectors baked into OpenCV 2.2. For the video portion of the homework I used a Kalman filter to smooth the detected face location and determine a good subimage location when the face detector failed to return a result. In the still images there are multiple colored boxes around each face. These boxes correspond to the different detector packages. The results were not as good as I would have liked. The detectors I used are based on Haar like features and I think some of the symmetry of the faces was preserved in the rotations causing the detectors to misfire. More example images can be found on the flickr set for this project. The video results are below. I put the code up on Google code. The source needs a bit of refactoring but I will be hacking on it all semester so it should get cleaned up.






Posted by admin in cute | domestic life | vermin - (1 Comments)

I let the rats play in an old printer box and I left the styrofoam inside. Static cling is a harsh harsh mistress. The cute photos are almost worth the mess.


What? I aint doing nuthin’.

This is what happens when you let rats play with styrofoam


What is this white stuff stuck to me?

Fruit Bat the Rat with Static Cling



Well, at least I get a treat. OM NOM NOM NOM NOM


Static Charge Rat