- opticalFlow(prevGrayscale, grayscale, textureShape, prevPoints, points, pointsShape, winSize, maxLevel, maxCount, epsilon): void
Parameters
- prevGrayscale: Uint8Array
- grayscale: Uint8Array
- textureShape: vec3
- prevPoints: Float32Array
- points: Float32Array
- pointsShape: vec3
- winSize: vec2
- maxLevel: number
- maxCount: number
- epsilon: number
Returns void
Stabilizes image objects between two consecutive frames caused by camera or object movement. Results are written to the
points
array.prevGrayscale
- Uint8Array of size (width * height). Grayscale data of previous framegrayscale
- Uint8Array of size (width * height). Grayscale data of current frametextureShape
- Should be {width, height, 1}prevPoints
- Float32Array of size (point count * 2). Positions of 2D points on the previous framepoints
- Float32Array of size (point count * 2). Results are written here - positions of 2D points on the current framepointsShape
- Should be {2, point count, 1}winSize
- Size of the search window for each pyramid levelmaxLevel
- Maximal pyramid level number, with zero based indexmaxCount
- Terminate if iteration count exceeds maxCountepsilon
- Terminate if window movement is less than epsilon