Point3d¶
-
class Point3d(point, sly_id=
None, class_id=None, labeler_login=None, updated_at=None, created_at=None)[source]¶ Bases:
Geometry3D point (x, y, z) in volume or point cloud space. Immutable.
Point3d is a geometry for a single
Label.Point3dobject is immutable.- Parameters:
- point¶
Vector3d.
- sly_id : int, optional¶
Point3d ID in Supervisely server.
- class_id : int, optional¶
ID of ObjClass to which Point3d belongs.
- labeler_login : str, optional¶
Login of the user who created Point3d.
- updated_at : str, optional¶
Date and Time when Point3d was modified last. Date Format: Year:Month:Day:Hour:Minute:Seconds. Example: ‘2021-01-22T19:37:50.158Z’.
- created_at : str, optional¶
Date and Time when Point3d was created. Date Format is the same as in “updated_at” parameter.
Methods
Returns the allowed transforms for the Geometry.
Clone from GEOMETRYYY
Convert geometry config from json format
Convert geometry config to json format
Convert geometry to another geometry shape.
Crop the geometry with given rectangle.
Draws the figure contour on a given bitmap canvas :param bitmap: np.ndarray :param color: [R, G, B] :param thickness: (int) :param config: drawing config specific to a concrete subclass, e.g. per edge colors.
Converts a JSON object to a Point3d.
Returns the name of the geometry.
Returns 2D boolean mask of the geometry.
Get the name of the geometry.
Crops object like "crop" method, but return results with coordinates relative to rect :param rect: Rectangle for crop.
Rotates around image center -> New Geometry :param rotator: Class for image rotation.
Scales around origin with a given factor.
Converts the Point3d to a JSON object.
Validate geometry.
Attributes
Copy of the x coordinate of the Point3d.
Copy of the y coordinate of the Point3d.
Copy of the z coordinate of the Point3d.
- classmethod allowed_transforms()¶
Returns the allowed transforms for the Geometry.
- classmethod name()¶
Get the name of the geometry.
Same as
geometry_name(), but shorter. In order to make the code more concise.- Returns:
string with name of geometry
- static geometry_name()[source]¶
Returns the name of the geometry.
- Returns:
name of the geometry
- Return type:
- clone()¶
Clone from GEOMETRYYY
-
convert(new_geometry, contour_radius=
0, approx_epsilon=None)¶ Convert geometry to another geometry shape.
-
draw_contour(bitmap, color, thickness=
1, config=None)¶ Draws the figure contour on a given bitmap canvas :param bitmap: np.ndarray :param color: [R, G, B] :param thickness: (int) :param config: drawing config specific to a concrete subclass, e.g. per edge colors
- fliplr(img_size)¶
- Parameters:
- Returns:
Geometry after flip in horizontal.
- Return type:
- Raises:
NotImplementedError – if method is not implemented in subclass
- flipud(img_size)¶
- Parameters:
- Returns:
Geometry after flip in vertical.
- Return type:
- Raises:
NotImplementedError – if method is not implemented in subclass
- get_mask(img_size)¶
Returns 2D boolean mask of the geometry. With shape as img_size (height, width) and filled with True values inside the geometry and False values outside. dtype = np.bool shape = img_size
- relative_crop(rect)¶
Crops object like “crop” method, but return results with coordinates relative to rect :param rect: Rectangle for crop. :type rect:
Rectangle:returns: List of Geometry after relative crop. :rtype: List[Geometry]` :raises NotImplementedError: if method is not implemented in subclass
- resize(in_size, out_size)¶
- Parameters:
- Returns:
Geometry after resize.
- Return type:
- Raises:
NotImplementedError – if method is not implemented in subclass
- rotate(rotator)¶
Rotates around image center -> New Geometry :param rotator: Class for image rotation. :type rotator:
ImageRotator:returns: Geometry after rotation. :rtype:Geometry
- scale(factor)¶
Scales around origin with a given factor. :param: factor: Scale factor. :type factor: float :returns:
Geometry:rtype:Geometry:raises NotImplementedError: if method is not implemented in subclass
- to_bbox()¶
- Returns:
Rectangle from geometry.
- Return type:
- Raises:
NotImplementedError – if method is not implemented in subclass
- to_json()[source]¶
Converts the Point3d to a JSON object.
- Returns:
JSON object
- Return type:
- Returns:
Point3d in json format
- validate(obj_class_shape, settings)¶
Validate geometry.
- Parameters:
- Raises:
ValueError – if geometry validation error
- property area¶
- Returns:
float
- property x¶
Copy of the x coordinate of the Point3d.
- property y¶
Copy of the y coordinate of the Point3d.