Table of Contents

Class RapidInvoke

Namespace
Emgu.CV.Rapid
Assembly
Emgu.CV.dll

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 ITracker

The 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 ITracker

The tracker

img IInputArray

The video frame

num int

Number of search lines

len int

Search line radius

K IInputArray

Camera matrix

rvec IInputOutputArray

Rotation between mesh and camera. Input values are used as an initial solution.

tvec IInputOutputArray

Translation between mesh and camera. Input values are used as an initial solution.

termcrit MCvTermCriteria

The 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 IInputArray

Correspondence-position per line in line-bundle-space

srcLocations IInputArray

The source image location

pts2d IOutputArray

2d points

pts3d IInputOutputArray

3d points

mask IInputArray

mask 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 IInputOutputArray

the lineBundle

cols IInputArray

column coordinates in the line bundle

colors IInputArray

colors 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 IInputOutputArray

The output image

locations IInputArray

The source locations of a line bundle

color MCvScalar

The 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 IInputOutputArray

The output image

pts2d IInputArray

The 2d points obtained by projectPoints

tris IInputArray

Triangle face connectivity

color MCvScalar

Line color

type LineType

Line type

cullBackface bool

Enable 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 int

Number of control points

len int

Search radius (used to restrict the ROI)

pts3d IInputArray

The 3D points of the mesh

rvec IInputArray

Rotation between mesh and camera

tvec IInputArray

Translation between mesh and camera

K IInputArray

Camera intrinsic

imsize Size

Size of the video frame

tris IInputArray

Triangle face connectivity

ctl2d IOutputArray

The 2D locations of the control points

ctl3d IOutputArray

Matching 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 int

The search radius. The bundle will have 2*len + 1 columns.

ctl2d IInputArray

The search lines will be centered at this points and orthogonal to the contour defined by them. The bundle will have as many rows.

img IInputArray

The image to read the pixel intensities values from

bundle IOutputArray

Line bundle image with size ctl2d.rows() x (2 * len + 1) and the same type as img

srcLocations IOutputArray

The 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 IInputArray

The line bundle

cols IOutputArray

Correspondence-position per line in line-bundle-space

response IOutputArray

The 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 IInputArray

The video frame

num int

Number of search lines

len int

Search line radius

pts3d IInputArray

The 3D points of the mesh

tris IInputArray

Triangle face connectivity

K IInputArray

Camera matrix

rvec IInputOutputArray

Rotation between mesh and camera. Input values are used as an initial solution.

tvec IInputOutputArray

Translation between mesh and camera. Input values are used as an initial solution.

rmsd double

The 2d reprojection difference

Returns

float

Ratio of search lines that could be extracted and matched