A stereo camera does not measure distance simply by having two lenses. It measures the difference between two views, then uses the geometry of the camera pair to turn that difference into distance.

HITNet is an interesting approach to the matching part of that process. It combines multi-resolution initialization, geometric propagation and warping to infer disparity without constructing the full 3D cost volume used by many stereo systems. The Python demonstration by ibaiGorordo is one route for exploring the model, but the geometry around it remains essential.

A small numerical example

For an ideal rectified stereo pair, corresponding points lie on the same image row. Disparity is their horizontal separation in pixels. In the simplified pinhole model:

Z = f * B / d

Here, Z is depth, f is focal length in pixels, B is the camera baseline in a physical unit, and d is disparity in pixels. Depth comes out in the same physical unit as the baseline.

Take an illustrative pair with a focal length of 800 pixels and a baseline of 0.06 meters. A disparity of 24 pixels gives a depth of 2 meters. A disparity of 12 pixels gives 4 meters. The same camera pair becomes less sensitive to distance differences as objects get farther away, because the disparities become small.

This makes uncertainty concrete. At a disparity of 24 pixels, an error of one pixel moves the estimate by roughly eight centimeters around the two-meter result. At a disparity of 4 pixels, the nominal depth is 12 meters, while disparities of 3 and 5 pixels produce 16 and 9.6 meters. A small image-space error can become a large depth error.

This worked example explains why a depth map should not be judged solely by whether its colors look smooth.

Before the model sees the images

Calibration estimates the cameras' internal geometry and their relationship to each other. Rectification transforms the images so that the correspondence search can follow the assumed arrangement. If the images violate that arrangement, even an excellent matcher receives the wrong problem.

Image resizing must be accounted for too. Resize an image and the focal length expressed in pixels changes. Crop an image and the location of the principal point changes. Feeding resized images to a model while using untouched calibration values can produce a result that looks coherent but has the wrong metric interpretation.

Synchronization matters whenever something moves. If the left image records an object before the right image does, the observed displacement contains both stereo geometry and motion. The matcher cannot necessarily separate them. A person waving near the camera is a much stronger synchronization test than an empty static room.

Where matching becomes uncertain

A blank wall offers few distinctive features. Repeating tiles offer too many similar ones. Reflective surfaces can show different content to each camera. At object boundaries, one camera may see a region that is hidden from the other. These are different sources of ambiguity, and none disappears because the output is dense.

A learned matcher can use context and prior experience to make better predictions in difficult areas. That is useful, but an inferred answer should still be treated according to the application's needs. Filling a background effect and measuring a narrow clearance do not require the same confidence.

For a practical system, I would preserve invalid or low-confidence regions rather than silently turning them into precise distances. A downstream application can choose to ignore a region, request another view or use a conservative behavior. It cannot make that choice if uncertainty has already been hidden.

HITNet interests me because matching efficiency can make stereo more usable in interactive settings. But the model sits inside a geometric instrument. The complete instrument includes camera placement, calibration, timing, image processing and an honest interpretation of the final depth. Improving one part is valuable precisely because the other parts can then be examined more clearly.