https://github.com/Anishauday/MovingObjectcountingSpecificArea/blob/main/counter.py
#Check if an object is exiting from monitored zone def CheckExitLineCrossing(x