Skip to content

NumPy implementation of "A Threshold Selection Method from Gray-Level Histograms" (1979)

Notifications You must be signed in to change notification settings

oussamachaib/otsu_segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

otsu_segmentation

Python implementation (coded entirely in NumPy) of "A Threshold Selection Method from Gray-Level Histograms" (1979) - Otsu's method for autonomous image segmentation.

The algorithm takes a grayscale image as input, and outputs the grayscale threshold maximizing the interclass variance (or equivalently, minimizing the intraclass variance).

In the Jupyter Notebook, I compare my personal implementation to OpenCV's. Moreover, I show how Otsu's method is nothing but a special case of the k-means clustering algorithm proposed by MacQueen in 1967 (more than 10 years earlier!)

Contents

otsu_segmentation.py: Python implementation of the algorithm.

demo.ipynb: A demonstration and comparison against two state-of-the-art methods.

About

NumPy implementation of "A Threshold Selection Method from Gray-Level Histograms" (1979)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published