Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Otsu's Method and A Median Filter in Python

I've tried looking around and have been unable to find any implementation of either Otsu's method or a median filter into Python other than OpenCV.These are the only two links of documentation for the OpenCV functions that I've tried.

http://opencv.willowgarage.com/documentation/c/image_filtering.html

http://www.cs.indiana.edu/cgi-pub/oleykin/website/OpenCVHelp/ref/OpenCVRef_Cv.htm#decl_cvThreshold3

I checked this post first but it never really seemed to have a full solution that fits my problem. Machine vision in Python

I'm basically looking to see if anyone knows any other functions that I can implement both Otsu's method and a median filter. I'm just trying to find alternatives before I have to program them into myself, but I would rather not have to reinvent the wheel unless necessary. Thanks for your help in advance, if you need some more specific information just let me know.

like image 209
Doomchinchilla Avatar asked Aug 04 '11 15:08

Doomchinchilla


2 Answers

In response to the Otsu Method I was able to find an image processing packaged called Mahotas that contained it. All I had to do was easy_install it. The documentation can be found here. http://packages.python.org/mahotas/index.html?highlight=otsu#mahotas.otsu

like image 145
Doomchinchilla Avatar answered Oct 19 '22 21:10

Doomchinchilla


I am not sure about Otsu's method but the Scipy library has a whole sub-library dedicated to image processing. For example here is the link to their multi-dimensional median filter:

http://docs.scipy.org/doc/scipy-0.9.0/reference/generated/scipy.ndimage.filters.median_filter.html#scipy.ndimage.filters.median_filter

like image 2
Stu Avatar answered Oct 19 '22 20:10

Stu