Brad's Blog

Published: 2009-01-04

Morphology is Fun!

Fun Image Programming morphology vision

Morphological operations are very common in image processing. The two most basic of these are Erosion and Dilations, and from these, additional morphological operations can be performed. While there is an abundance of literature on the topic of morphology, I often like to view concrete examples of the operations. So, I've published a few images that illustrate the output of 1-to-5 iterations of various morphological operations --erosion, dilation, opening, closing, gradient, top hat, and black hat--with various structuring elements--rectangle ...

Published: 2008-05-20


Fun Image Python

Occasionally, I need to crop some images. I suspect this happens to a lot of people, and they simply use their favorite photo editor to perform the task. For a few images, this works just fine. Plenty of people have Photoshop, the Gimp, or even iPhoto. This past weekend, however, I found myself needing to crop about 1000 images, and I need to do it quickly. This was more than my machine could load into the Gimp at once. Even ...

Published: 2007-12-05

Computing Correlation Coefficients in Python

Image Python numpy pil

A useful technique for matching objects in images is to compute the images' Correlation Coefficients. Essentially, you take any image and compute the correlation between it and another, smaller image containing ONLY the object that you want to identify. The resulting correlation image should contain bright spots where there is a high correlation (or match) between the two images. Here's a simple python script to compute the correlation between two images: It requires PIL ...