Python API Reference

ArducamEvkSDK

class ArducamEvkSDK.Camera

Bases: object

add_log_file(filename: str) bool

add a log file

property bandwidth: int

A property of bandwidth (read-only).

property bin_config: dict

A property of bin_config (read-only).

capture(timeout: int = 2000) Any

capture a image, return a object of Frame, or None if failed

property capture_fps: int

A property of capture_fps (read-only).

check_usb_type() bool

check the connection usb type is expected or not

clear_buffer() bool

clear the buffer

close() bool

close the camera

property config: CameraConfig

A property of config.

property config_type: str

A property of config_type (read-only). (‘NONE’ | ‘TEXT’ | ‘BINARY’)

property controls: list[Control]

A property of controls (read-only).

enable_console_log(enable: bool = True) None

enable/disable console log

property force_capture: bool

A property of force_capture.

get_auto_transfer() Any

get the recommended transfer configuration

get_avail_count() int

get the available frame count

has_capture_callback() bool

check if the callback function for reading a frame is set

has_event_callback() bool

check if the callback function for event is set

has_message_callback() bool

check if the callback function for message is set

init() bool

init the camera

is_opened() bool

check if the camera is opened

property last_error: int

A property of last_error (read-only).

property last_error_message: str

A property of last_error_message (read-only).

property log_level: LoggerLevel

A property of log_level.

property mem_type: MemType

A property of mem_type.

open(param: Param) bool

open the camera

read_board_config(command: int, value: int, index: int, buf_size: int) Any

read sensor register

read_reg(mode: I2CMode, i2c_addr: int, regAddr: int) Any

read sensor register

read_reg_16_16(ship_addr: int, reg_addr: int) Any

Reads a register value with 16 bit address and 16-bit value.

read_reg_16_8(ship_addr: int, reg_addr: int) Any

Reads a register value with 16 bit address and 8-bit value.

read_reg_8_16(ship_addr: int, reg_addr: int) Any

Reads a register value with 8 bit address and 16-bit value.

read_reg_8_8(ship_addr: int, reg_addr: int) Any

Reads a register value with 8 bit address and 8-bit value.

read_sensor_reg(reg_addr: int) Any

read sensor register

read_user_data(addr: int, len: int) Any

read sensor register

register_control(controls: list[Control]) bool

register controls

send_vr(command: int, direction: int, value: int, index: int, buffer: list[int]) Any

send vendor request

set_auto_transfer(auto_transfer: bool) bool

enable or disable the automatic transfer configuration before starting the camera

set_capture_callback(callback: Callable[[Frame], None]) None

set the callback function for reading a frame, or None to disable it

set_control(controlId: str, value: int) bool

set control value

set_event_callback(callback: Callable[[EventCode], None]) None

set the callback function for event, or None to disable it

set_message_callback(callback: Callable[[LoggerLevel, str], None]) None

set the callback function for messages, or None to disable it

set_transfer(transfer_size: int, transfer_buffer_size: int) bool

set transfer size and buffer size

start() bool

start the camera

stop() bool

stop the camera

switch_mode(mode_id: int) bool

switch the camera mode

property usb_type: str

A property of usb_type (read-only).

property usb_type_num: int

A property of usb_type_num (read-only).

wait_capture(timeout: int = 2000) bool

wait for a frame to be captured, return True if success, False if timeout

write_board_config(command: int, value: int, index: int, buffer: list[int]) bool

write sensor register

write_reg(mode: I2CMode, i2c_addr: int, regAddr: int, value: int) bool

write sensor register

write_reg_16_16(ship_addr: int, reg_addr: int, value: int) bool

Writes a register value with 16 bit address and 16-bit value.

write_reg_16_8(ship_addr: int, reg_addr: int, value: int) bool

Writes a register value with 16 bit address and 8-bit value.

write_reg_8_16(ship_addr: int, reg_addr: int, value: int) bool

Writes a register value with 8 bit address and 16-bit value.

write_reg_8_8(ship_addr: int, reg_addr: int, value: int) bool

Writes a register value with 8 bit address and 8-bit value.

write_sensor_reg(reg_addr: int, value: int) bool

write sensor register

write_user_data(addr: int, data: list[int]) bool

