MbtDistanceKltPoints

class MbtDistanceKltPoints(self)

Bases: pybind11_object

Implementation of a polygon of the model containing points of interest. It is used by the model-based tracker KLT, and hybrid.

Warning

This class is only available if OpenCV is installed, and used.

Basic constructor.

Methods

__init__

Basic constructor.

computeHomography

Compute the homography using a displacement matrix.

computeInteractionMatrixAndResidu

Compute the interaction matrix and the residu vector for the face.

display

Overloaded function.

displayPrimitive

Overloaded function.

getCameraParameters

Get the camera parameters of the face.

getCurrentNormal

getCurrentNumberPoints

Get the number of points detected in the last image.

getCurrentPoints

getCurrentPointsInd

getFeaturesForDisplay

Return a list of features parameters for display.

getInitialNumberPoint

Get the number of point that was belonging to the face at the initialisation

getModelForDisplay

Return a list of line parameters to display the primitive at a given pose and camera parameters.

hasEnoughPoints

isTracked

Return if the klt points are used for tracking.

removeOutliers

This method removes the outliers.

setCameraParameters

Set the camera parameters

setTracked

Set if the klt points have to considered during tracking phase.

updateMask

Modification of all the pixels that are in the roi to the value of _nb ( default is 255).

Inherited Methods

Operators

__doc__

__init__

Basic constructor.

__module__

Attributes

__annotations__

useScanLine

__init__(self)

Basic constructor.

computeHomography(self, _cTc0: visp._visp.core.HomogeneousMatrix, cHc0: visp._visp.vision.Homography) None

Compute the homography using a displacement matrix.

the homography is given by:

\({}^cH_{c_0} = {}^cR_{c_0} + \frac{{}^cT_{c_0} . {}^tN}{d_0}\)

Several internal variables are computed (dt, cRc0_0n).

Parameters:
_cTc0: visp._visp.core.HomogeneousMatrix

The displacement matrix of the camera between the initial position of the camera and the current camera position

computeInteractionMatrixAndResidu(self, _R: visp._visp.core.ColVector, _J: visp._visp.core.Matrix) None

Compute the interaction matrix and the residu vector for the face. The method assumes that these two objects are properly sized in order to be able to improve the speed with the use of SubCoVector and subMatrix.

Warning

The function preCompute must be called before the this method.

Parameters:
_R: visp._visp.core.ColVector

the residu vector

_J: visp._visp.core.Matrix

the interaction matrix

display(*args, **kwargs)

Overloaded function.

  1. display(self: visp._visp.mbt.MbtDistanceKltPoints, I: visp._visp.core.ImageGray, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, col: visp._visp.core.Color, thickness: int = 1, displayFullModel: bool = false) -> None

  2. display(self: visp._visp.mbt.MbtDistanceKltPoints, I: visp._visp.core.ImageRGBa, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters, col: visp._visp.core.Color, thickness: int = 1, displayFullModel: bool = false) -> None

displayPrimitive(*args, **kwargs)

Overloaded function.

  1. displayPrimitive(self: visp._visp.mbt.MbtDistanceKltPoints, _I: visp._visp.core.ImageGray) -> None

Display the primitives tracked for the face.

Parameters:
_I

The image where to display.

  1. displayPrimitive(self: visp._visp.mbt.MbtDistanceKltPoints, _I: visp._visp.core.ImageRGBa) -> None

Display the primitives tracked for the face.

Parameters:
_I

The image where to display.

getCameraParameters(self) visp._visp.core.CameraParameters

Get the camera parameters of the face.

Returns:

cam : the camera parameters of the face.

getCurrentNormal(self) visp._visp.core.ColVector
getCurrentNumberPoints(self) int

Get the number of points detected in the last image.

Note

See getInitialNumberPoint()

Returns:

the number of points detected in the current image.

getCurrentPoints(self) dict[int, visp._visp.core.ImagePoint]
getCurrentPointsInd(self) dict[int, int]
getFeaturesForDisplay(self) list[list[float]]

Return a list of features parameters for display.

  • Parameters are: <feature id (here 1 for KLT)> , <pt.i()> , <pt.j()> , <klt_id.i()> , <klt_id.j()> , <klt_id.id>

getInitialNumberPoint(self) int

Get the number of point that was belonging to the face at the initialisation

Note

See getCurrentNumberPoints()

Returns:

the number of initial point.

getModelForDisplay(self, cam: visp._visp.core.CameraParameters, displayFullModel: bool = false) list[list[float]]

Return a list of line parameters to display the primitive at a given pose and camera parameters. Parameters are: <primitive id (here 0 for line)>, <pt_start.i()>, <pt_start.j()> <pt_end.i()>, <pt_end.j()>

Parameters:
displayFullModel: bool = false

If true, the line is displayed even if it is not

hasEnoughPoints(self) bool
isTracked(self) bool

Return if the klt points are used for tracking.

Returns:

True if it is used, False otherwise.

removeOutliers(self, weight: visp._visp.core.ColVector, threshold_outlier: float) None

This method removes the outliers. A point is considered as outlier when its associated weight is below a given threshold (threshold_outlier).

Parameters:
threshold_outlier: float

Threshold to specify wether or not a point has to be deleted.

setCameraParameters(self, _cam: visp._visp.core.CameraParameters) None

Set the camera parameters

Parameters:
_cam: visp._visp.core.CameraParameters

the new camera parameters

setTracked(self, track: bool) None

Set if the klt points have to considered during tracking phase.

Parameters:
track: bool

True if they have to be tracked, False otherwise.

updateMask(self: visp._visp.mbt.MbtDistanceKltPoints, mask: cv::Mat, _nb: int, _shiftBorder: int = 0) None

Modification of all the pixels that are in the roi to the value of _nb ( default is 255).

Parameters:
mask

the mask to update (0, not in the object, _nb otherwise).