Abstract
Shape recognition in cluttered or non-rigid environments remains a significant challenge for computer vision. This paper presents Morphological Shape Context (MSC), a novel descriptor that enhances the traditional Shape Context (SC) framework by integrating mathematical morphology and an a contrario matching strategy. By utilizing "Meaningful Boundaries" extracted via the Fast Level Set Transform (FLST) and employing deterministic arc-length sampling, MSC achieves a semi-local representation that is robust to occlusion, background clutter, and sampling jitter. Experimental results on real-world video sequences, including textureless cartoon environments and logo retrieval tasks, demonstrate that MSC significantly outperforms standard SC in stability and matching accuracy.
Introduction
Traditional shape recognition pipelines typically rely on edge detection, descriptor encoding, and matching. For years, the Shape Context (SC) descriptor was the benchmark for these tasks. However, SC faces three primary limitations: fragility in edge detection (often relying on manually tuned Canny filters), sampling jitter due to random Poisson point selection, and a lack of locality. Because SC encodes the global distribution of all points relative to a reference, any change in the background or the addition of new objects fundamentally alters the descriptors for the entire scene.
To address these issues, we propose Morphological Shape Context (MSC). Our approach shifts from global point clouds to structured, semi-local geometric curves, providing a stable and parameter-free method for matching objects in complex scenes.
Methodology
MSC improves the SC pipeline by replacing its weakest components with more robust alternatives:
From Edges to Meaningful Boundaries
Instead of noisy Canny edges, MSC utilizes the Fast Level Set Transform (FLST) to identify "Meaningful Boundaries" (MB). These are segments of level lines—contours of constant intensity—that exhibit high contrast against their surroundings. This topological approach ensures that shapes are naturally separated, as level lines never intersect.
Refined Detection and Deterministic Sampling
We introduce a mathematical refinement to the MB algorithm to prevent under-detection in high-contrast boundaries that may have localized low-contrast segments. Furthermore, we replace random sampling with a deterministic approach based on arc-length parameterization. This eliminates the "jitter noise" inherent in standard SC, ensuring that the descriptor remains identical across multiple runs on the same image.
A Contrario Matching
Rather than simple nearest-neighbor matching, MSC employs an a contrario framework. This statistical method calculates the Number of False Alarms (NFA), considering a match "meaningful" only if the probability of it occurring by chance in a random scene is extremely low. This provides a mathematically grounded thresholding mechanism that adapts to different databases without manual tuning.
Experimental Evaluation
The efficacy of MSC was tested across three challenging scenarios:
- South Park Sequence: A textureless, contour-heavy environment used to test the stability of MB extraction.
- Non-rigid Motion: A sequence featuring a moving character and a stationary logo to evaluate foreground/background separation and occlusion handling.
- Content-Based Video Retrieval: A search for a specific logo within a 6,000-frame video sequence.
Results and Discussion
The experimental results highlight the superiority of semi-local matching over global methods. In the logo retrieval task, MSC identified 29 correct matches out of 6,000 frames, whereas standard SC found only 3 matches, all of which were false positives. MSC also demonstrated inherent scale robustness, successfully detecting logos reduced to 66% of their original size without explicit multiscale processing.
In non-rigid sequences, MSC correctly maintained matches for background elements even as foreground characters occluded parts of the scene, a task where global descriptors typically fail due to the changing point distribution.
Conclusion and Future Work
Morphological Shape Context provides a robust, semi-local alternative to traditional shape descriptors. By leveraging the topological properties of level lines and the statistical rigor of a contrario matching, it achieves high accuracy in cluttered and dynamic environments. Future research will focus on improving the clustering stage—currently handled by a basic RANSAC implementation—and further exploring the relationship between the MB refinement parameters and human visual perception.
Summary updated