Class RapidInvoke
Class that contains entry points for the Rapid module.
public static class RapidInvoke
- Inheritance
-
RapidInvoke
- Inherited Members
Methods
ClearState(ITracker)
Clear the tracker state
public static void ClearState(this ITracker tracker)
Parameters
tracker
ITrackerThe tracker
Compute(ITracker, IInputArray, int, int, IInputArray, IInputOutputArray, IInputOutputArray, MCvTermCriteria)
High level function to execute a rapid iteration
public static float Compute(this ITracker tracker, IInputArray img, int num, int len, IInputArray K, IInputOutputArray rvec, IInputOutputArray tvec, MCvTermCriteria termcrit)
Parameters
tracker
ITrackerThe tracker
img
IInputArrayThe video frame
num
intNumber of search lines
len
intSearch line radius
K
IInputArrayCamera matrix
rvec
IInputOutputArrayRotation between mesh and camera. Input values are used as an initial solution.
tvec
IInputOutputArrayTranslation between mesh and camera. Input values are used as an initial solution.
termcrit
MCvTermCriteriaThe termination criteria. Use 5 iteration and 1.5 eps for default.
Returns
- float
Ratio of search lines that could be extracted and matched
ConvertCorrespondencies(IInputArray, IInputArray, IOutputArray, IInputOutputArray, IInputArray)
Collect corresponding 2d and 3d points based on correspondencies and mask
public static void ConvertCorrespondencies(IInputArray cols, IInputArray srcLocations, IOutputArray pts2d, IInputOutputArray pts3d = null, IInputArray mask = null)
Parameters
cols
IInputArrayCorrespondence-position per line in line-bundle-space
srcLocations
IInputArrayThe source image location
pts2d
IOutputArray2d points
pts3d
IInputOutputArray3d points
mask
IInputArraymask containing non-zero values for the elements to be retained
DrawCorrespondencies(IInputOutputArray, IInputArray, IInputArray)
Debug draw markers of matched correspondences onto a lineBundle
public static void DrawCorrespondencies(IInputOutputArray bundle, IInputArray cols, IInputArray colors = null)
Parameters
bundle
IInputOutputArraythe lineBundle
cols
IInputArraycolumn coordinates in the line bundle
colors
IInputArraycolors for the markers. Defaults to white.
DrawSearchLines(IInputOutputArray, IInputArray, MCvScalar)
Debug draw search lines onto an image
public static void DrawSearchLines(IInputOutputArray img, IInputArray locations, MCvScalar color)
Parameters
img
IInputOutputArrayThe output image
locations
IInputArrayThe source locations of a line bundle
color
MCvScalarThe line color
DrawWireframe(IInputOutputArray, IInputArray, IInputArray, MCvScalar, LineType, bool)
Draw a wireframe of a triangle mesh
public static void DrawWireframe(IInputOutputArray img, IInputArray pts2d, IInputArray tris, MCvScalar color, LineType type = LineType.EightConnected, bool cullBackface = false)
Parameters
img
IInputOutputArrayThe output image
pts2d
IInputArrayThe 2d points obtained by projectPoints
tris
IInputArrayTriangle face connectivity
color
MCvScalarLine color
type
LineTypeLine type
cullBackface
boolEnable back-face culling based on CCW order
ExtractControlPoints(int, int, IInputArray, IInputArray, IInputArray, IInputArray, Size, IInputArray, IOutputArray, IOutputArray)
Extract control points from the projected silhouette of a mesh
public static void ExtractControlPoints(int num, int len, IInputArray pts3d, IInputArray rvec, IInputArray tvec, IInputArray K, Size imsize, IInputArray tris, IOutputArray ctl2d, IOutputArray ctl3d)
Parameters
num
intNumber of control points
len
intSearch radius (used to restrict the ROI)
pts3d
IInputArrayThe 3D points of the mesh
rvec
IInputArrayRotation between mesh and camera
tvec
IInputArrayTranslation between mesh and camera
K
IInputArrayCamera intrinsic
imsize
SizeSize of the video frame
tris
IInputArrayTriangle face connectivity
ctl2d
IOutputArrayThe 2D locations of the control points
ctl3d
IOutputArrayMatching 3D points of the mesh
ExtractLineBundle(int, IInputArray, IInputArray, IOutputArray, IOutputArray)
Extract the line bundle from an image
public static void ExtractLineBundle(int len, IInputArray ctl2d, IInputArray img, IOutputArray bundle, IOutputArray srcLocations)
Parameters
len
intThe search radius. The bundle will have 2*len + 1 columns.
ctl2d
IInputArrayThe search lines will be centered at this points and orthogonal to the contour defined by them. The bundle will have as many rows.
img
IInputArrayThe image to read the pixel intensities values from
bundle
IOutputArrayLine bundle image with size ctl2d.rows() x (2 * len + 1) and the same type as img
srcLocations
IOutputArrayThe source pixel locations of bundle in img as CV_16SC2
FindCorrespondencies(IInputArray, IOutputArray, IOutputArray)
Find corresponding image locations by searching for a maximal sobel edge along the search line (a single row in the bundle)
public static void FindCorrespondencies(IInputArray bundle, IOutputArray cols, IOutputArray response)
Parameters
bundle
IInputArrayThe line bundle
cols
IOutputArrayCorrespondence-position per line in line-bundle-space
response
IOutputArrayThe sobel response for the selected point
Rapid(IInputArray, int, int, IInputArray, IInputArray, IInputArray, IInputOutputArray, IInputOutputArray, ref double)
High level function to execute a single rapid iteration
public static float Rapid(IInputArray img, int num, int len, IInputArray pts3d, IInputArray tris, IInputArray K, IInputOutputArray rvec, IInputOutputArray tvec, ref double rmsd)
Parameters
img
IInputArrayThe video frame
num
intNumber of search lines
len
intSearch line radius
pts3d
IInputArrayThe 3D points of the mesh
tris
IInputArrayTriangle face connectivity
K
IInputArrayCamera matrix
rvec
IInputOutputArrayRotation between mesh and camera. Input values are used as an initial solution.
tvec
IInputOutputArrayTranslation between mesh and camera. Input values are used as an initial solution.
rmsd
doubleThe 2d reprojection difference
Returns
- float
Ratio of search lines that could be extracted and matched