Techniquecore
Cost aggregation
Also called support aggregation.
Replace each matching cost by a weighted sum of the costs at the same disparity over a support region, a box, an adaptive window or a tree, before choosing disparities.
Cost aggregation replaces each entry of the cost volume by a weighted sum of the costs of other pixels at the same disparity, , so that the cost of a pixel uses the evidence of its support region and not of the pixel alone. It is the second step of stereo matching in the taxonomy of Scharstein and Szeliski (2002). Each disparity slice is filtered on its own, so aggregation is image filtering applied times: a box filter in block matching, a bilateral weight in adaptive support weights, the guided filter in Hosni et al. (2013), or a filter on a tree in Yang (2012). The methods differ in the weights and in their cost per entry.
In plain words
The cost of one pixel is a weak guess: noise, flat areas and repeated patterns make many disparities look equally good. Neighbors that lie on the same surface have the same disparity, so their costs at that disparity should be low too. Aggregation adds up the costs of the neighbors at each disparity, and the true disparity, where the whole surface agrees, wins more clearly. The hard part is to choose which neighbors to trust. A plain square trusts all of them, including pixels on another surface; better methods trust neighbors of similar color, or neighbors connected to the pixel without crossing an edge.
When it applies
- The method chooses disparities from the costs, by winner-takes-all or by an optimizer, and the pixel costs are noisy or ambiguous.
- The scene is mostly made of surfaces that are smooth in depth, so that a pixel and most of its support have nearly the same disparity. This is an assumption about the scene; it fails at depth edges and on thin structures.
- The weight does not depend on , or depends on it only through the right image, so that each slice can be filtered as an image. The weight must be the same for all disparities of a pixel, or the aggregated costs of different disparities are not comparable.
The template
AGGREGATE(C, w)- 1
for d ← 0 to D - 1 do - 2
A ← SLICE(C, d) ▷ an H × W image of costs - 3
A ← FILTER(A, w) ▷ the hole: box, Gaussian, bilateral, guided, tree - 4
SET-SLICE(C, d, A) - 5
return C
The hole is the filter of line L3, with the weight that it applies. Two questions decide it. First, which pixels may support : a fixed window, a window that adapts its shape, or every pixel of the image with a weight that decays along a path. Second, the cost: a filter whose weights depend only on can use running sums or an integral image and costs per entry, while weights that depend on the image need either a fast edge-aware filter or work per entry. A normalized form divides by ; it does not change winner-takes-all when this sum does not depend on , but it does when invalid entries near the border are left out.
Classic examples
- Box window. Block matching sums the costs over a square, in time with an integral image or a box blur. It blurs depth edges: a near object looks larger by up to the radius of the window.
- Gaussian and shiftable windows. Scharstein and Szeliski (2002) compared Gaussian weights and shiftable windows, which take the best of the windows that contain the pixel, computed by a box filter followed by a min filter.
- Cross-based support. Zhang, Lu and Lafruit (2009) grow, for each pixel, arms along the row and the column while the color stays close, and sum over the cross-shaped region with integral images of rows and columns. The region follows edges and the cost stays per entry.
- Adaptive support weights. Adaptive support weights weight each pixel of a large window by its color similarity and distance to the center in both images, a joint bilateral filter of each slice, at per entry.
- Guided filter. Hosni et al. (2013) filter each slice with the guided filter, guided by the left image. It is edge-aware and uses box sums only, so the whole step costs for any radius.
- Tree filter. Yang (2012) builds a minimum spanning tree of the 4-connected pixel grid with edge weights , and sets , where is the sum of the edge weights on the tree path. Every pixel supports every other one, and two passes over the tree compute all sums in per slice.
- Paths of semi-global matching. Semi-global matching sums, over 8 or 16 directions, costs that are minimized along 1D paths with a smoothness penalty. Hirschmüller calls this an aggregation, but it is a minimization, not a weighted sum.
A tree example. Take a row of four pixels with intensities , the costs at one disparity, and . On a row the tree is the row itself, and the edge weights give of , and between neighbors. The aggregated costs are . For pixel 1 that is plus less than from the other side of the edge between 12 and 90. A box of three pixels gives at pixel 1 and mixes the two surfaces. The two pass rule of Yang, from the leaves to the root and from the root down, gives the same four numbers.
Variations
- Symmetric weights. Use the weights of both images, as adaptive support weights do, or of the left image only, which is cheaper and nearly as good in many scenes.
- Multi-scale aggregation. Aggregate at several resolutions and combine the results, so that large flat areas get support from far away.
- Iterative diffusion. Repeat a small local average many times, a discrete diffusion of each slice; Scharstein and Szeliski (1998) proposed a nonlinear version that stops where the evidence is strong.
- Learned aggregation. Deep stereo networks process the cost volume with 3D convolutions or learned guided filters, which aggregate across disparities as well as pixels.
Pitfalls
- Weights that depend on in the wrong way. If the sum of weights changes with and the result is not normalized, larger windows at some disparities win for no reason. Normalize, or keep the support the same for all .
- Invalid entries. The first columns of slice have no match. Summing their large invalid values ruins the sums near the left border; leave them out and normalize, or mark the border as invalid.
- Foreground fattening. Any support that crosses a depth edge favors the more textured side, usually the near object. Box windows show this most.
- Color edges that are not depth edges. Edge-aware weights cut the support at texture edges inside a surface, which leaves small, weak supports in highly textured areas.
- Overflow. Sums of integer costs over large windows need wide words; see the bounds on the block matching page.
References
- Daniel Scharstein and Richard Szeliski, A taxonomy and evaluation of dense two-frame stereo correspondence algorithms, International Journal of Computer Vision 47(1-3), 2002, 7-42, the part on aggregation of the matching cost (square windows, shiftable windows, Gaussian weights and diffusion as filters of the disparity space image)
- Asmaa Hosni, Christoph Rhemann, Michael Bleyer, Carsten Rother and Margrit Gelautz, Fast cost-volume filtering for visual correspondence and beyond, IEEE Transactions on Pattern Analysis and Machine Intelligence 35(2), 2013, 504-511, the guided filter applied to each slice of the cost volume, in time independent of the window size
- Kuk-Jin Yoon and In So Kweon, Adaptive support-weight approach for correspondence search, IEEE Transactions on Pattern Analysis and Machine Intelligence 28(4), 2006, 650-656, support weights from color similarity and distance in both windows
- Qingxiong Yang, A non-local cost aggregation method for stereo matching, IEEE Conference on Computer Vision and Pattern Recognition, 2012, aggregation on a minimum spanning tree of the image and the two pass computation in linear time
- Daniel Scharstein and Richard Szeliski, Stereo matching with nonlinear diffusion, International Journal of Computer Vision 28(2), 1998, aggregation by repeated local averaging that stops where the evidence is strong
- Ke Zhang, Jiangbo Lu and Gauthier Lafruit, Cross-based local stereo matching using orthogonal integral images, IEEE Transactions on Circuits and Systems for Video Technology 19(7), 2009, the cross-shaped adaptive support regions and their sums with integral images along rows and columns
Where this leads
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 792P0V Edit this page History Report an error Markdown