P = Horizontal/Vertical/Diagonal ground pixel size Z = depth accuracy (assuming one pixel accuracy for the disparity)

Accuracy and ground pixel size calculator

Camera Position

As a general consideration, given a camera, the lateral resolution (related to the ground pixel size, or pixel footprint) is inversely proportional to the distance, so the closer the better. However, the closer you are to the object, the more pictures you need to shoot, and the more time will take the processing, so this is a trade-off you should keep in mind. The depth resolution instead depends on more factors and it is more difficult to give a formula for the most general case.

The figure on the left refers to the normal stereo configuration of two cameras, hence they should be taken only as a rough indication. In this simplified configuration, the resolution depends inversely of the square of the distance D and directly on the baseline length B. e., the distance between two consecutive camera stations (the spots were you take the pictures). As for the distance D, the same considerations made for the lateral resolution apply: the closer the better but you need more pictures. As for the baseline length B, the larger the baseline, the higher is the resolution.

Please note however that the baseline is upper bounded by the requirement that images must have a substantial overlap, so there is another trade-off here to be taken into account.

Please refer to your device CCD size (either expressed in width, height, or diagonal) and use the appropriate resolution (width, height,diagonal) depending on the CCD size you are going to use.