1 | initial version |
You check if cy is EXACTLY on your line. But you want to know if it crossed the line. Do you have any tracking of the detected objects? In this case, you could check if the cy was below 170 in the last frame and at least 170 in the new frame. If this was the case, mark the track as counted, so that you don't count it several times.