5.13. sail.BMImage

5.13.1. __init__

Interface:
def __init__(self)


def __init__(self,
            handle: sail.Handle,
            h: int,
            w: int,
            format: bm_image_format_ext,
            dtype: sail.bm_image_data_format_ext)

Parameters

  • handle : sail.Handle

Handle instance

  • h: int

The height of img

  • w: int

The width of img

  • format : bm_image_format_ext

The format of img

  • dtype: sail.bm_image_data_format_ext

The data type of img

5.13.2. width

Get the img width.

Interface:
def width(self)-> int

Returns

  • width : int

The width of img

5.13.3. height

Get the img height.

Interface:
def height(self)-> int

Returns

  • height : int

The height of img

5.13.4. format

Get the img format.

Interface:
def format(self)-> bm_image_format_ext

Returns

  • format : bm_image_format_ext

The format of img

5.13.5. dtype

Get the img dtype.

Interface:
def dtype(self)-> bm_image_data_format_ext

Returns

  • dtype: bm_image_data_format_ext

The data type of img

5.13.6. data

Get inner bm_image.

Interface:
def data(self)-> bm_image

Returns

  • img : bm_image

the data of img

5.13.7. get_device_id

Get device id of this image.

Interface:
def get_device_id(self)-> int

Returns

  • device_id : int

tpu ids of this image.

5.13.8. asmat

Convert to cv Mat

Interface:
def asmat(self)-> numpy.ndarray[numpy.uint8]

Returns

  • image : numpy.ndarray[numpy.uint8]

only support uint8

5.13.9. get_plane_num

Get plane number of this image

Interface:
def get_plane_num(self)  -> int: