Skip to content

CamShift

Motion and trackingfunctionOpenCV 5.0.0
import { CamShift } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSprobImage, window, criteria
FUNCTIONCamShift
RETURN TYPE[RotatedRect, Rect]
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Finds an object center, size, and orientation.

Note: - (Python) A sample explaining the camshift tracking algorithm can be found at opencv_source_code/samples/python/snippets/camshift.py

CamShift(probImage: Mat, window: Rect, criteria: TermCriteria): [RotatedRect, Rect];
probImage

Back projection of the object histogram. See calcBackProject.

window

Input/output value, modified by the native operation. Initial search window.

criteria

Stop criteria for the underlying meanShift. returns (in old interfaces) Number of iterations CAMSHIFT took to converge The function implements the CAMSHIFT object tracking algorithm [Bradski98] . First, it finds an object center using meanShift and then adjusts the window size and finds the optimal rotation. The function returns the rotated rectangle structure that includes the object position, size, and orientation. The next position of the search window can be obtained with RotatedRect::boundingRect()

See the OpenCV sample camshiftdemo.c that tracks colored objects.

Returns

The [RotatedRect, Rect] result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.