Vanishing Points Detection in Images
Computer Vision

Vanishing Points Detection in Images

Adaptive binarisation and vanishing geometry detection for architectural imagery

Tune thresholds, find horizons, and export ready-to-annotate visuals straight from the command line.

Home/Research/Vanishing Points Detection in Images

Project Information

Course
Computer Vision
Authors
Davide Ligari, Andrea Alberti
Date
March 2024
Pages
7
View Code

Technologies

Python 3.9+OpenCVNumPyMatplotlibScipyTkinter

Abstract

Delivered two computer-vision utilities: (1) a histogram-driven binarisation tool with auto/manual tuning and GUI, and (2) a vanishing point detector that chains Canny, probabilistic Hough and RANSAC (500 iterations, 5 px tolerance). The pipeline adapts thresholds from image statistics, overlays the 15 most significant lines, and documents SSIM comparisons against Otsu.

About

The binarisation module minimises a custom loss based on pixel distance from a candidate threshold. Auto mode adjusts loss weights according to histogram mean (tuning to the brighter or darker side), while manual mode lets users bias under/over thresholds. Outputs include plots of the loss curve and SSIM comparisons with Otsu. The vanishing-point tool converts images to grayscale, applies adaptive Canny (median ±0.22), runs probabilistic Hough multiple times keeping the ten longest segments per sweep, removes vertical/parallel lines, then executes RANSAC for 500 iterations to pick the intersection supported by the largest line set within 5 px. Results are exported with the detected vanishing point and top 15 lines overlaid, and can be batch-processed via CLI.

Key Results

500
RANSAC Iterations
5 pixels
Threshold
10 longest per run
Hough Lines

Key Findings

  • Automatic loss-driven thresholding produced cleaner binaries on the Lake, Cars and Lena samples compared with Otsu or manual selection.
  • Across the sample set the auto thresholds yielded SSIM scores below 0.2 versus Otsu, confirming structurally different yet visually sharper outputs.
  • Probabilistic Hough plus RANSAC (500 iterations, 5 px tolerance) consistently identified dominant vanishing points and returned 15-line overlays for each test image.
  • Adaptive Canny thresholds (median ±0.22) enabled batch CLI and GUI workflows to process the dataset without manual retuning.

Methodology

Histogram ThresholdingCanny Edge DetectorProbabilistic Hough TransformRANSACOpenCV
Vanishing Points Detection in Images | Andrea Alberti | Andrea Alberti