ImgFrame
These are all the images (regardless of their encoding/format), as well as the depth/disparity "image". ColorCamera and MonoCamera are the source of the image frame messages.Examples of functionality
Reference
class
depthai.ImgFrame(depthai.Buffer)
class
class
Type
Members: YUV422i YUV444p YUV420p YUV422p YUV400p RGBA8888 RGB161616 RGB888p BGR888p RGB888i BGR888i RGBF16F16F16p BGRF16F16F16p RGBF16F16F16i BGRF16F16F16i GRAY8 GRAYF16 LUT2 LUT4 LUT16 RAW16 RAW14 RAW12 RAW10 RAW8 PACK10 PACK12 YUV444i NV12 NV21 BITSTREAM HDR RAW32 NONE
method
method
method
getBytesPerPixel(self) -> float: float
Retrieves image bytes per pixel
method
getCategory(self) -> int: int
Retrieves image category
method
getColorTemperature(self) -> int: int
Retrieves white-balance color temperature of the light source, in kelvins
method
getCvFrame(self) -> numpy.ndarray: numpy.ndarray
@note This API only available if OpenCV support is enabled Retrieves cv::Mat suitable for use in common opencv functions. ImgFrame is converted to color BGR interleaved or grayscale depending on type. A copy is always made Returns: cv::Mat for use in opencv functions
method
getExposureTime(self) -> datetime.timedelta: datetime.timedelta
Retrieves exposure time
method
getFrame(self) -> numpy.ndarray: numpy.ndarray
@note This API only available if OpenCV support is enabled Retrieves data as cv::Mat with specified width, height and type Parameter ``copy``: If false only a reference to data is made, otherwise a copy Returns: cv::Mat with corresponding to ImgFrame parameters
method
getHeight(self) -> int: int
Retrieves image height in pixels
method
getInstanceNum(self) -> int: int
Retrieves instance number
method
getLensPosition(self) -> int: int
Retrieves lens position, range 0..255. Returns -1 if not available
method
getLensPositionRaw(self) -> float: float
Retrieves lens position, range 0.0f..1.0f. Returns -1 if not available
method
getPlaneHeight(self) -> int: int
Retrieves image plane height in lines
method
getPlaneStride(self, arg0: int) -> int: int
Retrieves image plane stride (offset to next plane) in bytes Parameter ``current``: plane index, 0 or 1
method
getSensitivity(self) -> int: int
Retrieves sensitivity, as an ISO value
method
getSequenceNum(self) -> int: int
Retrieves image sequence number
method
getSourceDFov(self) -> float: float
@note Fov API works correctly only on rectilinear frames Get the source diagonal field of view in degrees Returns: field of view in degrees
method
getSourceHFov(self) -> float: float
@note Fov API works correctly only on rectilinear frames Get the source horizontal field of view Parameter ``degrees``: field of view in degrees
method
getSourceHeight(self) -> int: int
Retrieves source image height in pixels
method
getSourceVFov(self) -> float: float
@note Fov API works correctly only on rectilinear frames Get the source vertical field of view Parameter ``degrees``: field of view in degrees
method
getSourceWidth(self) -> int: int
Retrieves source image width in pixels
method
getStride(self) -> int: int
Retrieves image line stride in bytes
method
method
method
method
getType(self) -> ImgFrame.Type: ImgFrame.Type
Retrieves image type
method
getWidth(self) -> int: int
Retrieves image width in pixels
method
setCategory(self, category: int) -> ImgFrame: ImgFrame
Parameter ``category``: Image category
method
setCvFrame(self, arg0: numpy.ndarray, arg1: ImgFrame.Type) -> ImgFrame: ImgFrame
@note This API only available if OpenCV support is enabled Copies cv::Mat data to the ImgFrame buffer and converts to a specific type. Parameter ``frame``: Input cv::Mat BGR frame from which to copy the data
method
setFrame(self, arg0: numpy.ndarray) -> ImgFrame: ImgFrame
@note This API only available if OpenCV support is enabled Copies cv::Mat data to ImgFrame buffer Parameter ``frame``: Input cv::Mat frame from which to copy the data
method
setHeight(self, height: int) -> ImgFrame: ImgFrame
Specifies frame height Parameter ``height``: frame height
method
setInstanceNum(self, instance: int) -> ImgFrame: ImgFrame
Instance number relates to the origin of the frame (which camera) Parameter ``instance``: Instance number
method
method
setStride(self, stride: int) -> ImgFrame: ImgFrame
Specifies frame stride Parameter ``stride``: frame stride
method
method
setType(self, type: ImgFrame.Type) -> ImgFrame: ImgFrame
Specifies frame type, RGB, BGR, ... Parameter ``type``: Type of image
method
setWidth(self, width: int) -> ImgFrame: ImgFrame
Specifies frame width Parameter ``width``: frame width
method
validateTransformations(self) -> bool: bool
Check that the image transformation match the image size Returns: true if the transformations are valid
class
depthai.ImgFrame.Specs
variable
variable
variable
variable
variable
variable
variable
variable
method
class
depthai.ImgFrame.Type
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
variable
method
method
method
method
method
method
method
method
method
method
property
property
Need assistance?
Head over to Discussion Forum for technical support or any other questions you might have.