odometry

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package odometry implements functions for visual odometry

Index

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

type Motion3D struct {
	Rotation    *mat.Dense
	Translation *mat.Dense
}

Motion3D contains the estimated 3D rotation and translation from 2 frames.

func EstimateMotionFrom2Frames

func EstimateMotionFrom2Frames(img1, img2 *rimage.Image, cfg *MotionEstimationConfig, logger golog.Logger, display bool,
) (*Motion3D, error)

EstimateMotionFrom2Frames estimates the 3D motion of the camera between frame img1 and frame img2.

func NewMotion3DFromRotationTranslation

func NewMotion3DFromRotationTranslation(rotation, translation *mat.Dense) *Motion3D

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:"cam_intrinsics"`
	ScaleEstimatorCfg *ScaleEstimatorConfig              `json:"scale_estimator"`
	CamHeightGround   float64                            `json:"cam_height_ground"`
}

MotionEstimationConfig contains the parameters needed for motion estimation between two video frames.

func LoadMotionEstimationConfig

func LoadMotionEstimationConfig(path string) *MotionEstimationConfig

LoadMotionEstimationConfig loads a motion estimation configuration from a json file.

type ScaleEstimatorConfig

type ScaleEstimatorConfig struct {
	ThresholdNormalAngle float64 `json:"th_normal_angle"`
	ThresholdPlaneInlier float64 `json:"th_plane_inlier"`
}

ScaleEstimatorConfig contains the parameters that are necessary for scale estimation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL