Cuboid3d¶
- class Cuboid3d[source]¶
Bases:
supervisely.geometry.geometry.Geometry
This is a class for creating and using Cuboid3d objects for Labels
Methods
allowed_transforms
Clone from GEOMETRYYY
config_from_json
config_to_json
convert
- param rect
Rectangle
- param bitmap
np.ndarray
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.
- param img_size
(rows, cols)
- param img_size
(rows, cols)
The function from_json convert Cuboid3d from json format(dict) to Cuboid3d class object.
Returns 2D boolean mask of the geometry.
Same as geometry_name(), but shorter.
Crops object like "crop" method, but return results with coordinates relative to rect :param rect: :return: list of Geometry
- param in_size
(rows, cols)
Rotates around image center -> New Geometry :param rotator: ImageRotator :return: Geometry
Scales around origin with a given factor.
- rtype
The function to_json convert Cuboid3d class object to json format(dict) :return: Cuboid3d in json format
- param drow
int rows shift
validate
Attributes
- return
float
- clone()¶
Clone from GEOMETRYYY
- crop(rect)¶
- Parameters
- rect
Rectangle
- Returns
list of Geometry
-
draw(bitmap, color, thickness=
1
, config=None
)¶ - Parameters
- bitmap
np.ndarray
- color
[R, G, B]
- thickness
used only in Polyline and Point
- config
drawing config specific to a concrete subclass, e.g. per edge colors
-
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
- img_size
(rows, cols)
- Returns
Geometry
- flipud(img_size)¶
- Parameters
- img_size
(rows, cols)
- Returns
Geometry
- classmethod from_json(data)[source]¶
The function from_json convert Cuboid3d from json format(dict) to Cuboid3d class object. :param data: Cuboid3d in json format(dict) :return: Cuboid3d class object
- 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
- classmethod name()¶
Same as geometry_name(), but shorter. In order to make the code more concise.
- Returns
string with name of geometry
- relative_crop(rect)¶
Crops object like “crop” method, but return results with coordinates relative to rect :param rect: :return: list of Geometry
- resize(in_size, out_size)¶
- Parameters
- in_size
(rows, cols)
- out_size
(128, 256) (128, KEEP_ASPECT_RATIO) (KEEP_ASPECT_RATIO, 256)
- Returns
Geometry
- rotate(rotator)¶
Rotates around image center -> New Geometry :param rotator: ImageRotator :return: Geometry
- scale(factor)¶
Scales around origin with a given factor. :param: factor (float): :return: Geometry
- to_json()[source]¶
The function to_json convert Cuboid3d class object to json format(dict) :return: Cuboid3d in json format
- translate(drow, dcol)¶
- Parameters
- drow
int rows shift
- dcol
int cols shift
- Returns
Geometry
- property area¶
- Returns
float
- property dimensions¶
- property position¶
- property rotation¶