# ImgFrame

These are all the images (regardless of their encoding/format), as well as the depth/disparity "image".
[ColorCamera](https://docs.luxonis.com/software/depthai-components/nodes/color_camera.md) and
[MonoCamera](https://docs.luxonis.com/software/depthai-components/nodes/mono_camera.md) are the source of the image frame
messages.

## Examples of functionality

 * [RGB Preview](https://docs.luxonis.com/software/depthai/examples/rgb_preview.md)
 * [Mono Preview](https://docs.luxonis.com/software/depthai/examples/mono_preview.md)
 * [Depth Preview](https://docs.luxonis.com/software/depthai/examples/depth_preview.md)

## Reference

### depthai.ImgFrame(depthai.Buffer)

Kind: Class

ImgFrame message. Carries image data and metadata.

#### depthai.ImgFrame.Specs

Kind: Class

##### type: RawImgFrame.Type

Kind: Class Variable

##### __init__(self: RawImgFrame.Specs)

Kind: Method

##### bytesPP

Kind: Property

##### bytesPP.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### height

Kind: Property

##### height.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### p1Offset

Kind: Property

##### p1Offset.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### p2Offset

Kind: Property

##### p2Offset.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### p3Offset

Kind: Property

##### p3Offset.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### stride

Kind: Property

##### stride.setter(self, arg0: typing.SupportsInt)

Kind: Method

##### width

Kind: Property

##### width.setter(self, arg0: typing.SupportsInt)

Kind: Method

#### depthai.ImgFrame.Type

Kind: Class

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

  NONE

##### BGR888i: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### BGR888p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### BGRF16F16F16i: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### BGRF16F16F16p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### BITSTREAM: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### GRAY8: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### GRAYF16: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### HDR: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### LUT16: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### LUT2: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### LUT4: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### NONE: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### NV12: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### NV21: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### PACK10: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### PACK12: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RAW10: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RAW12: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RAW14: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RAW16: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RAW8: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RGB161616: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RGB888i: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RGB888p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RGBA8888: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RGBF16F16F16i: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### RGBF16F16F16p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### YUV400p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### YUV420p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### YUV422i: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### YUV422p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### YUV444i: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### YUV444p: typing.ClassVar[RawImgFrame.Type]

Kind: Class Variable

##### __members__: typing.ClassVar[dict[str, RawImgFrame.Type]]

Kind: Class Variable

##### __eq__(self, other: typing.Any) -> bool: bool

Kind: Method

##### __getstate__(self) -> int: int

Kind: Method

##### __hash__(self) -> int: int

Kind: Method

##### __index__(self: RawImgFrame.Type) -> int: int

Kind: Method

##### __init__(self: RawImgFrame.Type, value: typing.SupportsInt)

Kind: Method

##### __int__(self: RawImgFrame.Type) -> int: int

Kind: Method

##### __ne__(self, other: typing.Any) -> bool: bool

Kind: Method

##### __repr__(self) -> str: str

Kind: Method

##### __setstate__(self: RawImgFrame.Type, state: typing.SupportsInt)

Kind: Method

##### __str__(self) -> str: str

Kind: Method

##### name

Kind: Property

##### value

Kind: Property

#### __init__(self)

Kind: Method

#### getCategory(self) -> int: int

Kind: Method

Retrieves image category

#### getColorTemperature(self) -> int: int

Kind: Method

Retrieves white-balance color temperature of the light source, in kelvins

#### getCvFrame(self) -> typing.Any: typing.Any

Kind: Method

Returns BGR or grayscale frame compatible with use in other opencv functions

#### getExposureTime(self) -> datetime.timedelta: datetime.timedelta

Kind: Method

Retrieves exposure time

#### getFrame(self, copy: bool = False) -> numpy.ndarray: numpy.ndarray

Kind: Method

Returns numpy array with shape as specified by width, height and type

#### getHeight(self) -> int: int

Kind: Method

Retrieves image height in pixels

#### getInstanceNum(self) -> int: int

Kind: Method

Retrieves instance number

#### getLensPosition(self) -> int: int

Kind: Method

Retrieves lens position, range 0..255. Returns -1 if not available

#### getLensPositionRaw(self) -> float: float

Kind: Method

Retrieves lens position, range 0.0f..1.0f. Returns -1 if not available

#### getSensitivity(self) -> int: int

Kind: Method

Retrieves sensitivity, as an ISO value

#### getSequenceNum(self) -> int: int

Kind: Method

Retrieves sequence number

#### getTimestamp()

Kind: Method

#### getTimestampDevice()

Kind: Method

#### getType(self) -> RawImgFrame.Type: RawImgFrame.Type

Kind: Method

Retrieves image type

#### getWidth(self) -> int: int

Kind: Method

Retrieves image width in pixels

#### setCategory(self, category: typing.SupportsInt) -> ImgFrame: ImgFrame

Kind: Method

Parameter ``category``:
    Image category

#### setFrame(self, array: numpy.ndarray)

Kind: Method

Copies array bytes to ImgFrame buffer

#### setHeight(self, height: typing.SupportsInt) -> ImgFrame: ImgFrame

Kind: Method

Specifies frame height

Parameter ``height``:
    frame height

#### setInstanceNum(self, instance: typing.SupportsInt) -> ImgFrame: ImgFrame

Kind: Method

Instance number relates to the origin of the frame (which camera)

Parameter ``instance``:
    Instance number

#### setSequenceNum(self, seq: typing.SupportsInt) -> ImgFrame: ImgFrame

Kind: Method

Specifies sequence number

Parameter ``seq``:
    Sequence number

#### setSize()

Kind: Method

#### setTimestamp(self, timestamp: datetime.timedelta) -> ImgFrame: ImgFrame

Kind: Method

Retrieves image timestamp related to dai::Clock::now()

#### setTimestampDevice(self, arg0: datetime.timedelta) -> ImgFrame: ImgFrame

Kind: Method

Sets image timestamp related to dai::Clock::now()

#### setType(self, type: RawImgFrame.Type) -> ImgFrame: ImgFrame

Kind: Method

Specifies frame type, RGB, BGR, ...

Parameter ``type``:
    Type of image

#### setWidth(self, width: typing.SupportsInt) -> ImgFrame: ImgFrame

Kind: Method

Specifies frame width

Parameter ``width``:
    frame width

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