write sensor register

class ArducamEvkSDK.CameraConfig

Bases: object

property bit_width: int

A property of bit_width.

property format: int

A property of format.

property height: int

A property of height.

property i2c_addr: int

A property of i2c_addr.

property i2c_mode: int

A property of i2c_mode.

property width: int

A property of width.

ArducamEvkSDK.CaptureMethodConflict: ErrorCode
ArducamEvkSDK.CaptureTimeout: ErrorCode
ArducamEvkSDK.ConfigFileEmpty: ErrorCode
ArducamEvkSDK.ConfigFormatError: ErrorCode
class ArducamEvkSDK.Control

Bases: object

property code: str

A property of code.

property default: int

A property of default.

property flags: int

A property of flags.

property func: str

A property of func (read-only).

property max: int

A property of max.

property min: int

A property of min.

property name: str

A property of name (read-only).

property step: int

A property of step.

ArducamEvkSDK.ControlFormatError: ErrorCode
ArducamEvkSDK.Critical: LoggerLevel
ArducamEvkSDK.DMA: MemType
ArducamEvkSDK.Debug: LoggerLevel
class ArducamEvkSDK.Device

Bases: object

property dev_path: str

A property of dev_path (const).

property id_product: int

A property of id_product (const).

property id_vendor: int

A property of id_vendor (const).

property in_used: bool

A property of in_used (const).

property serial_number: list[int]

A property of serial_number (const).This is a list with 12 elements.

property speed: USBSpeed

A property of speed (const).

property usb_type: int

A property of usb_type (const).

ArducamEvkSDK.DeviceConnect: EventCode
ArducamEvkSDK.DeviceDisconnect: EventCode
class ArducamEvkSDK.DeviceList

Bases: object

devices() list[Device]

All supported devices

has_event_callback() bool

Check if the callback function for event is set

refresh() bool

Refreshes the device list

set_event_callback(callback: Callable[[EventCode, Device | None], None]) bool

Set the callback function for event, or None to disable it

ArducamEvkSDK.DeviceToHost: VRCommandDirection
ArducamEvkSDK.Empty: ErrorCode
ArducamEvkSDK.Err: LoggerLevel
class ArducamEvkSDK.ErrorCode(value: int)

Bases: object

Members:

Success : Success.

Empty : Empty.

ReadConfigFileFailed : Failed to read configuration file.

ConfigFileEmpty : Configuration file is empty.

ConfigFormatError : Camera configuration format error.

ControlFormatError : Camera control format error.

OpenCameraFailed : Failed to open camera.

UnknownUSBType : Unknown USB type.

UnknownDeviceType : Unknown Device type.

InitCameraFailed : Failed to initialize camera.

MemoryAllocateFailed : Failed to allocate memory.

USBTypeMismatch : USB type mismatch.

CaptureTimeout : Capture timeout.

CaptureMethodConflict : Capture method conflict.

FreeEmptyBuffer : Free empty buffer.

FreeUnknowBuffer : Free unknown buffer.

RegisterMultipleCallback : Register multiple callback.

StateError : Camera state error.

NotSupported : Not supported.

VRCommandError : Vendor command error.

UserdataAddrError : Userdata address error.

UserdataLenError : Userdata length error.

UnknownError : Unknown error.

CaptureMethodConflict: ClassVar[ErrorCode]
CaptureTimeout: ClassVar[ErrorCode]
ConfigFileEmpty: ClassVar[ErrorCode]
ConfigFormatError: ClassVar[ErrorCode]
ControlFormatError: ClassVar[ErrorCode]
Empty: ClassVar[ErrorCode]
FreeEmptyBuffer: ClassVar[ErrorCode]
FreeUnknowBuffer: ClassVar[ErrorCode]
InitCameraFailed: ClassVar[ErrorCode]
MemoryAllocateFailed: ClassVar[ErrorCode]
NotSupported: ClassVar[ErrorCode]
OpenCameraFailed: ClassVar[ErrorCode]
ReadConfigFileFailed: ClassVar[ErrorCode]
RegisterMultipleCallback: ClassVar[ErrorCode]
StateError: ClassVar[ErrorCode]
Success: ClassVar[ErrorCode]
USBTypeMismatch: ClassVar[ErrorCode]
UnknownDeviceType: ClassVar[ErrorCode]
UnknownError: ClassVar[ErrorCode]
UnknownUSBType: ClassVar[ErrorCode]
UserdataAddrError: ClassVar[ErrorCode]
UserdataLenError: ClassVar[ErrorCode]
VRCommandError: ClassVar[ErrorCode]
property name: str
property value: int
class ArducamEvkSDK.EventCode(value: int)

