maix.ext_dev.opns303x

maix.ext_dev.opns303x module

You can use maix.ext_dev.opns303x to access this module with MaixPy
This module is generated from MaixPy and MaixCDK

Module

No module

Enum

Resolution

Opns303x Resolution

item describe
values RES_100x100:
RES_50x50:
RES_25x25:

C++ defination code:

enum class Resolution : uint32_t {
    RES_100x100 = 100,
    RES_50x50 = 50,
    RES_25x25 = 25,
}

Variable

Function

Class

Opns303x

Opns303x TOF

C++ defination code:

class Opns303x final

__init__

def __init__(self, spi_bus_num: int, resolution: Resolution = ..., cmap: maix.ext_dev.cmap.Cmap = ..., dis_min: int = -1, dis_max: int = -1) -> None

Construct a new Opns303x object

item description
type func
param spi_bus_num: SPI bus number.
resolution: @see Resolution
cmap: The color mapping to be used for generating the pseudo color image
dis_min: The minimum reference distance (in mm) for generating the pseudo color image. Default is -1.
dis_max: The maximum reference distance (in mm) for generating the pseudo color image. Default is -1.
If both max and min are equal, it operates in auto mode:
the maximum distance in the frame is taken as the maximum reference distance,
and the minimum distance in the frame is taken as the minimum reference distance.
static False

C++ defination code:

Opns303x(int spi_bus_num,
            ::maix::ext_dev::opns303x::Resolution resolution=::maix::ext_dev::opns303x::Resolution::RES_50x50,
            ::maix::ext_dev::cmap::Cmap cmap=::maix::ext_dev::cmap::Cmap::JET,
            int dis_min=-1, int dis_max=-1)

matrix

def matrix(self) -> list[list[int]]

Retrieves sensor data and returns a distance matrix.

item description
type func
return Matrix containing the distance data, or an empty matrix ([]) if the operation fails.
static False

C++ defination code:

TOFMatrix matrix()

image

def image(self) -> maix.image.Image

Obtains sensor data and converts it into a pseudo-color image

item description
type func
return ::maix::image::Image* A raw pointer to a maix image object.
It is the responsibility of the caller to free this memory
in C/C++ to prevent memory leaks.
static False

C++ defination code:

::maix::image::Image* image()

max_dis_point

def max_dis_point(self) -> tuple[int, int, int]

Finds the pixel with the maximum distance from the most recent reading

item description
type func
return Point A tuple of type <int, int, float>, representing
(x, y, distance) of the pixel with the maximum distance.
If the operation fails, the return values will be x, y < 0.
static False

C++ defination code:

TOFPoint max_dis_point()

min_dis_point

def min_dis_point(self) -> tuple[int, int, int]

Finds the pixel with the minimum distance from the most recent reading

item description
type func
return Point A tuple of type <int, int, float>, representing
(x, y, distance) of the pixel with the minimum distance.
If the operation fails, the return values will be x, y < 0.
static False

C++ defination code:

TOFPoint min_dis_point()

center_point

def center_point(self) -> tuple[int, int, int]

Finds the center pixel from the most recent reading

item description
type func
return Point A tuple of type <int, int, float>, representing
(x, y, distance) of the center pixel in the distance matrix.
If the operation fails, the return values will be x, y < 0.
static False

C++ defination code:

TOFPoint center_point()

image_from

def image_from(self, matrix: list[list[int]]) -> maix.image.Image

Converts a given matrix of distance data into an image

item description
type func
param matrix: The distance matrix to be converted.
return ::maix::image::Image* A pointer to the generated image.
It is the responsibility of the caller to free this memory
in C/C++ to prevent memory leaks.
static False

C++ defination code:

::maix::image::Image* image_from(const TOFMatrix& matrix)

max_dis_point_from

def max_dis_point_from(matrix: list[list[int]]) -> tuple[int, int, int]

Finds the pixel with the maximum distance from the given matrix

item description
type func
param matrix: The distance matrix to be analyzed.
return Point A tuple of type <int, int, float>, representing
(x, y, distance) of the pixel with the maximum distance.
If the operation fails, the return values will be x, y < 0.
static True

C++ defination code:

static TOFPoint max_dis_point_from(const TOFMatrix& matrix)

min_dis_point_from

def min_dis_point_from(matrix: list[list[int]]) -> tuple[int, int, int]

Finds the pixel with the minimum distance from the given matrix

item description
type func
param matrix: The distance matrix to be analyzed.
return Point A tuple of type <int, int, float>, representing
(x, y, distance) of the pixel with the minimum distance.
If the operation fails, the return values will be x, y < 0.
static True

C++ defination code:

static TOFPoint min_dis_point_from(const TOFMatrix& matrix)

center_point_from

def center_point_from(matrix: list[list[int]]) -> tuple[int, int, int]

Finds the center pixel from the given matrix

item description
type func
param matrix: The distance matrix to be analyzed.
return Point A tuple of type <int, int, float>, representing
(x, y, distance) of the center pixel in the matrix.
If the operation fails, the return values will be x, y < 0.
static True

C++ defination code:

static TOFPoint center_point_from(const TOFMatrix& matrix)