Techniqueadvanced
Recognition by alignment
Also called hypothesize and verify, Huttenlocher-Ullman alignment.
Hypothesize a model pose from a minimal set of model to image matches and verify it by projecting the whole model and counting supporting features.
Recognition by alignment finds a known object in an image and its pose. Choose a minimal set of matches between features of the model and features of the image, just enough to fix the pose. Compute the pose that brings these model features onto the image features. Then project the whole model with this pose and count how many of its other features land on image features of the same kind. A correct pose explains many features, a wrong one explains few. Huttenlocher and Ullman (1990) used three points and a weak perspective camera, and showed that three points fix the pose up to a reflection. The method turns recognition, a search over all matchings, into a search over minimal sets. RANSAC uses the same two steps with random samples.
In plain words
You know what a chair looks like, and you want to find it in a photo. Pick two or three points of the chair and guess which points of the photo they are. The guess tells you where the chair would be, how it is turned and how big it is. Now draw the whole chair there, in thin lines, on the photo. If the lines fall on edges of the photo almost everywhere, the guess was right. If they fall on nothing, try another guess.
Most guesses are wrong, but each one is fast to test, and one good guess is enough.
When it applies
- The object is rigid, or made of rigid parts, and you have a model: 3D points, 2D points, line segments or local features with positions.
- A camera model with few parameters relates the model to the image: a similarity or an affine map in the plane, a weak perspective camera, or a full perspective camera.
- A minimal solver gives the pose from matches: points for a similarity in the plane, for an affine map or for weak perspective, and for a calibrated perspective camera with P3P, which has up to four solutions.
- The image has few enough features, or the features carry enough labels, that the number of minimal sets to try is affordable.
The template
ALIGN(model features M, image features F, k, t_min)- 1
for each set S of k model features do - 2
for each ordered set S' of k image features of compatible kinds do - 3
for each pose T that the minimal solver finds from S to S' do - 4
project every feature of M by T - 5
s ← the number of projected features with a compatible image feature near them - 6
if s ≥ t_min then report T with support s - 7
refine each reported pose on its supporting matches and keep the best ones - 8
return the poses
Lines L1 to L3 make the pose hypotheses, and lines L4 to L6 test them. With model features and image features, the loops make at most hypotheses, times the number of solutions of the solver. That is a counting fact. For , it is . If each test costs with a grid or a k-d tree on the image features, the whole search costs . RANSAC replaces the full loops by random samples and stops when the iteration bound is met.
Example. A planar model has the four corners of the unit square, , , , , and a fifth point that breaks the symmetry. The image contains the model turned by 90 degrees, scaled by 2 and moved by , so , which gives , , , and . The image also has one clutter point . A similarity has 4 degrees of freedom, so . The hypothesis , maps the model difference to : scale 2, angle 90 degrees, translation . It sends all five model points exactly onto image points, so its support is 5. The hypothesis , has scale and angle 135 degrees. It sends to and to , which are not image points, and its support is 2, the two points it was built from. With 10 model pairs and 30 ordered image pairs, the search tries 300 hypotheses.
Classic examples
- Huttenlocher and Ullman (1990). Three model points and three image points fix a weak perspective pose (rotation, scale and translation) up to a reflection. Each pose is tested by transforming the whole model, and edge contours confirm or reject it. They used a small number of distinctive points of the edge contours as features, which keeps small.
- SCERPO (Lowe 1987). Perceptual grouping of line segments (parallel lines, lines that meet at their ends) chooses a few likely matches. The pose under full perspective comes from Newton iterations, and new matches found with the projected model refine it.
- RANSAC (Fischler and Bolles 1981). The same two steps with random minimal samples, applied to the location determination problem, which is camera pose from known 3D points (perspective-n-point).
- SIFT object recognition (Lowe 2004). One SIFT match already gives a similarity. Matches are clustered by pose, and each cluster is tested by an affine fit. This is alignment with and a Hough step to group the hypotheses.
- Spatial verification in retrieval. Spatial verification applies alignment to each of the top images of a search, with one hypothesis per match of two affine regions.
Variations
- Indexing instead of search. Geometric hashing stores, offline, the invariant coordinates of all model features in every basis of model features. At run time one image basis looks up all the matching model bases at once, which removes the loop over model sets.
- Pose clustering. Each minimal match votes for its pose, and peaks of the vote space are the hypotheses, as in the generalized Hough transform.
- Interpretation tree search. Extend a partial matching one feature at a time and prune it with pairwise constraints (distances, angles) before any pose is computed.
- Edge-based testing. Test a pose by the distance from the projected model edges to the image edges, with a distance transform as in chamfer matching, instead of counting points.
Pitfalls
- Combinatorial cost. The number of hypotheses grows as . Without labels on the features (type, scale, orientation, descriptor) to limit compatible matches, the method is slow for large .
- Unstable minimal sets. Model points that are close together, or almost collinear, give poses with large errors far from them. A correct match can then fail the test. Prefer spread out minimal sets, and refine the pose before the final count.
- Several solutions. Weak perspective from three points has two solutions, related by a reflection, and P3P has up to four. Test all of them.
- Support from clutter. In a dense image, a wrong pose finds many image features near its projected features by chance. The threshold must grow with the density of image features, or the test must use orientation and type as well as position.
- Symmetric models. A symmetric model has several correct poses with the same support. That is not an error, but the pose is not unique.
Exercises
- In the example, list the hypotheses that map the model pair to an image pair and have support at least 3. Which property of the fifth model point makes the answer unique?
- Show that is the number of hypotheses of lines L1 and L2, and compute it for , and .
- With a fraction of the image features on the object, and , how many random samples does RANSAC need to find an all-correct sample with probability 0.99? Compare with the full search of exercise 2 for .
- Explain why two points give a similarity in the plane but not an affine map, and why an affine map needs three points that are not on one line.
References
- Daniel P. Huttenlocher and Shimon Ullman, Recognizing solid objects by alignment with an image, International Journal of Computer Vision 5(2), 1990, 195-212, The alignment method: three model points and three image points fix a weak perspective transformation up to a reflection, each such triple gives a pose, and each pose is verified by transforming the whole model and comparing it with the image
- David G. Lowe, Three-dimensional object recognition from single two-dimensional images, Artificial Intelligence 31(3), 1987, 355-395, The SCERPO system: perceptual grouping to choose a few matches, the pose from them, and the verification by projecting the model and matching more features
- Martin A. Fischler and Robert C. Bolles, Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography, Communications of the ACM 24(6), 1981, 381-395, Random minimal samples to hypothesize a model and the count of the consensus set to verify it, applied to the location determination problem
- David G. Lowe, Distinctive image features from scale-invariant keypoints, International Journal of Computer Vision 60(2), 2004, 91-110, Section 7, object recognition: clusters of SIFT matches that agree on a pose, the affine fit and the verification of each cluster
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W3 standard |
|
Tag VCMMH6 Edit this page History Report an error Markdown