DVS128
pyaer.dvs128.DVS128(device_id=1, bus_number_restrict=0, dev_address_restrict=0, serial_number='', noise_filter=False)
DVS128.
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
- bus_number_restrict:
int
restrict the search for viable devices to only this USB bus number.
default is 0
- dev_address_restrict:
int
restrict the search for viable devices to only this USB device address.
default is 0
- serial_number:
str
restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor.
default is ""
- noise_filter:
bool
if enable noise filter,
default is False
.
obtain_device_info
obtain_device_info(handle)
Obtain DVS128 info.
This function collects the following information from the device:
- Deveice ID
- If the device is a master camera
- Device string
- Device USB bus number
- Device USB device address
- Camera width
- Camera height
- Logic version
Arguments
- handle:
caerDeviceHandle
a valid device handle that can be used with the otherlibcaer
functions, orNone
on error.
open
open(device_id=1, bus_number_restrict=0, dev_address_restrict=0, serial_number='')
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
. - bus_number_restrict:
int
restrict the search for viable devices to only this USB bus number.
default is 0
. - dev_address_restrict:
int
restrict the search for viable devices to only this USB device address.
default is 0
. - serial_number:
str
restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor.
default is ""
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 DVS128 biases.
Returns
- flag:
bool
True if set successful, False otherwise.
get_bias
get_bias()
Get bias settings.
Returns
- bias_obj:
dict
dictionary that contains DVS128 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(send_default_config=True)
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 validDVSNoise
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_polarity_event
get_polarity_event(packet_header, noise_filter=False)
Get a packet of polarity event.
Arguments
- packet_header:
caerEventPacketHeader
the header that represents a event packet - noise_filter:
bool
the background activity filter is applied if True.
Returns
- 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 thenoise_filter
option is set toTrue
, 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_events:
int
number of the polarity events available in the packet.
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 thenoise_filter
option is set toTrue
, 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 } }