Package boofcv.alg.sfm.d3
Class VisOdomMonoPlaneInfinity<T extends ImageBase<T>>
java.lang.Object
boofcv.alg.sfm.d3.VisOdomMonoPlaneInfinity<T>
Estimates camera ego-motion by assuming the camera is viewing a flat plane and that off plane points are at infinity.
These assumptions are often true for robots traveling over flat terrain outdoors. There are no assumptions for
orientation of the camera, e.g. it could be upside down and at an angle relative to the plane.
A point feature tracker is used to extract sparse optical flow from the image sequence. Bad tracks are removed
first through the use of geometric constraints and then through robust estimation techniques which search for
maximum inlier sets. Before a track is discarded it has to be not used for X frames in a row, where X is user
specified. Determination of inliers is done through a user specified threshold in pixels.
Points on the plane are used to estimate translation and rotation, while points at infinity are just used to estimate
rotation. The two rotation estimates are merged together using a weighted vector average. Motion estimation does not
require any off plane points at infinity, but does require points on the plane. All motion estimation is done
internally in 2D, but can be converted into 3D.
It is possible to turn on a more rigid test for off plane points at infinity. If 'strictFar' is set to true then
any points which contains motions that could not be generated by a rotation about the y-axis are discarded. This
appears to be too strict and discard an excessive number of points when vehicle pitch up and down. Pitching motions
will often not affect motion estimates from projected vectors on to the plane.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Additional track information for use in motion estimation -
Constructor Summary
ConstructorDescriptionVisOdomMonoPlaneInfinity
(int thresholdAdd, int thresholdRetire, double thresholdPixelError, ModelMatcher<Se2_F64, PlanePtPixel> planeMotion, PointTracker<T> tracker) Configures motion estimation. -
Method Summary
Modifier and TypeMethodDescriptionReturns the 2D motion estimatelong
Number of frames processedConverts 2D motion estimate into a 3D motion estimateprotected boolean
isRotationFromAxisY
(PointTrack t, Vector3D_F64 pointing) Checks for motion which can't be caused by rotations along the y-axis alone.boolean
static double
maximizeCountInSpread
(double[] data, int size, double maxSpread) Finds the value which has the largest number of points above and below it within the specified spreadboolean
Estimates the motion which the camera undergoes relative to the first frame processed.void
reset()
Resets the algorithm into its initial statevoid
setExtrinsic
(Se3_F64 planeToCamera) Camera the camera's extrinsic parameters.void
setIntrinsic
(CameraPinholeBrown intrinsic) Camera the camera's intrinsic parameters.void
setStrictFar
(boolean strictFar)
-
Constructor Details
-
VisOdomMonoPlaneInfinity
public VisOdomMonoPlaneInfinity(int thresholdAdd, int thresholdRetire, double thresholdPixelError, ModelMatcher<Se2_F64, PlanePtPixel> planeMotion, PointTracker<T> tracker) Configures motion estimation.- Parameters:
thresholdAdd
- New points are spawned when the number of on plane inliers drops below this value.thresholdRetire
- Tracks are dropped when they are not contained in the inlier set for this many frames in a row. Try 2thresholdPixelError
- Threshold used to determine inliers. Try 1.5planeMotion
- Motion estimator for points on planetracker
- Image feature tracker
-
-
Method Details
-
setIntrinsic
Camera the camera's intrinsic parameters. Can be called at any time.- Parameters:
intrinsic
- Intrinsic camera parameters
-
setExtrinsic
Camera the camera's extrinsic parameters. Can be called at any time.- Parameters:
planeToCamera
- Transform from the plane to camera.
-
reset
public void reset()Resets the algorithm into its initial state -
process
Estimates the motion which the camera undergoes relative to the first frame processed.- Parameters:
image
- Most recent camera image.- Returns:
- true if motion was estimated or false if a fault occurred. Should reset after a fault.
-
isRotationFromAxisY
Checks for motion which can't be caused by rotations along the y-axis alone. This is done by adjusting the pointing vector in the plane reference frame such that it has the same y component as when the track was spawned and that the x-z components are normalized to one, to ensure consistent units. That pointing vector is then projected back into the image and a pixel difference computed.- Parameters:
pointing
- Pointing vector of observation in plane reference frame
-
getFrameID
public long getFrameID()Number of frames processed- Returns:
- Number of frames processed
-
getCurrToWorld2D
Returns the 2D motion estimate- Returns:
- Motion estimate from current frame into world frame in 2D
-
getWorldToCurr3D
Converts 2D motion estimate into a 3D motion estimate- Returns:
- from world to current frame.
-
maximizeCountInSpread
public static double maximizeCountInSpread(double[] data, int size, double maxSpread) Finds the value which has the largest number of points above and below it within the specified spread- Parameters:
data
- Input data. Is modified by sortsize
- number of elements in datamaxSpread
- the spread it's going after- Returns:
- best value
-
getTracker
-
isStrictFar
public boolean isStrictFar() -
setStrictFar
public void setStrictFar(boolean strictFar)
-