Archive

Posts Tagged ‘python’

Median Filter and Morphological Dilation in Python

May 1st, 2008 No comments

Python is a very nice programming language. Fast. Simple. Free. I recently spent some time learning it for a class on computer vision. I was using the PIL and numpy packages to make Python feel more like my old friend Matlab.

The two functions that I couldn’t find, and missed the most (especially when writing hack-y code for class projects) were median filtering and morphological dilation. So, in hopes of sparing other the pain of writing them… here they are! The function medfilt_dilate.py has both functions.

medfilt_dilate.py

The medfilt() function uses the PIL filtering code. The dilate() function was written from scratch with NumPy.

Categories: Matlab, Vision Tags: ,

PIL in OSX, The Easy Way

February 5th, 2008 3 comments

After spending about an hour fighting with PIL (Python Imaging Library) and trying to get it to install properly with all of its dependencies I discovered that some wonderful person posted a ready-made pil installer for osx. This worked like a charm. First try. No problems.

God I love it when people do stuff like this. Now, hang on as I learn to do image processing with Python on my mac.