= Disparity map
{title2=$d(u,v)$}
A <disparity map> assigns an estimated <stereo disparity> to image locations having accepted matches in another view. For a horizontally rectified pair, a left-image map can store
$$
d(u,v)=u-u_R(u,v),
$$
where $u_R(u,v)$ is the matching right-image horizontal coordinate. Constructing the map therefore requires <stereo correspondence>, rather than only reading individual <pixel> intensities. OpenCV's tutorial demonstrates block matching and shows how weak texture and spurious matches affect the result.<Depth Map from Stereo Images in the OpenCV-Python tutorials>[Code; disparity image; texture_threshold, speckle and uniqueness filters]{ref}
For matched coordinate origins, <focal length> 800 <pixels> and <camera baseline> 0.12 metres, valid disparities 20 and 40 <pixels> imply depths 4.8 and 2.4 metres. Thus a <disparity map> is not itself a metric <depth map>: its values must be interpreted using the calibrated geometry and representation. Rejected matches need an explicit validity convention. A displayed dark patch can mean an unavailable match rather than an infinitely distant surface, and an encoded invalid value must not be blindly substituted into $Z=fB/d$.
Back to article page