| frames | IMAGE | | The clip to track through, as one IMAGE batch (a video loader, or core 'Batch Images'). Frames are processed in order and the pose carries over, so the batch must BE the sequence. |
| pts3d | NPARRAY | | Nx3 model vertices, in the same units as tvec. |
| tris | NPARRAY | | Mx3 int triangle indices. Used for backface culling and the silhouette, so the winding matters. |
| K | NPARRAY | | 3x3 camera matrix of the FRAMES as given ('CV Camera Matrix' or a calibration). Lens distortion is not modelled by cv2.rapid - undistort the frames first if the lens is wide. |
| rvec | NPARRAY | | Initial rotation (Rodrigues 3x1) for the FIRST frame. Typically from solvePnP on a marker, or the pose the object was placed at. |
| tvec | NPARRAY | | Initial translation (3x1) for the first frame, in the mesh's units. |
| num_control_points | INT | 1288–2048 | How many points to sample along the silhouette per iteration. More points average out bad matches but cost linearly. 128 is a good default; below ~32 a few wrong correspondences can swing the pose. |
| search_length | INT | 121–256 | Half-length of the search line, in pixels of the SCALED frame - the tracker looks this far either side of the predicted contour. It sets the capture range, but NOT for free: cv2.rapid takes the strongest gradient anywhere on the line, so a long line lets texture and background edges outvote the silhouette. Measured on a textured vehicle over clutter, raising it from 12 to 96 pinned the error at ~46 px no matter how good the start was. Prefer raising capture range with 'scale' instead. |
| iterations | INT | 21–20 | Refinement passes per frame. 2 is usually the sweet spot; 1 lags behind the motion, and many passes on a static frame drift rather than settle (cv2.rapid's control points are re-extracted each pass, so it is not a converging solver). |
| scaleopt | FLOAT | 1.000.05–1 | Downscale the frames before tracking (the camera matrix is scaled to match, so the pose stays in the original units). This is the CAPTURE-RANGE knob, and the one to reach for before search_length: the range it buys is search_length/scale in original pixels, it costs LESS than the equivalent search_length (the mask rasterization shrinks quadratically), and the INTER_AREA decimation suppresses the texture edges that mislead a long search line rather than adding more of them. It is NOT free accuracy: on a clip that starts on the object and only needs precision, dropping to 0.5 took the measured error from 2.8 px to 18 px. Leave it at 1.0 unless the pose you start from, or the motion between frames, is genuinely outside search_length. |