Polygon3D¶
- class Polygon3D(*args, **kwargs)¶
Bases:
pybind11_object
Implements a 3D polygon with render functionalities like clipping.
Overloaded function.
__init__(self: visp._visp.core.Polygon3D) -> None
Basic constructor.
__init__(self: visp._visp.core.Polygon3D, mbtp: visp._visp.core.Polygon3D) -> None
Methods
Overloaded function.
Add a corner point to the list of polygon's corners.
Project the 3D corner points into the image thanks to the pose of the camera.
Compute the region of interest in the image according to the used clipping.
Static method to compute the clipped points from a set of initial points.
Get the clipping used.
Get the far distance for clipping.
- return:
A tuple containing:
Static method to check the number of points of a region defined by the vector of image point that are inside the image.
Return the number of corners at the previous computation.
Return the number of corners.
Get the near distance for clipping.
Get a reference to a corner.
Get the 3D clipped points.
Get the 3D clipped points and their clipping information.
Overloaded function.
Overloaded function.
Static method to check whether the region defined by the vector of image point is contained entirely in the image.
Specify which clipping to use.
Set the far distance for clipping.
Set the number of points which are the corners of the polygon.
Set the near distance for clipping.
Inherited Methods
Operators
__doc__
Overloaded function.
__module__
Attributes
ALL_CLIPPING
DOWN_CLIPPING
FAR_CLIPPING
FOV_CLIPPING
LEFT_CLIPPING
NEAR_CLIPPING
NO_CLIPPING
RIGHT_CLIPPING
UP_CLIPPING
__annotations__
clippingFlag
distFarClip
distNearClip
nbCornersInsidePrev
nbpt
polyClipped
- class Polygon3DClippingType(self, value: int)¶
Bases:
pybind11_object
Values:
NO_CLIPPING
NEAR_CLIPPING
FAR_CLIPPING
LEFT_CLIPPING
RIGHT_CLIPPING
UP_CLIPPING
DOWN_CLIPPING
FOV_CLIPPING
ALL_CLIPPING
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.core.Polygon3D) -> None
Basic constructor.
__init__(self: visp._visp.core.Polygon3D, mbtp: visp._visp.core.Polygon3D) -> None
- addPoint(self, n: int, P: visp._visp.core.Point) None ¶
Add a corner point to the list of polygon’s corners.
- Parameters:
- n: int¶
The index of the corner.
- P: visp._visp.core.Point¶
The point to add.
- changeFrame(self, cMo: visp._visp.core.HomogeneousMatrix) None ¶
Project the 3D corner points into the image thanks to the pose of the camera.
- Parameters:
- cMo: visp._visp.core.HomogeneousMatrix¶
The pose of the camera.
- computePolygonClipped(self, cam: visp._visp.core.CameraParameters = vpCameraParameters()) None ¶
Compute the region of interest in the image according to the used clipping.
Warning
If the FOV clipping is used, camera normals have to be precomputed.
- Parameters:
- cam: visp._visp.core.CameraParameters = vpCameraParameters()¶
camera parameters used to compute the field of view.
- static getClippedPolygon(ptIn: list[visp._visp.core.Point], cMo: visp._visp.core.HomogeneousMatrix, clippingFlags: int, cam: visp._visp.core.CameraParameters = vpCameraParameters(), znear: float = 0.001, zfar: float = 100) list[visp._visp.core.Point] ¶
Static method to compute the clipped points from a set of initial points.
Warning
When using FOV clipping and personnal camera parameters, camera normals have to be computed before (see vpCameraParameters::computeFov() )
- Parameters:
- ptIn: list[visp._visp.core.Point]¶
Input points
- cMo: visp._visp.core.HomogeneousMatrix¶
Pose considered for the clipping.
- clippingFlags: int¶
Clipping flag (see vpPolygon3D::vpPolygon3DClippingType ).
- cam: visp._visp.core.CameraParameters = vpCameraParameters()¶
Camera parameters (Only used if clipping flags contain FOV clipping).
- znear: float = 0.001¶
Near clipping distance value (Only used if clipping flags contain Near clipping).
- zfar: float = 100¶
Far clipping distance value (Only used if clipping flags contain Far clipping).
- Returns:
A tuple containing:
ptOut: Output points (result of the clipping).
- getFarClippingDistance(self) float ¶
Get the far distance for clipping.
- Returns:
Far clipping value.
- static getMinMaxRoi(roi: list[visp._visp.core.ImagePoint]) tuple[int, int, int, int] ¶
- Returns:
A tuple containing:
i_min
i_max
j_min
j_max
- getNbCornerInsideImage(self, I: visp._visp.core.ImageGray, cam: visp._visp.core.CameraParameters) int ¶
Static method to check the number of points of a region defined by the vector of image point that are inside the image.
- Parameters:
- I: visp._visp.core.ImageGray¶
The image used for its size.
- cam: visp._visp.core.CameraParameters¶
The camera parameters.
- getNbCornerInsidePrevImage(self) int ¶
Return the number of corners at the previous computation.
- Returns:
number of corner of the face at the previous computation
- getNearClippingDistance(self) float ¶
Get the near distance for clipping.
- Returns:
Near clipping value.
- getPoint(self, _index: int) visp._visp.core.Point ¶
Get a reference to a corner.
- getPolygonClipped(self) list[visp._visp.core.Point] ¶
Get the 3D clipped points.
Warning
Suppose that changeFrame() and computePolygonClipped() have already been called.
- Returns:
A tuple containing:
poly: resulting points.
- getPolygonClippedWithInfo(self) list[tuple[visp._visp.core.Point, int]] ¶
Get the 3D clipped points and their clipping information.
Warning
Suppose that changeFrame() and computePolygonClipped() have already been called.
- Returns:
A tuple containing:
poly: resulting points plus clipping information.
- getRoi(*args, **kwargs)¶
Overloaded function.
getRoi(self: visp._visp.core.Polygon3D, cam: visp._visp.core.CameraParameters) -> list[visp._visp.core.ImagePoint]
Get the region of interest in the image.
- Parameters:
- cam
camera parameters.
- Returns:
Image point corresponding to the region of interest.
getRoi(self: visp._visp.core.Polygon3D, cam: visp._visp.core.CameraParameters, cMo: visp._visp.core.HomogeneousMatrix) -> list[visp._visp.core.ImagePoint]
Get the region of interest in the image.
- Parameters:
- cam
camera parameters.
- cMo
pose.
- Returns:
Image point corresponding to the region of interest.
- getRoiClipped(*args, **kwargs)¶
Overloaded function.
getRoiClipped(self: visp._visp.core.Polygon3D, cam: visp._visp.core.CameraParameters) -> list[visp._visp.core.ImagePoint]
Get the region of interest clipped in the image.
Warning
Suppose that changeFrame() and computePolygonClipped() have already been called.
- Parameters:
- cam
camera parameters.
- Returns:
A tuple containing:
roi: image point corresponding to the region of interest.
getRoiClipped(self: visp._visp.core.Polygon3D, cam: visp._visp.core.CameraParameters, cMo: visp._visp.core.HomogeneousMatrix) -> list[visp._visp.core.ImagePoint]
Get the region of interest clipped in the image.
- Parameters:
- cam
camera parameters.
- cMo
pose.
- Returns:
A tuple containing:
roi: image point corresponding to the region of interest.
getRoiClipped(self: visp._visp.core.Polygon3D, cam: visp._visp.core.CameraParameters) -> list[tuple[visp._visp.core.ImagePoint, int]]
Get the region of interest clipped in the image and the information to know if it’s a clipped point.
Warning
Suppose that changeFrame() and computePolygonClipped() have already been called.
- Parameters:
- cam
camera parameters.
- Returns:
A tuple containing:
roi: image point corresponding to the region of interest with clipping information.
getRoiClipped(self: visp._visp.core.Polygon3D, cam: visp._visp.core.CameraParameters, cMo: visp._visp.core.HomogeneousMatrix) -> list[tuple[visp._visp.core.ImagePoint, int]]
Get the region of interest clipped in the image and the information to know if it’s a clipped point.
- Parameters:
- cam
camera parameters.
- cMo
pose.
- Returns:
A tuple containing:
roi: image point corresponding to the region of interest with clipping information.
- static roiInsideImage(I: visp._visp.core.ImageGray, corners: list[visp._visp.core.ImagePoint]) bool ¶
Static method to check whether the region defined by the vector of image point is contained entirely in the image.
- Parameters:
- I: visp._visp.core.ImageGray¶
The image used for its size.
- corners: list[visp._visp.core.ImagePoint]¶
The vector of points defining a region