![]() |
DeepSight SDK
3.0.0
DeepSight SDK - crowd face analysis
|
DeepSight SDK sliding time window aggregator class. More...
Public Member Functions | |
| SlidingWindowAggregator (std::chrono::milliseconds maxWindowDuration=std::chrono::milliseconds{ 10000 }) | |
| ds::SlidingWindowAggregator constructor. More... | |
| ~SlidingWindowAggregator () noexcept | |
| ds::SlidingWindowAggregator destructor. | |
| SlidingWindowAggregator (SlidingWindowAggregator &&slidingWindowAggregator) noexcept | |
| ds::SlidingWindowAggregator move constructor. | |
| SlidingWindowAggregator & | operator= (SlidingWindowAggregator &&slidingWindowAggregator) noexcept |
| ds::SlidingWindowAggregator move assignment operator. | |
| void | newDetections (const std::vector< ds::Person > &people) |
| Adds new detections to the current state of aggregations. More... | |
| std::vector< ds::AggregatedPerson > | getAggregations (std::chrono::milliseconds windowDuration=std::chrono::milliseconds{ 0 }) |
| Get people aggregations in the provided time window. More... | |
| std::chrono::milliseconds | getMaxWindowDuration () const noexcept |
| Returns the maximum window duration data will be internaly stored. More... | |
| void | setMaxWindowDuration (std::chrono::milliseconds maxWindowDuration) noexcept |
| Sets the maximum window duration data will be internaly stored. More... | |
| void | clean () noexcept |
| Discards all detections from the internal state. More... | |
DeepSight SDK sliding time window aggregator class.
The ds::SlidingWindowAggregator class aggregates all information retrieved for each unique person during a window of time. It is therefore possible to know what happened in the last time window (eg. in the last 10 seconds) at any given time, without having to preemptively initialize a ds::Aggregator. All detections provided to ds::SlidingWindowAggregator::newDetections calls outside of the window will be discarded.
In order to implement a sliding window aggregation strategy, all the detections within the time window need to be stored internally. Therefore the larger the time window, the larger the memory requirements.
| ds::SlidingWindowAggregator::SlidingWindowAggregator | ( | std::chrono::milliseconds | maxWindowDuration = std::chrono::milliseconds{ 10000 } | ) |
ds::SlidingWindowAggregator constructor.
| maxWindowDuration | The maximum window of time over which the aggregation will be performed. |
The maximum time window is defined as the time between (std::chrono::system_clock::now() - maxWindowDuration) and (std::chrono::system_clock::now())
|
noexcept |
Discards all detections from the internal state.
| std::vector< ds::AggregatedPerson > ds::SlidingWindowAggregator::getAggregations | ( | std::chrono::milliseconds | windowDuration = std::chrono::milliseconds{ 0 } | ) |
Get people aggregations in the provided time window.
| windowDuration | The window of time over which the aggregation will be performed. |
This function aggregates all people detected in the last windowDuration milliseconds. The windowDuration parameter cannot be larger than the maxWindowDuration provided during construction. All detections older than (std::chrono::system_clock::now() - maxWindowDuration) will be discarded. A person with a detection duration shorter that 1 second is considered a false positive and therefore not returned.
|
noexcept |
Returns the maximum window duration data will be internaly stored.
| void ds::SlidingWindowAggregator::newDetections | ( | const std::vector< ds::Person > & | people | ) |
Adds new detections to the current state of aggregations.
| people | New detections to aggregate. |
This function stores the new detections in the internal buffer. All detections outside the time window will be discarded.
Example usage:
|
noexcept |
Sets the maximum window duration data will be internaly stored.
| maxWindowDuration | The maximum window duration in milliseconds. |