MbtDistanceKltCylinder

class MbtDistanceKltCylinder(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.

buildFrom

computeInteractionMatrixAndResidu

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

computeNbDetectedCurrent

compute the number of point in this instanciation of the tracker that corresponds to the points of the cylinder

display

Overloaded function.

displayPrimitive

Overloaded function.

getCameraParameters

Get the camera parameters of the face.

getCurrentNumberPoints

Get the number of points detected in the last image.

getCurrentPoints

getCurrentPointsInd

getCylinder

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

init

Initialise the cylinder to track.

isTracked

Return if the klt cylinder is used for tracking.

removeOutliers

This method removes the outliers.

setCameraParameters

Set the camera parameters

setTracked

Set if the klt cylinder has to be 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__

listIndicesCylinderBBox

useScanLine

__init__(self)

Basic constructor.

buildFrom(self, p1: visp._visp.core.Point, p2: visp._visp.core.Point, r: float) None
computeInteractionMatrixAndResidu(self, cMc0: visp._visp.core.HomogeneousMatrix, _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

computeNbDetectedCurrent(self, _tracker: visp._visp.klt.KltOpencv) int

compute the number of point in this instanciation of the tracker that corresponds to the points of the cylinder

Parameters:
_tracker: visp._visp.klt.KltOpencv

the KLT tracker

Returns:

the number of points that are tracked in this face and in this instanciation of the tracker

display(*args, **kwargs)

Overloaded function.

  1. display(self: visp._visp.mbt.MbtDistanceKltCylinder, 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.MbtDistanceKltCylinder, 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.MbtDistanceKltCylinder, _I: visp._visp.core.ImageGray) -> None

Display the primitives tracked for the cylinder.

Parameters:
_I

The image where to display.

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

Display the primitives tracked for the cylinder.

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.

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]
getCylinder(self) visp._visp.core.Cylinder
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, cMo: visp._visp.core.HomogeneousMatrix, cam: visp._visp.core.CameraParameters) 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:
cMo: visp._visp.core.HomogeneousMatrix

Pose used to project the 3D model into the image.

hasEnoughPoints(self) bool
init(self, _tracker: visp._visp.klt.KltOpencv, cMo: visp._visp.core.HomogeneousMatrix) None

Initialise the cylinder to track. All the points in the map, representing all the map detected in the image, are parsed in order to extract the id of the points that are indeed in the face.

Parameters:
_tracker: visp._visp.klt.KltOpencv

ViSP OpenCV KLT Tracker.

cMo: visp._visp.core.HomogeneousMatrix

Pose of the object in the camera frame at initialization.

isTracked(self) bool

Return if the klt cylinder is 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 cylinder has to be considered during tracking phase.

Parameters:
track: bool

True if is has to be tracked, False otherwise.

updateMask(self: visp._visp.mbt.MbtDistanceKltCylinder, 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).