hbVPOpticalFlowPyrLK

typedef struct hbVPKeyPoint { float x; float y; } hbVPKeyPoint;

Feature point structure.

  • Member

    Member NameDescription
    xThe x-coordinate of the feature point.
    yThe y-coordinate of the feature point.
typedef struct hbVPLKOFParam { uint32_t pyrLevels; uint32_t winSize; uint32_t criteriaEpsilon; uint32_t maxIteration; float minEigThreshold; uint8_t confEnable; } hbVPLKOFParam;

Sparse optical flow task parameter structure.

  • Member

    Member NameDescription
    pyrLevelsThe number of pyramid layers used for tcalculation.
    winSizeThe size of the optical flow window in the range of value is 3 ~ 23 and is an odd number, and the optical flow window size needs to be larger than the corner detection window size.
    criteriaEpsilonThe optimization termination threshold takes values in the range of value is 0 ~ 255.
    maxIterationThe maximum number of iterations takes values in the range of value is 1 ~ 10.
    minEigThresholdThe minimum eigen value threshold.
    confEnableConfidence output switch,non zero: enable, zero: disable, j6 is not supported, use default value
Note

J6 has no lkof backend, use dsp backend.

int32_t hbVPOpticalFlowPyrLK(hbUCPTaskHandle_t *taskHandle, hbVPArray *currPoints, hbVPArray *currPointsStatus, hbVPArray *currPointsConf, hbVPArray const *prevPoints, hbVPImage const *currPym, hbVPImage const *prevPym, hbVPLKOFParam const *lkofParam);

The API for calling the OpticalFlowPyrLK.

  • Parameter
    • [out] taskHandle Task handles are responsible for the interaction of the operator with the UCP architecture.
    • [out] currPoints Output feature point, Memory element type is hbVPKeyPoint, memory size is datasize * sizeof(hbVPKeyPoint), size is the same as prevPoints's size.
    • [out] currPointsStatus track point status,0: inconvergent, 1: convergence, memory element type is uint8_t, memory size is size * sizeof(uint8_t), size is the same as currPoints.
    • [out] currPointsConf optical flow confidence, dsp unsupport it, J6 DSP is not supported, it can be nullptr.
    • [in] currPym Input the pyramid layer of the current frame picture and needs to be consistent with the format of the previous frame.
    • [in] prevPym Input the pyramid layer of the previous picture frame.
    • [in] prevPoints The feature point of the previous frame.
    • [in] lkofParam The sparse optical flow task parameter.
  • Return Value
    • Return 0 means the API was successfully executed, otherwise the execution failed.