Bases: object

Members:

FrameStart : Frame start

FrameEnd : Frame end

Exit : Exit

TransferError : Transfer error

TransferTimeout : Transfer timeout

TransferLengthError : Transfer length error

DeviceConnect : Device connect

DeviceDisconnect : Device disconnect

DeviceConnect: ClassVar[EventCode]
DeviceDisconnect: ClassVar[EventCode]
Exit: ClassVar[EventCode]
FrameEnd: ClassVar[EventCode]
FrameStart: ClassVar[EventCode]
TransferError: ClassVar[EventCode]
TransferLengthError: ClassVar[EventCode]
TransferTimeout: ClassVar[EventCode]
property name: str
property value: int
ArducamEvkSDK.Exit: EventCode
class ArducamEvkSDK.Format

Bases: object

property bit_depth: int

A property of bit_depth.

property format_code: int

A property of format_code.

property height: int

A property of height.

property width: int

A property of width.

class ArducamEvkSDK.FormatMode(value: int)

Bases: object

Members:

RAW : RAW

RGB : RGB

YUV : YUV

JPG : JPG

MON : MON

RAW_D : RAW_D

MON_D : MON_D

TOF : TOF, deprecated

STATS : STATS

RGB_IR : RGB_IR

JPG: ClassVar[FormatMode]
MON: ClassVar[FormatMode]
MON_D: ClassVar[FormatMode]
RAW: ClassVar[FormatMode]
RAW_D: ClassVar[FormatMode]
RGB: ClassVar[FormatMode]
RGB_IR: ClassVar[FormatMode]
STATS: ClassVar[FormatMode]
TOF: ClassVar[FormatMode]
YUV: ClassVar[FormatMode]
property name: str
property value: int
class ArducamEvkSDK.Frame

Bases: object

property bad: bool

A property of bad.

property data: numpy.ndarray[Any, numpy.dtype[numpy.uint8]]

A property of data.

property format: Format

A property of format.

property seq: int

A property of seq.

ArducamEvkSDK.FrameEnd: EventCode
ArducamEvkSDK.FrameStart: EventCode
ArducamEvkSDK.FreeEmptyBuffer: ErrorCode
ArducamEvkSDK.FreeUnknowBuffer: ErrorCode
ArducamEvkSDK.Full: USBSpeed
ArducamEvkSDK.High: USBSpeed
ArducamEvkSDK.HostToDevice: VRCommandDirection
class ArducamEvkSDK.I2CMode(value: int)

Bases: object

Members:

I2C_MODE_8_8 : 8-bit register address and 8-bit data

I2C_MODE_8_16 : 8-bit register address and 16-bit data

I2C_MODE_16_8 : 16-bit register address and 8-bit data

I2C_MODE_16_16 : 16-bit register address and 16-bit data

I2C_MODE_16_32 : 16-bit register address and 32-bit data

I2C_MODE_16_16: ClassVar[I2CMode]
I2C_MODE_16_32: ClassVar[I2CMode]
I2C_MODE_16_8: ClassVar[I2CMode]
I2C_MODE_8_16: ClassVar[I2CMode]
I2C_MODE_8_8: ClassVar[I2CMode]
property name: str
property value: int
ArducamEvkSDK.I2C_MODE_16_16: I2CMode
ArducamEvkSDK.I2C_MODE_16_32: I2CMode
ArducamEvkSDK.I2C_MODE_16_8: I2CMode
ArducamEvkSDK.I2C_MODE_8_16: I2CMode
ArducamEvkSDK.I2C_MODE_8_8: I2CMode
ArducamEvkSDK.Info: LoggerLevel
ArducamEvkSDK.InitCameraFailed: ErrorCode
ArducamEvkSDK.JPG: FormatMode
class ArducamEvkSDK.LoggerLevel(value: int)

