コード例 #1
0
#  num_packet_before_disable = 1000

with open('Position_and_Speed_31_01_2020.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)

    #Open Event Data Real Time Discarded CSV file
    with open('Events_31_01_2020.csv', 'w', newline='') as csvfile:
        writerevents = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)

        #Open Event Data Real Time Discarded CSV file
        with open('Noise_Events_31_01_2020.csv', 'w', newline='') as csvfile:
            writernoise = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL)
    
            while True:
                try:
                    data = device.get_event("events")
                    if data is not None:
                        (pol_events, num_pol_event, special_events, num_special_event, frame_ts, frames, imu_events, num_imu_event) = data

                        if pol_events is not None:
                        
                            for event in pol_events:
                                (t, x, y, p, noise) = event
                                if(noise == 1):
                                    
                                    if (Collection_Period_1 == False) and (Positive_n_events == 0) and (Negative_n_events == 0):
                                        t1 = t
                                        t2 = t + 1000
                                        t3 = t + 11000
                                        t4 = t + 12000
コード例 #2
0
    event_batch_size = 0
    event_batch_size_max = 10000
    iterations = 0

    with Timer("Processing entire dataset"):
        while True:
            event_batch = np.empty((1, 5))

            while True:
                if event_batch_size >= event_batch_size_max:
                    break

                try:
                    iterations += 1
                    data = dvs_device.get_event()
                    if data is not None:
                        (
                            pol_events,
                            num_pol_event,
                            special_events,
                            num_special_event,
                            frames_ts,
                            frames,
                            imu_events,
                            num_imu_event,
                        ) = data

                        if pol_events is not None:
                            event_batch = np.concatenate(
                                (event_batch, pol_events))