StereoPoint2 stores a rectified stereo measurement (uL, uR, v): horizontal coordinates in the left and right images plus their shared vertical coordinate.
import gtsam
import numpy as npInitialization¶
Construct from three scalars or a three-vector. Identity() returns the zero measurement.
measurement = gtsam.StereoPoint2(340.0, 315.0, 205.0)
from_vector = gtsam.StereoPoint2(np.array([340.0, 315.0, 205.0]))
print("same measurement:", measurement.equals(from_vector, 1e-12))Components and disparity¶
uL(), uR(), and v() expose the components, while vector() returns them in constructor order. The horizontal disparity uL - uR is inversely related to depth for a rectified stereo pair.
disparity = measurement.uL() - measurement.uR()
print("measurement vector:", measurement.vector())
print("disparity:", disparity)
assert disparity > 0.0Use with StereoCamera¶
StereoCamera.project() produces this type, and StereoCamera.backproject() consumes it. Keeping the shared v coordinate explicit encodes the rectified-image assumption.
The value type does not enforce measurement validity. In normal rectified geometry, positive finite depth produces positive disparity; zero disparity corresponds to a point at infinity, and negative disparity usually indicates a mismatched observation or inconsistent camera convention.
Source¶
AI assistance caveat¶
AI was used to help draft this documentation, and inaccuracies could be present.