A fun project I worked on back in the day involved using Horizon Lines as a localization method in cities and towns that have very distinctive horizon lines. Today, I will briefly outline a procedure my team used for horizon line extraction called Otsu Thresholding.
The procedure for each threshold in the image goes as follows:
- Define Two Classes, Horizon and Landscape
- Minimize intra-class variance (class defined by binarization), 𝝈(t)
- Start with initial histogram for a range of thresholds , p(i)
- Sum over histograms to generate class weights
- Compute weighted average
- Compute variance for each threshold value and compute
- Pick t that minimizes this variance and assign class based on where pixels fall on compared to threshold
Some equations that outline the procedure are shown:
Following this procedure, image filling is done to remove noise in the images. Edge detection is then performed so that horizon points can be connected in pixel space.
The process is shown below:
@originalworks