Documentation ¶
Overview ¶
Package odometry implements functions for visual odometry
Index ¶
- func EstimateCameraHeight(pts1, pts2 []r2.Point, pose *transform.CamPose, cfg *ScaleEstimatorConfig, ...) (float64, error)
- func GetPointsOnGroundPlane(pts1, pts2 []r2.Point, pose *transform.CamPose, ...) ([]int, []r3.Vector, error)
- func GetTriangulated3DPointsFrom2DKeypoints(pts1, pts2 []r2.Point, pose *transform.CamPose, ...) ([]r3.Vector, error)
- type Motion3D
- type MotionEstimationConfig
- type ScaleEstimatorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EstimateCameraHeight ¶
func EstimateCameraHeight(pts1, pts2 []r2.Point, pose *transform.CamPose, cfg *ScaleEstimatorConfig, intrinsics *transform.PinholeCameraIntrinsics, ) (float64, error)
EstimateCameraHeight estimates the camera height wrt to ground plane.
func GetPointsOnGroundPlane ¶
func GetPointsOnGroundPlane(pts1, pts2 []r2.Point, pose *transform.CamPose, thresholdNormalAngle, thresholdPlaneInlier float64, intrinsics *transform.PinholeCameraIntrinsics, ) ([]int, []r3.Vector, error)
GetPointsOnGroundPlane gets the ids of matched keypoints that belong to the ground plane.
func GetTriangulated3DPointsFrom2DKeypoints ¶
func GetTriangulated3DPointsFrom2DKeypoints(pts1, pts2 []r2.Point, pose *transform.CamPose, intrinsics *transform.PinholeCameraIntrinsics, ) ([]r3.Vector, error)
GetTriangulated3DPointsFrom2DKeypoints gets the triangulated 3D point cloud from the matched 2D keypoints, the second camera pose and the intrinsic camera matrix.
Types ¶
type Motion3D ¶
Motion3D contains the estimated 3D rotation and translation from 2 frames.
func EstimateMotionFrom2Frames ¶
func EstimateMotionFrom2Frames(img1, img2 *rimage.Image, cfg *MotionEstimationConfig, logger golog.Logger, ) (*Motion3D, image.Image, error)
EstimateMotionFrom2Frames estimates the 3D motion of the camera between frame img1 and frame img2.
func NewMotion3DFromRotationTranslation ¶
NewMotion3DFromRotationTranslation returns a new pointer to Motion3D from a rotation and a translation matrix.
type MotionEstimationConfig ¶
type MotionEstimationConfig struct { KeyPointCfg *keypoints.ORBConfig `json:"kps"` MatchingCfg *keypoints.MatchingConfig `json:"matching"` CamIntrinsics *transform.PinholeCameraIntrinsics `json:"intrinsic_parameters"` ScaleEstimatorCfg *ScaleEstimatorConfig `json:"scale_estimator"` CamHeightGround float64 `json:"cam_height_ground_m"` }
MotionEstimationConfig contains the parameters needed for motion estimation between two video frames.
func LoadMotionEstimationConfig ¶
func LoadMotionEstimationConfig(path string) (*MotionEstimationConfig, error)
LoadMotionEstimationConfig loads a motion estimation configuration from a json file.
type ScaleEstimatorConfig ¶
type ScaleEstimatorConfig struct { ThresholdNormalAngle float64 `json:"th_normal_angle_rads"` ThresholdPlaneInlier float64 `json:"th_plane_inlier"` }
ScaleEstimatorConfig contains the parameters that are necessary for scale estimation.