saimj7 / People-Counting-in-Real-Time

People Counting in Real-Time with an IP camera.
MIT License
528 stars 263 forks source link

line #62

Closed Zaifat closed 1 year ago

Zaifat commented 1 year ago

good afternoon, is it possible to somehow change the line according to the example of the screenshot? Thank you

334433

m-marcjanik commented 1 year ago

The line on the stream is only a visual representation of the border, and it can be changed by modifying cv2.line(frame, (0, H // 2), (W, H // 2), (0, 0, 0), 3). However, in order for it to work (detecting if the centroid is passing through), you would need to modify if direction < 0 and centroid[1] < H // 2: and elif direction > 0 and centroid[1] > H // 2: as at the moment it calculates whether centroid passed half height of the image ( H // 2).