MbtDistanceLine

class MbtDistanceLine(self)

Bases: pybind11_object

Manage the line of a polygon used in the model-based tracker.

Basic constructor

Methods

__init__

Basic constructor

addPolygon

Add a polygon to the list of polygons the line belongs to.

buildFrom

Build a vpMbtDistanceLine thanks to two points corresponding to the extremities.

closeToImageBorder

Test wether the line is close to the border of the image (at a given threshold)

computeInteractionMatrixError

Compute the interaction matrix and the error vector corresponding to the line.

display

Overloaded function.

displayMovingEdges

Overloaded function.

getCameraParameters

Get the camera parameters.

getFeaturesForDisplay

Return a list of features parameters for display.

getIndex

Get the index of the line.

getMeanWeight

Get the mean weight of the line.

getModelForDisplay

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

getName

Get the name of the line.

getPolygon

Get the polygon associated to the line.

initInteractionMatrixError

Initialize the size of the interaction matrix and the error vector.

isTracked

Return if the line is used for tracking.

isVisible

Check if the line is visible in the image or not.

setCameraParameters

Set the camera parameters.

setIndex

Set the index of the line.

setMeanWeight

Set the mean weight of the line.

setName

Overloaded function.

setTracked

Set if the line has to considered during tracking phase.

setVisible

Set a boolean parameter to indicates if the line is visible in the image or not.

trackMovingEdge

Track the moving edges in the image.

updateMovingEdge

Update the moving edges internal parameters.

updateTracked

Update the boolean specifying if the line has to be tracked.

Inherited Methods

Operators

__doc__

__init__

Basic constructor

__module__

Attributes

L

Lindex_polygon

Lindex_polygon_tracked

Reinit

__annotations__

eline

error

isvisible

nbFeature

nbFeatureTotal

useScanLine

__init__(self)

Basic constructor

addPolygon(self, index: int) None

Add a polygon to the list of polygons the line belongs to.

buildFrom(self, _p1: visp._visp.core.Point, _p2: visp._visp.core.Point, rand_gen: visp._visp.core.UniRand) None

Build a vpMbtDistanceLine thanks to two points corresponding to the extremities.

Parameters:
_p1: visp._visp.core.Point

The first extremity.

_p2: visp._visp.core.Point

The second extremity.

rand_gen: visp._visp.core.UniRand

Random number generator.

closeToImageBorder(self, I: visp._visp.core.ImageGray, threshold: int) bool

Test wether the line is close to the border of the image (at a given threshold)

Parameters:
I: visp._visp.core.ImageGray

the input image (to know its size)

threshold: int

the threshold in pixel

Returns:

true if the line is near the border of the image

computeInteractionMatrixError(self, cMo: visp._visp.core.HomogeneousMatrix) None

Compute the interaction matrix and the error vector corresponding to the line.

display(*args, **kwargs)

Overloaded function.

  1. display(self: visp._visp.mbt.MbtDistanceLine, 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 the line. The 3D line is projected into the image.

Parameters:
I

The image.

cMo

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

col

The desired color.

thickness

The thickness of the line.

displayFullModel

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

  1. display(self: visp._visp.mbt.MbtDistanceLine, 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

Display the line. The 3D line is projected into the image.

Parameters:
I

The image.

cMo

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

col

The desired color.

thickness

The thickness of the line.

displayFullModel

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

displayMovingEdges(*args, **kwargs)

Overloaded function.

  1. displayMovingEdges(self: visp._visp.mbt.MbtDistanceLine, I: visp._visp.core.ImageGray) -> None

Enable to display the points along the line with a color corresponding to their state.

  • If green : The vpMeSite is a good point.

  • If blue : The point is removed because of the vpMeSite tracking phase (contrast problem).

  • If purple : The point is removed because of the vpMeSite tracking phase (threshold problem).

  • If blue : The point is removed because of the robust method in the virtual visual servoing.

Parameters:
I

The image.

  1. displayMovingEdges(self: visp._visp.mbt.MbtDistanceLine, I: visp._visp.core.ImageRGBa) -> None

getCameraParameters(self, camera: visp._visp.core.CameraParameters) None

Get the camera parameters.

Parameters:
camera: visp._visp.core.CameraParameters

The vpCameraParameters used to store the camera parameters.

getFeaturesForDisplay(self) list[list[float]]

Return a list of features parameters for display.

  • Parameters are: <feature id (here 0 for ME)> , <pt.i()> , <pt.j()> , <state>

getIndex(self) int

Get the index of the line.

Returns:

Return the index of the line.

getMeanWeight(self) float

Get the mean weight of the line. The mean weight is computed thanks to the weight of each moving edge. Those weights are computed by the robust estimation method used during the virtual visual servoing.

Returns:

The mean weight of the line.

getModelForDisplay(self, width: int, height: int, cMo: visp._visp.core.HomogeneousMatrix, 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:
width: int

Image width.

height: int

Image height.

cMo: visp._visp.core.HomogeneousMatrix

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

displayFullModel: bool = false

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

getName(self) str

Get the name of the line.

Returns:

Return the name of the line

getPolygon(self) visp._visp.mbt.MbtPolygon

Get the polygon associated to the line.

Returns:

poly.

initInteractionMatrixError(self) None

Initialize the size of the interaction matrix and the error vector.

isTracked(self) bool

Return if the line is used for tracking.

Returns:

True if it is used, False otherwise.

isVisible(self) bool

Check if the line is visible in the image or not.

Returns:

Return true if the line is visible

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

Set the camera parameters.

Parameters:
camera: visp._visp.core.CameraParameters

The camera parameters.

setIndex(self, i: int) None

Set the index of the line.

Parameters:
i: int

The index number

setMeanWeight(self, w_mean: float) None

Set the mean weight of the line.

Parameters:
w_mean: float

The mean weight of the line.

setName(*args, **kwargs)

Overloaded function.

  1. setName(self: visp._visp.mbt.MbtDistanceLine, line_name: str) -> None

Set the name of the line.

Parameters:
line_name

The name of the line.

  1. setName(self: visp._visp.mbt.MbtDistanceLine, line_name: str) -> None

Set the name of the line.

Parameters:
line_name

The name of the line.

setTracked(self, name: str, track: bool) None

Set if the line has to considered during tracking phase. The line will not be taken into account if all its polygons are disabled.

Parameters:
track: bool

True if the polygon has to be tracked, False otherwise.

setVisible(self, _isvisible: bool) None

Set a boolean parameter to indicates if the line is visible in the image or not.

Parameters:
_isvisible: bool

Set to true if the line is visible

trackMovingEdge(self, I: visp._visp.core.ImageGray) None

Track the moving edges in the image.

Parameters:
I: visp._visp.core.ImageGray

the image.

updateMovingEdge(self, I: visp._visp.core.ImageGray, cMo: visp._visp.core.HomogeneousMatrix) None

Update the moving edges internal parameters.

Parameters:
I: visp._visp.core.ImageGray

the image.

cMo: visp._visp.core.HomogeneousMatrix

The pose of the camera.

updateTracked(self) None

Update the boolean specifying if the line has to be tracked. It takes into account deactivated polygons and the visibility of other polygons.