Maximum of numIterations in VPI LK Optical Flow

Docs:
Constraint: 0 < numIterations <= 32
My code:
params.numIterations = 32;
Error:
VPI_ERROR_INVALID_ARGUMENT: Maximum nubmer of iteration is 16

VPI version: NV_VPI_VERSION_STRING “1.1.12”

NVidia, can you fix it?

Hi,

Thanks for reporting this.

We can reproduce this issue internally and check with our internal team.
Will get back to you later.

Thanks and sorry for the inconvenience.

Hi,

We are going to update the document into the correct support range.
Thanks and sorry for the inconvience.

What about increase numIterations for more seamless migration from OpenCV?

In addition, please pay attention to trackingStatus output of vpiSubmitOpticalFlowPyrLK:

  • OpenCV: 1- tracking ok, 0 - fail
  • VisionWorks: 1 - tracking ok, 0 - fail
  • VPI: 0 - tracking ok, 1 - fail
    I had to spend some time to found problem in my code, because in VPI trackingStatus behaviour unexpectedly different from other CV frameworks.

Thanks.

Hi,

Do you mean the VPIStatus or trackingStatus?

For the return status VPIStatus, VPI also uses 0 to represent SUCCESS.
https://docs.nvidia.com/vpi/Status_8h_source.html#l00080

trackingStatus is a VPI array, and it indeed uses 1 for tracking loss.
This information is mentioned in the below:
vpiSubmitOpticalFlowPyrLK()

[in,out] trackingStatus Status array for tracking status for each input in prevPts. If element is one, the corresponding keypoint isn’t being tracked, otherwise, it is. The type of the array must be [VPI_ARRAY_TYPE_U8]

Thanks.