title: How to Handle Occlusion and Fragmentation
body: <p>I am trying to implement a people counting system using computer vision for uni project. Currently, my method is:</p>
  
  <ol>
  <li>Background subtraction using MOG2</li>
  <li>Morphological filter to remove noise</li>
  <li>Track blob</li>
  <li>Count blob passing a specified region (a line)</li>
  </ol>
  
  <p>The problem is if people come as group, my method only counts one people. From my readings, I believe this is what called as occlusion. Another problem is when people looks similar to background (use dark clothing and passing a black pillar/wall), the blob is separated while it is actually one person.
  <img src="https://i.stack.imgur.com/KJOiX.png" alt="enter image description here"></p>
  
  <p>From what I read, I should implement a detector + tracker (e.g. detect human using HOG). But my detection result is poor (e.g. 50% false positives with 50% hit rate; using OpenCV human detector and my own trained detector) so I am not convinced to use the detector as basis for tracking. Thanks for your answers and time for reading this post!</p>