5,350
edits
Line 92: | Line 92: | ||
In 3D (with 2D images rather than 1D scanlines), it is called a 3D cost volume. | In 3D (with 2D images rather than 1D scanlines), it is called a 3D cost volume. | ||
Each slice \(i\) is computed by taking images \(I_1\) and \(I_2\), sliding image \(I_2\) down by \(i\) pixels, and subtracting them to yield | Each slice \(i\) is computed by taking images \(I_1\) and \(I_2\), sliding image \(I_2\) down by \(i\) pixels, and subtracting them to yield | ||
< | <syntaxhighlight lang="python"> | ||
# This is not their actual code. Their actual code is slightly more complicated. | # This is not their actual code. Their actual code is slightly more complicated. | ||
cost_volume[:,:,i] = I_1 - stack(tile(I_2[:1,:], [i,1]), I_2[i:,:], axis=0) | cost_volume[:,:,i] = I_1 - stack(tile(I_2[:1,:], [i,1]), I_2[i:,:], axis=0) | ||
</ | </syntaxhighlight> | ||
They learn the optimal step sizes by applying a 7x1 Conv2D CNN. | They learn the optimal step sizes by applying a 7x1 Conv2D CNN. |