
Adaptive binarisation and vanishing geometry detection for architectural imagery
Tune thresholds, find horizons, and export ready-to-annotate visuals straight from the command line.
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.
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.