# Disparity-To-Depth Matrix

Used for Stereo Camera.

This matrix used in stereo vision to convert disparity values (the differences in coordinates of similar features within two stereo images) into 3D points.

Resources

$Q= 1000 0100 000−T_{x}1 −c_{xl}−c_{yl}fT_{x}C_{xl}−c_{xr} $

So then you can do $Q[x,y,d,1]=[X,Y,Z,W]$

**Math**: Depends on factors like baseline distance (distance between the two cameras), focal length, and image center coordinates.

Difference with Projection Matrix?

A projection matrix converts from 3D coordinate to 2D coordinate, whereas a reprojection matrix is used for transforming 3D points between the coordinate systems of two cameras into 2D.