You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

技术咨询:Disparity Value的精确单位是像素还是毫米?

Disparity Value Units: Pixels vs. Millimeters

Great question—this is a super common point of confusion when getting started with stereo vision and disparity maps! Let’s break this down clearly:

  • Raw disparity values are always in pixels by default
    When you generate a disparity map using standard algorithms (like OpenCV’s SGBM, BM, or any stereo matching implementation), the numbers you see represent the horizontal pixel offset between corresponding points in the left and right stereo images. For example, a disparity value of 15 means the same 3D point appears 15 pixels to the left in the right image compared to its position in the left image. This is the native output of stereo matching—no conversion needed here.

  • You can convert pixel disparity to real-world units (like millimeters) with calibration data
    To get a physical depth measurement (expressed in millimeters, meters, etc.), you need to use your stereo camera’s calibrated parameters:

    1. The focal length (f) of your camera (can be in pixels, but you’ll need to convert it to millimeters if you want depth in millimeters)
    2. The baseline (B)—the straight-line distance between the two lenses of your stereo camera (measured in millimeters or meters)
    3. Use this standard stereo vision formula to convert disparity d (pixels) to depth Z (real-world units):
      Z = (f * B) / d
      If f and B are both in millimeters, the resulting Z will be in millimeters.
  • Critical reminder
    Disparity maps never output millimeters directly. That conversion step is entirely dependent on your specific camera setup’s calibration data—without it, you can’t translate pixel offsets into real-world 3D measurements.

Quick example: Suppose your camera has a focal length of 10mm, a baseline of 150mm, and a point with a disparity value of 25 pixels. Plugging into the formula: Z = (10 * 150) / 25 = 60mm. That’s the real-world depth of the point in millimeters.

内容的提问来源于stack exchange,提问作者Tony

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:11:40