odometry

package
v0.2.40 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 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,
) (*Motion3D, image.Image, 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:"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.

Directories

Path Synopsis
Package main is a motion estimation via visual odometry tool.
Package main is a motion estimation via visual odometry tool.

Jump to

Keyboard shortcuts

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