Iterates to find the object center given its back projection and initial position of search window. The iterations are made until the search window center moves by less than the given value and/or until the function has done the maximum number of iterations.

C# | Visual Basic | Visual C++ |
public static int cvMeanShift( IntPtr probImage, MCvRect window, MCvTermCriteria criteria, out MCvConnectedComp comp )
Public Shared Function cvMeanShift ( _ probImage As IntPtr, _ window As MCvRect, _ criteria As MCvTermCriteria, _ <OutAttribute> ByRef comp As MCvConnectedComp _ ) As Integer
public: static int cvMeanShift( IntPtr probImage, MCvRect window, MCvTermCriteria criteria, [OutAttribute] MCvConnectedComp% comp )

- probImage (IntPtr)
- Back projection of object histogram
- window (MCvRect)
- Initial search window
- criteria (MCvTermCriteria)
- Criteria applied to determine when the window search should be finished.
- comp ( MCvConnectedComp %)
- Resultant structure that contains converged search window coordinates (comp->rect field) and sum of all pixels inside the window (comp->area field).

the number of iterations made