An Unsupervised Point Alignment Detection Algorithm

José Lezama, Gregory Randall, Jean-Michel Morel, Rafael Grompone von GioiImage Process. Line 2015 · DOI

Abstract

Detecting linear alignments in 2D point patterns is a fundamental task in computer vision, yet replicating human-like perception remains challenging due to varying local densities and the "masking" effect of distractors. This paper introduces an unsupervised algorithm based on a contrario detection theory. By employing local density estimation and a "Number of False Alarms" (NFA) threshold, the method identifies meaningful alignments without manual parameter tuning. The algorithm effectively handles the masking phenomenon where structures are obscured by noise or competing geometries, maintaining a strictly controlled false positive rate across varying data complexities.

Introduction

Human vision is remarkably adept at spotting order in chaos, such as identifying a straight line of stars in a crowded night sky. However, replicating this in computer vision is difficult due to two main issues: global versus local density variations and the masking phenomenon. Traditional methods often struggle when a line is significant locally but insignificant relative to the entire image's average density. Furthermore, Gestalt psychologists identified that we stop perceiving a structure if it is surrounded by distractors or integrated into a more dominant shape. This paper proposes an algorithm that automatically finds these perceptually relevant alignments while maintaining a controlled rate of false positives, regardless of input complexity.

Methods

The algorithm is built on the a contrario framework, which defines a "meaningful" structure as one that is highly unlikely to occur by pure chance. The process follows several key steps:

  1. Candidate Generation: The algorithm tests rectangles formed by every possible pair of points in the dataset, exploring various widths $W$. For $N$ points, there are $N(N-1)/2$ potential pairs to evaluate.
Candidate rectangle generation using point pairs and varying widths.
  1. Local Density Estimation: Instead of using a global average, the algorithm examines a "window" around each candidate rectangle. It calculates a conservative estimate of local background noise to ensure a line is only validated if it stands out against its immediate neighbors.
  2. Points Regularity: To avoid being fooled by a single dense cluster, the algorithm divides the candidate rectangle into $c$ equal boxes. It counts how many boxes are occupied by at least one point, ensuring the points are spread out along the line.
  3. A Contrario Validation (NFA): It calculates the Number of False Alarms (NFA). If the expected frequency of such a configuration appearing in random noise is less than a threshold $\epsilon$ (typically set to 1), the alignment is accepted.
  4. Redundancy Reduction: If multiple overlapping rectangles are detected, the algorithm keeps only the most "surprising" one (the one with the lowest NFA) and checks if others remain significant after removing the winner's points.

Results and Discussion

The algorithm was evaluated using synthetic 2D point patterns designed to test specific perceptual challenges, such as random Poisson sets, grids, and complex geometric outlines.

Comparison of point patterns: a simple alignment (left), random noise (center), and complex overlapping structures (right).

Key insights from the results include:

  • Parameter-Free Operation: The algorithm requires no manual tuning. The NFA threshold has a clear physical meaning regarding the tolerated rate of false detections.
  • Perceptual Alignment: The method successfully ignores random noise that would trigger false positives in simpler detectors while correctly identifying grids and overlapping lines.
  • Computational Complexity: The algorithm runs in $O(\sqrt{N} N^3)$ time. While computationally heavy, it can process a few thousand points in minutes on standard hardware.

Conclusion

The proposed unsupervised algorithm successfully mimics human perceptual grouping to detect linear alignments in 2D point sets. While currently limited to straight lines and computationally demanding for very large datasets, it provides a mathematically rigorous approach to the masking problem. Future work will involve the interaction between this line detector and other Gestalt detectors (like curve or cluster detectors) to provide a more holistic global interpretation of a scene.

Summary updated

BibTeX
@article{lezama2015unsupervised,
  author = {José Lezama and Gregory Randall and Jean-Michel Morel and Rafael Grompone von Gioi},
  title = {{An Unsupervised Point Alignment Detection Algorithm}},
  journal = {Image Process. Line},
  year = {2015},
  doi = {10.5201/ipol.2015.126},
}
Figure