Answer the question
In order to leave comments, you need to log in
What is the name of the algorithm for counting visitors?
I have data as [{userid,time}]
. Every 30 seconds I get a list of people that the sensor sees.
How to count unique visitors who stayed in the store for more than a minute? Given that if a person appeared now and after 10 minutes, then he is not considered a visitor, but a passerby.
In pursuit, how to calculate the average time a person spends in a store.
thanks in advance.
PS: what does the data look like
userid 1...2.................................2..1...1....1................................1.......................1....2333......................
time часназад----------------------------------------------------------------------------------------------------------сейчас
Answer the question
In order to leave comments, you need to log in
Make up an associative array like {id: time}.
Upon arrival of the data, go through all the people detected now, if such a person is not in the list, then add him to the array with the time.
Walk through the array. If a person is not in those detected now, then look at the time of the first detection and classify him as a visitor or passer-by, and then remove him from the array.
Set difference
x - new visitors
A - current set on the timeline.
B is the previous set on the timeline.
The "depth" of the analysis of "frames" (how many pairs in the chain we look at at a time) and the maximum time (transition from a passerby to a visitor) - you will choose yourself experimentally.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question