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
Basic constructor.
Compute the interaction matrix and the residu vector for the face.
compute the number of point in this instanciation of the tracker that corresponds to the points of the cylinder
Overloaded function.
Overloaded function.
Get the camera parameters of the face.
Get the number of points detected in the last image.
Return a list of features parameters for display.
Get the number of point that was belonging to the face at the initialisation
Return a list of line parameters to display the primitive at a given pose and camera parameters.
Initialise the cylinder to track.
Return if the klt cylinder is used for tracking.
This method removes the outliers.
Set the camera parameters
Set if the klt cylinder has to be considered during tracking phase.
Modification of all the pixels that are in the roi to the value of _nb ( default is 255).
Inherited Methods
Operators
__doc__
Basic constructor.
__module__
Attributes
__annotations__
listIndicesCylinderBBox
useScanLine
- buildFrom(self, p1: visp.core.Point, p2: visp.core.Point, r: float) None ¶
- computeInteractionMatrixAndResidu(self, cMc0: visp.core.HomogeneousMatrix, _R: visp.core.ColVector, _J: 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.core.ColVector¶
the residu vector
- _J: visp.core.Matrix¶
the interaction matrix
- computeNbDetectedCurrent(self, _tracker: 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.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.
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
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.
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.
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.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.core.ImagePoint] ¶
- getCylinder(self) 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.core.HomogeneousMatrix, cam: 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.core.HomogeneousMatrix¶
Pose used to project the 3D model into the image.
- init(self, _tracker: visp.klt.KltOpencv, cMo: 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.klt.KltOpencv¶
ViSP OpenCV KLT Tracker.
- cMo: 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.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).
- setCameraParameters(self, _cam: visp.core.CameraParameters) None ¶
Set the camera parameters
- Parameters:
- _cam: visp.core.CameraParameters¶
the new camera parameters
- setTracked(self, track: bool) None ¶
Set if the klt cylinder has to be considered during tracking phase.
- 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).