common
to_quaternion
Convert input rotation like array to Quaternion.
Parameters:
-
(xRotationLike) –Rotation matrix or quaternion.
Returns:
-
Quaternion(Quaternion) –Converted instance.
view_points
view_points(
points: NDArrayF64,
intrinsic: CameraIntrinsicLike,
distortion: CameraDistortionLike | None = None,
*,
normalize: bool = True,
) -> NDArrayF64
Project 3d points on a 2d plane. It can be used to implement both perspective and orthographic projections.
It first applies the dot product between the points and the view.
Parameters:
-
(pointsNDArrayF64) –Matrix of points, which is the shape of (3, n) and (x, y, z) is along each column.
-
(intrinsicCameraIntrinsicLike) –nxn camera intrinsic matrix (n <= 4).
-
(distortionCameraDistortionLike | None, default:None) –Camera distortion coefficients, which is the shape of (n,) where n can be 4, 5, 8, 12, or 14.
-
(normalizebool, default:True) –Whether to normalize the remaining coordinate (along the 3rd axis).
Returns:
-
NDArrayF64–Projected points in the shape of (3, n). If
normalize=False, the 3rd coordinate is the height.
is_box_in_image
is_box_in_image(
box: Box3D,
intrinsic: CameraIntrinsicLike,
img_size: tuple[int, int],
visibility: VisibilityLevel = VisibilityLevel.NONE,
) -> bool
Check if a box is visible inside of an image without considering its occlusions.
Parameters:
-
(boxBox3D) –The box to be checked.
-
(intrinsicCameraIntrinsicLike) –3x3 camera intrinsic matrix.
-
(img_sizetuple[int, int]) –Image size in the order of (width, height).
-
(visibilityVisibilityLevel, default:NONE) –Enum member of VisibilityLevel.
Returns:
-
bool–Return True if visibility condition is satisfied.
DBException
sanity_check
sanity_check(
db_root: str | Path,
*,
revision: str | None = None,
include_warning: bool = False,
) -> DBException
Perform sanity check and report exception or warning encountered while loading the dataset.
Parameters:
-
(db_rootstr | Path) –Path to root directory of the dataset.
-
(revisionstr | None, default:None) –Specific version of the dataset. If None, search the latest one.
-
(include_warningbool, default:False) –Indicates whether to report warnings.
Returns:
-
DBException–Exception or warning if exits, otherwise returns None.
us2sec
Convert timestamp from micro seconds [us] to seconds [s].
Parameters:
-
(timestampScalarLike) –Timestamp in [us].
Returns:
-
float–Timestamp in [s].
sec2us
Convert timestamp from seconds [s] to micro seconds [us].
Parameters:
-
(timestampScalarLike) –Timestamp in [s].
Returns:
-
float–Timestamp in [us].