https://github.com/Anishauday/MovingObjectcountingSpecificArea/blob/main/counter.py
#Check if an object is exiting from monitored zone def CheckExitLineCrossing(x, coordXEntranceLine, coordXExitLine, height): absDistance = abs(x - coordXExitLine) if ((absDistance <= pixelTolerance) and (x > coordXEntranceLine) and (x < height)): return 1 else: return 0 camera = cv2.VideoCapture(0)
I'm trying to count the no. of objects that move into the boxed area instead of a reference line. I tried searching online for a reference but in vain. How do we define a rectangle to calculate abs distance to count?
1.4m articles
1.4m replys
5 comments
57.0k users