Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert bugfix #299

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tonic/functional/event_downsampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def differentiator_downsample(events: np.ndarray, sensor_size: tuple, target_siz
time = int(differentiated_time // dt)

# Separate events based on polarity and apply Heaviside
event_hist_pos = (np.maximum(event_histogram >= noise_threshold, 0)).clip(max=1)
event_hist_neg = (-np.minimum(-event_histogram >= noise_threshold, 0)).clip(max=1)
event_hist_pos = event_histogram >= noise_threshold
event_hist_neg = -event_histogram >= noise_threshold

frame_histogram[time,...,1] += event_hist_pos
frame_histogram[time,...,0] += event_hist_neg
Expand Down Expand Up @@ -154,4 +154,4 @@ def integrator_downsample(events: np.ndarray, sensor_size: tuple, target_size: t

dtype = np.dtype({'names': names, 'formats': formats})

return unstructured_to_structured(events_new.copy(), dtype=dtype)
return unstructured_to_structured(events_new.copy(), dtype=dtype)
Loading