initializeSearchWindow(hbtracker,R)sets the initial search window region,R. The tracker uses this region as the initial window to search for the object. You can also use this function when the tracker loses track of the object. Use the function to reinitialize an object's initial location and size.
Track and display the object in each video frame. The while loop reads each image frame, converts the image to HSV color space, then tracks the object in the hue channel where it is distinct from the background. Finally, the example draws a box around the object and displays the results.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.