pub struct CountMask { /* private fields */ }Expand description
Count-mask image (GEPT, Sec. 3.2 “Event Accumulation”, Eq. 2): a three-channel RGB encoding
where red and blue hold the per-pixel positive and negative event counts and green is a binary
activity mask — full scale wherever an event of either polarity landed. Timestamps are not
used at all, which is what separates it from Tencode (latest polarity plus
event age) and from EventCount (one plane of raw totals).
Both count planes are clipped and rescaled by a single alpha: the pct-th percentile of
the non-zero counts of the two planes pooled together. A per-channel percentile would let a
quiet polarity saturate against a busy one, so the joint scale is what keeps red and blue
comparable.
white_frame inverts the image to a white background. The black-background default is the form
downstream descriptor models are trained on; the inverted one is offered for parity with the
reference renderer, not for feeding a model.
Implementations§
Trait Implementations§
impl Copy for CountMask
Source§impl Representation for CountMask
impl Representation for CountMask
Source§fn generate_on(
&self,
stream: &EventStream,
device: Device,
) -> Result<EventFrame, RepresentationError>
fn generate_on( &self, stream: &EventStream, device: Device, ) -> Result<EventFrame, RepresentationError>
Only the two count planes move to the GPU. The percentile that sets the scale stays on the
CPU: it is O(pixels) rather than O(events), it is already the cheap half, and it is the
part that has to agree with the reference NumPy pipeline bit for bit.
type Output = EventFrame
Source§fn generate(
&self,
stream: &EventStream,
) -> Result<EventFrame, RepresentationError>
fn generate( &self, stream: &EventStream, ) -> Result<EventFrame, RepresentationError>
Auto Trait Implementations§
impl Freeze for CountMask
impl RefUnwindSafe for CountMask
impl Send for CountMask
impl Sync for CountMask
impl Unpin for CountMask
impl UnsafeUnpin for CountMask
impl UnwindSafe for CountMask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more