Bases: object

Members:

Trace : trace log level

Debug : debug log level

Info : info log level

Warn : warn log level

Err : err log level

Critical : critical log level

Off : off log level

Critical: ClassVar[LoggerLevel]
Debug: ClassVar[LoggerLevel]
Err: ClassVar[LoggerLevel]
Info: ClassVar[LoggerLevel]
Off: ClassVar[LoggerLevel]
Trace: ClassVar[LoggerLevel]
Warn: ClassVar[LoggerLevel]
property name: str
property value: int
ArducamEvkSDK.Low: USBSpeed
ArducamEvkSDK.MON: FormatMode
ArducamEvkSDK.MON_D: FormatMode
class ArducamEvkSDK.MemType(value: int)

Bases: object

Members:

DMA : DMA

RAM : RAM

DMA: ClassVar[MemType]
RAM: ClassVar[MemType]
property name: str
property value: int
ArducamEvkSDK.MemoryAllocateFailed: ErrorCode
ArducamEvkSDK.NotSupported: ErrorCode
ArducamEvkSDK.Off: LoggerLevel
ArducamEvkSDK.OpenCameraFailed: ErrorCode
class ArducamEvkSDK.Param

Bases: object

property bin_config: bool

A property of bin_config.

property config_file_name: str

A property of config_file_name.

property device: Device

A property of device.

property ext_config_file_name: str

A property of ext_config_file_name.

property mem_type: MemType

A property of mem_type.

ArducamEvkSDK.RAM: MemType
ArducamEvkSDK.RAW: FormatMode
ArducamEvkSDK.RAW_D: FormatMode
ArducamEvkSDK.RGB: FormatMode
ArducamEvkSDK.RGB_IR: FormatMode
ArducamEvkSDK.ReadConfigFileFailed: ErrorCode
ArducamEvkSDK.RegisterMultipleCallback: ErrorCode
ArducamEvkSDK.STATS: FormatMode
ArducamEvkSDK.StateError: ErrorCode
ArducamEvkSDK.Success: ErrorCode
ArducamEvkSDK.Super: USBSpeed
ArducamEvkSDK.SuperPlus: USBSpeed
ArducamEvkSDK.TOF: FormatMode
ArducamEvkSDK.Trace: LoggerLevel
ArducamEvkSDK.TransferError: EventCode
ArducamEvkSDK.TransferLengthError: EventCode
ArducamEvkSDK.TransferTimeout: EventCode
class ArducamEvkSDK.USBSpeed(value: int)

Bases: object

Members:

Unknown : The OS doesn’t report or know the device speed.

Low : The device is operating at low speed (1.5MBit/s).

Full : The device is operating at full speed (12MBit/s).

High : The device is operating at high speed (480MBit/s).

Super : The device is operating at super speed (5000MBit/s).

SuperPlus : The device is operating at super speed plus (10000MBit/s).

Full: ClassVar[USBSpeed]
High: ClassVar[USBSpeed]
Low: ClassVar[USBSpeed]
Super: ClassVar[USBSpeed]
SuperPlus: ClassVar[USBSpeed]
Unknown: ClassVar[USBSpeed]
property name: str
property value: int
ArducamEvkSDK.USBTypeMismatch: ErrorCode
ArducamEvkSDK.Unknown: USBSpeed
ArducamEvkSDK.UnknownDeviceType: ErrorCode
ArducamEvkSDK.UnknownError: ErrorCode
ArducamEvkSDK.UnknownUSBType: ErrorCode
ArducamEvkSDK.UserdataAddrError: ErrorCode
ArducamEvkSDK.UserdataLenError: ErrorCode
class ArducamEvkSDK.VRCommandDirection(value: int)

Bases: object

Members:

HostToDevice : Host to device

DeviceToHost : Device to host

DeviceToHost: ClassVar[VRCommandDirection]
HostToDevice: ClassVar[VRCommandDirection]
property name: str
property value: int
ArducamEvkSDK.VRCommandError: ErrorCode
ArducamEvkSDK.Warn: LoggerLevel
ArducamEvkSDK.YUV: FormatMode
ArducamEvkSDK.get_error_name(ec: int) str

get the error name