- All the examples in this chapter that deal with cameras return when there is a single failed or corrupted frame that leads to the detection of an empty frame. What type of modification is needed to allow a predefined number of retries before stopping the process?
- How can we call the meanShift function to perform the Mean Shift algorithm with 10 iterations and an epsilon value of 0.5?
- How can we visualize the hue histogram of the tracked object? Assume CamShift is used for tracking.
- Set the process-noise covariance in the KalmanFilter class so that the filtered and measured values overlap. Assume only the process-noise covariance is set, of all the available matrices for KalmanFilter class-behavior control.
- Let's assume that the Y position of the mouse on a window is used to describe the height of a filled rectangle that starts from the top-left corner of the window and has a width that equals the window width. Write a Kalman filter that can be used to correct the height of the rectangle (single value) and remove noise in the mouse movement that will cause a visually smooth resizing of the filled rectangle.
- Create a BackgroundSubtractorMOG2 object to extract the foreground image contents while avoiding shadow changes.
- Write a program to display the current (as opposed to sampled) background image using a background-segmentation algorithm.