title: How Count each vehicle only once in Traffic vehicle counter?
body: <p>I have been doing the traffic vehicle counter using Python and OpenCV. My current algorithm is counting the number of vehicles per frame. It results in the same vehicle is counting more than once per each frame. Instead, i want the Unique vehicle count in a video. Count each car only once. What technique i have to use to achieve this.</p>
  
  <pre><code>import cv2
  print(cv2.__version__)
  
  cascade_src = 'cars.xml'
  video_src = 'dataset/video2.avi'
  #video_src = 'dataset/video2.avi'
  
  cap = cv2.VideoCapture(video_src)
  car_cascade = cv2.CascadeClassifier(cascade_src)
  
  while True:
      ret, img = cap.read()
      if (type(img) == type(None)):
          break
  
      gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  
      cars = car_cascade.detectMultiScale(gray, 1.1, 1)
  
      for (x,y,w,h) in cars:
          cv2.rectangle(img,(x,y),(x+w,y+h),(0,0,255),2)      
  
      cv2.imshow('video', img)
      print "Found "+str(len(cars))+" car(s)"
      b=str(len(cars))
      a= float(b)
      if a&gt;=5:
          print ("more traffic")
      else:
          print ("no traffic")    
      if cv2.waitKey(33) == 27:
          break
  
  cv2.destroyAllWindows()
  </code></pre>