Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

This is a small repository of some of my experiments with image processing. The algorithms are nothing special and can probably be found in Wikipedia as pseudocode, but it was very interesting for me to implement them and combine them to solve a specific problem for a university assignment.


Histogram normalization

Basically, whenever the levels of gray in an image are clumped close together, it makes sense to spread them throughout the [0, 255] range. This often takes care of excessive brightness or darkness.



Two kinds of blurring are implemented, a simple mean blur and a gaussian blur. The gaussian blur uses a fixed 3x3 kernel.

Info on mean, median and gaussian blurring.

Mean blur with a radius of 3 (5x5 matrix)
Gaussian blur

Edge detection

Two filters for edge detection are implemented, Laplacian and Sobel. The results they give are quite different and can probably be used with varying success on different occasions.

Info on LoG, and on Sobel. The code for the Sobel operator was taken almost as-is from Sau Sheong Chang's blog post about it, so check that out as well.

Laplacian over gaussian


There's not much to explain about the simple thresholding by a given value. A more interesting type of thresholding is the iterative one. Basically, it takes an initial value and tries to threshold the image by that. The average intensity of the foreground and background pixels is then used to perform another threshold, and so on until it converges on a "best" value.

In cases with varying lighting, adaptive thresholding is better. The most popular method for that seems to be Otsu's, but for now, I've implemented a simpler one. Each pixel is thresholded by the mean or by the median of the surrounding pixels.

The Floyd-Steinberg algorithm for error propagation is used as an alternative to the standard thresholding by a fixed value. I've yet to experiment with it and expect to make it a bit more useful.

Info on thresholding in general and on adaptive thresholding. Info on iterative (or automatic) thresholding can be found on wikipedia.

Adaptive thresholding


Some experiments with simple image processing algorithms






No releases published


No packages published