VPI Optical Flow settings for performance similar to NVOFA

I am working on an application that performs optical flow using the OFA. For initial proof-of-concept testing I utilized the prebuilt CUDA application provided with the download of the NVOFA library and my laptop RTX 3500 ADA. For this application there are SLOW/MEDIUM/FAST options, as well as a grid size of (1,2, or 4), and then some other minor options. NVOFA seems to be an overall simple interface with limited algorithmic options. This produced relatively smooth looking results for the 8-bit grayscale images used and performed as expected.

I moved onto a Jetson Orin NX where my full application will be housed and quickly learned the NVOFA library is available, but the VPI library has a dense optical flow functionality that uses the same OFA hardware and I assume acts similarly. However, unlike the NVOFA, VPI is much more feature rich in what algorithmic options it allows such as number of pyramid levels, quality, grid size, etc. So far, results from VPI have not been the same as NVOFA with more sharp discontinuities.

I was curious if there are known parameters to match, or at least get close to that of the NVOFA library? Or any rules-of-thumb for setting parameters to produce similar results? This would be useful to help the porting process between the two libraries and then fine tuning settings from there.

Hi,

For example, if you want to generate a similar output for NVODA grid=2, quality=high:
Please set VPI with:

  1. VPI_OPTICAL_FLOW_QUALITY_HIGH
  2. Pyramid level = 7
  3. Apply a 3x3 median filter as post-processing

Thanks.

When attempting to make a 7-layer pyramid for a 1024x488 image I receive the following error.

“terminate called after throwing an instance of ‘std::runtime_error’
what(): line 116: VPI_ERROR_INVALID_ARGUMENT: Image too small, input pyramid level #4 must be at least 32x32, but it is 64x30, reduce number of pyramid levels.”

When running NVOFA with the same images it processes fully. Is there some internal upsampling occuring in NVOFA to allow more pyramid layers?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.