mrpt.img

mrpt-img Python API.

Package Contents

class mrpt.img.CImage

C++ API: class mrpt::img::CImage

CImage(arg0: numpy.ndarray)

as_numpy() → numpy.ndarray

Returns a Zero-Copy NumPy view of the image data.

drawCircle(center: TPixelCoord, radius: int, color: TColor, width: int = 1) → None
static from_numpy(array: numpy.ndarray) → CImage

Create a CImage from a HxWxC numpy uint8 array (zero-copy not used).

getHeight() → int

Image height in pixels

getWidth() → int

Image width in pixels

isColor() → bool

True if the image has 3 channels (RGB)

loadFromFile(filename: str) → bool

Load image from file. Returns True on success.

resize(arg0: int, arg1: int, arg2: Any, arg3: Any) → None
saveToFile(filename: str, jpeg_quality: int = 95) → bool

Save image to file. Returns True on success.

textOut(p: TPixelCoord, str: CImage.textOut.str, color: TColor) → None
class mrpt.img.Color
BLACK: ClassVar[_bindings.TColor]
BLUE: ClassVar[_bindings.TColor]
GREEN: ClassVar[_bindings.TColor]
RED: ClassVar[_bindings.TColor]
WHITE: ClassVar[_bindings.TColor]
class mrpt.img.DistortionModel(value: int)

Members:

none

plumb_bob

kannala_brandt

property name: str
property value: int
kannala_brandt: ClassVar[DistortionModel]
none: ClassVar[DistortionModel]
plumb_bob: ClassVar[DistortionModel]
class mrpt.img.TCamera

C++ API: class mrpt::img::TCamera

cx: float
cy: float
dist: list[float]
distortion: DistortionModel
fx: float
fy: float
ncols: int
nrows: int
intrinsicParams() → list[list[float]]

Return intrinsic matrix as 3x3 list of lists (use np.array() to convert).

class mrpt.img.TColor(r: int, g: int, b: int, alpha: int = 255)

C++ API: struct mrpt::img::TColor

TColor(arg0: list[int])

A: int
B: int
G: int
R: int
class mrpt.img.TColorf

C++ API: struct mrpt::img::TColorf

TColorf(r: float, g: float, b: float, alpha: float = 1.0) TColorf(color: TColor)

A: float
B: float
G: float
R: float
asTColor() → TColor

Converts to a TColor with uint8 components

class mrpt.img.TColormap(value: int)

Members:

cmNONE

cmGRAYSCALE

cmJET

cmHOT

property name: str
property value: int
cmGRAYSCALE: ClassVar[TColormap]
cmHOT: ClassVar[TColormap]
cmJET: ClassVar[TColormap]
cmNONE: ClassVar[TColormap]
class mrpt.img.TPixelCoord(arg0: int, arg1: int)
x: int
y: int
class mrpt.img.TPixelCoordf(arg0: float, arg1: float)
x: float
y: float
class mrpt.img.TStereoCamera

C++ API: class mrpt::img::TStereoCamera

Bases: mrpt.serialization.CSerializable

leftCamera: TCamera
rightCamera: TCamera
rightCameraPose: Any
mrpt.img.colormap(color_map: TColormap, color_index: float) → TColorf

Maps a value in [0,1] to a TColorf using the given colormap