blendify.cameras package

Submodules

blendify.cameras.base module

class blendify.cameras.base.Camera(resolution: ndarray | Tuple[int, int], near: float = 0.1, far: float = 100, tag: str = 'camera', **kwargs)[source]

Bases: Positionable

Base class for PerspectiveCamera and OrthographicCamera, implementing shared functionality

property blender_camera: Object
abstract distance2depth(distmap: ndarray) ndarray[source]

Convert map of camera ray lengths (distmap) to map of distances to image plane (depthmap)

Parameters:

distmap (np.ndarray) – Distance map

Returns:

Depth map

Return type:

np.ndarray

property far: float
get_camera_viewdir()[source]
property near: float
property resolution: ndarray

blendify.cameras.common module

class blendify.cameras.common.OrthographicCamera(ortho_scale: float = 1.0, **kwargs)[source]

Bases: Camera

distance2depth(distmap: ndarray) ndarray[source]

Convert map of camera ray lengths (distmap) to map of distances to image plane (depthmap)

Parameters:

distmap (np.ndarray) – Distance map

Returns:

Depth map

Return type:

np.ndarray

property ortho_scale: float
class blendify.cameras.common.PerspectiveCamera(focal_dist: float | None = None, fov_x: float | None = None, fov_y: float | None = None, center: ndarray | Tuple[float, float] | None = None, **kwargs)[source]

Bases: Camera

property center: ndarray
distance2depth(distmap: ndarray) ndarray[source]

Convert map of camera ray lengths (distmap) to map of distances to image plane (depthmap)

Parameters:

distmap (np.ndarray) – Distance map

Returns:

Depth map

Return type:

np.ndarray

property focal_dist
property fov_x
property fov_y

Module contents