title: How to use the condensation algorithm available in OpenCV?
body: <p>I need to implement a software for tracking of moving objects in image streams using the condensation algorithm and the OpenCV library. I have read that OpenCV includes an implementation of this algorithm, but I did not find examples or tutorials that explain how to use the corresponding functions available in OpenCV.</p>
  
  <p>The <a href="http://opencv.willowgarage.com/documentation/c/motion_analysis_and_object_tracking.html#createcondensation"><code>cvCreateConDensation</code></a> function allocates the <a href="http://opencv.willowgarage.com/documentation/c/motion_analysis_and_object_tracking.html#cvcondensation"><code>CvConDensation</code></a> structure and requires the dimension of the state vector (<strong><code>dynam_params</code></strong>), the dimension of the measurement vector (<strong><code>measure_params</code></strong>) and the number of samples (<strong><code>sample_count</code></strong>).</p>
  
  <ul>
  <li>The dimension of the state vector should refer to the object state: for example, if the state could be the center point of the tracked object, then the state vector should contain the two coordinates of the center of the object, so the dimension of the state vector should be 2 in this case; in a similar manner, if the state of an object is formed by <strong><em>S</em></strong> points belonging to its shape, then I will specify <strong><em>2*S</em></strong> as <code>dynam_params</code> value (ie the number of coordinates is equal to <strong><em>2*S</em></strong>). Is this correct?</li>
  <li>The number of samples is the number of particles, therefore the parameter <code>sample_count</code> must be set with the number of particles to be used for the tracking of the object.</li>
  <li>What about the dimension of the measurement vector? What is the purpose the <code>measure_params</code> parameter?</li>
  </ul>
  
  <p>The <a href="http://opencv.willowgarage.com/documentation/c/motion_analysis_and_object_tracking.html#cvConDensInitSampleSet"><code>cvConDensInitSampleSet</code></a> function initializes the sample set for the condensation algorithm. Which rule is used to initialize the sample set? Which distribution is used to initialize the sample set? Given the starting position and the bounding box of the object to be tracked, how does this function initialize the sample set?</p>
  
  <p>What is the function that performs a complete interaction (<em>select</em>, <em>predict</em> and <em>measure</em>) of the algorithm? How do the samples are updated?</p>
  
  <p>Is there any tutorial that explains in detail how to use the functions available in OpenCV?</p>