[source]

eDVS

pyaer.edvs.eDVS(device_id=1, serial_port_name='/dev/ttyUSB0', serial_baud_rate=12000000, noise_filter=False)

eDVS.

Arguments

  • device_id: int
    a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data.
    default is 1.
  • serial_port_name: str
    name of the serial port device to open.
    default is /dev/ttyUSB0
  • serial_baud_rate: uint32_t baud-rate for serial port communication.
    default is 12M

obtain_device_info

obtain_device_info(handle)

Obtain eDVS info.

This function collects the following information from the device:

  • Deveice ID
  • Device string
  • If the device is a master camera
  • Camera width
  • Camera height

Arguments

  • handle: caerDeviceHandle
    a valid device handle that can be used with the other libcaer functions, or None on error.

open

open(device_id=1, serial_port_name='/dev/ttyUSB0', serial_baud_rate=12000000)

Open device.

Arguments

  • device_id: int
    a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data.
    default is 1.
  • serial_port_name: str
    name of the serial port device to open.
    default is /dev/ttyUSB0
  • serial_baud_rate: uint32_t baud-rate for serial port communication.
    default is 12M

set_bias_from_json

set_bias_from_json(file_path, verbose=False)

Set bias from loading JSON configuration file.

Arguments

  • file_path: str
    absolute path of the JSON bias file.
  • verbose: bool
    optional debugging message.

set_bias

set_bias(bias_obj)

Set bias from bias dictionary.

Arguments

  • bias_obj: dict
    dictionary that contains eDVS biases.

Returns

  • flag: bool
    True if set successful, False otherwise.

get_bias

get_bias()

Get bias settings.

Returns

  • bias_obj: dict
    dictionary that contains eDVS current bias settings.

save_bias_to_json

save_bias_to_json(file_path)

Save bias to JSON.

Arguments

  • file_path: str
    the absolute path to the destiation.

Returns

  • flag: bool
    returns True if success in writing, False otherwise.

start_data_stream

start_data_stream()

Start streaming data.

Arguments

  • send_default_config: bool
    send default config to the device before starting the data streaming.
    default is True

set_noise_filter

set_noise_filter(noise_filter)

Set noise filter.

Arguments

  • noise_filter: filters.DVSNoise
    A valid DVSNoise object. This filter implements software-level background activity filter.

enable_noise_filter

enable_noise_filter()

Enalbe DVS noise filter.

This function enables the DVS noise filter. Note that this function will initialize a DVSNoise filter if there is None.


disable_noise_filter

disable_noise_filter()

Disable noise filter.

This method disable the noise filter. Note that this function doesn't destroy the existed noise filter. It simply switches off the function.


get_event

get_event()

Get event.

Returns

  • pol_events: numpy.ndarray
    a 2-D array that has the shape of (N, 4) where N is the number of events in the event packet. Each row in the array represents a single polarity event. The first number is the timestamp. The second number is the X position of the event. The third number is the Y position of the event. The fourth number represents the polarity of the event (positive or negative).
    If the noise_filter option is set to True, this array has an additional column at the end. The last column represents the validity of the corresponding event. Filtered events will be marked as 0.
  • num_pol_events: int
    number of the polarity events available in the packet.
  • special_events: numpy.ndarray
    a 2-D array that has the shape of (N, 2) where N is the number of events in the event packet. Each row in the array represents a single special event. The first value is the timestamp of the event. The second value is the special event data.
  • num_special_events: int
    number of the special events in the packet.

Bias Example

{
    "cas": 54,
    "injGnd": 1108364,
    "reqPd": 16777215,
    "puX": 8159221,
    "diffOff": 132,
    "req": 159147,
    "refr": 6,
    "puY": 16777215,
    "diffOn": 482443,
    "diff": 30153,
    "foll": 51,
    "Pr": 3,
    "noise_filter_configs": {
        "sw_background_activity_two_levels": true,
        "sw_background_activity_check_polarity": true,
        "sw_background_activity_support_min": 2,
        "sw_background_activity_support_max": 8,
        "sw_background_activity_time": 2000,
        "sw_background_activity_enable": true,
        "sw_refractory_period_time": 200,
        "sw_refractory_period_enable": true,
        "sw_hotpixel_enable": true,
        "sw_hotpixel_learn": true
    }
}