I have a project for creating an application in which the user can draw an area of interest (in this example, the rectangle around the vehicle for tracking), and it automatically tracks the vehicle in subsequent frames of the recorded video.
The method that I have implemented so far with OpenCV is as follows:
(1) Get a custom rectangle (area of interest) from initial_frame 
(2) Use goodFeaturesToTrackin the area of interest and saveinitial_features 
(3) 3.1: next_frame 3.2: calcOpticalFlowPyrLK(prevImg, nextImg, prevPts, nextPts,...) * prevImg initial_frame prevPts initial_featues , nextImg 3.3: Get Bounding Rectangle nextPts 3.4: 
50 , , :

50 , :

, , , , , , , .
, , , , , , .
.
* . , ( EMGUCV):
public Rectangle RectFromPoints(List<PointF> points)
{
using (MemStorage stor = new MemStorage())
{
Contour<PointF> contour = new Contour<PointF>(stor);
var newPoints = RemoveOutlierPoints(points);
foreach(PointF pnt in newPoints)
{
contour.Push(pnt);
}
var contPoly = contour.ApproxPoly(3, stor);
var rect = contPoly.BoundingRectangle;
return rect;
}
}