i want to detect and count people when they comes inside in rectangle area in opencv caffemodel python

asked 2019-07-14 01:15:47 -0500

i have currently seen one tutorial in which people got detected and counted when they cross horizoantal line now i want to detect people in rectangle area when they cross rectangle area they got counted and detected coming in any direction how could i do this? this is url of tutorial sample program

https://www.pyimagesearch.com/2018/08...

edit retag flag offensive close merge delete

Comments

Just extend the tutorial program. Understand it, modify and test. Use 2 lines (formed in a cross) to detect people around the center of a rectangle and a ROI to limit the area of the rectangle.It should work, provided the will be no crowds.

Witek gravatar imageWitek ( 2019-07-15 04:06:59 -0500 )edit

rect = [(320, 40), (200, 350)] print(rect[1])

rectangle = cv2.rectangle(frame, rect[0], rect[1], (0, 255, 0), 3)

and inside for loop i m trying this in for (objectID, centroid) in objects.item() inside it i m trying this below code

if rectangle[0] < rects : totalUp += 1

then also didnt get result

deeptech gravatar imagedeeptech ( 2019-07-15 04:27:12 -0500 )edit