title: How to count number of objects in a video using MATLAB
body: <p>I have an infrared video which I have recorded during nights and my camera was facing the sky so I was basically trying to track the bird movements in the video.I took few video frames and plotted the trajectory of moving objects but now I would like to extend this same concept to the entire video.But there are few things that are troubling me.</p>
  
  <ol>
  <li><p>I have selected a static threshold of 0.6 to convert the gray scale frame into BW frame.But since I am interested in applying this algorithm to the entire video I should try to use a dynamic or adaptive threshold.</p></li>
  <li><p>I would also like to count the number of objects present in the video so that after running the entire video I should be able to display the number of moving objects in the video.</p></li>
  </ol>
  
  <p>So any help regarding adaptive threshold and counting number of objects in video will be sincerely appreciated.</p>