Not sure if this is the correct category but I can’t find anything specific for optical flow (nor any tags).
Anyway, including optical flow from plain C does not work because NV_OF_ROI_RECT is referred without the struct
qualifier. Attached trivial patch fixes the problem
--- old/nvOpticalFlowCommon.h 2020-06-26 05:28:20.000000000 +0200
+++ new/nvOpticalFlowCommon.h 2021-01-31 12:31:09.749300990 +0100
@@ -384,7 +384,7 @@
NvOFPrivDataHandle hPrivData; /**< [in]: Optical flow private data handle. It is reserved field and should be set to NULL. */
uint32_t padding2; /**< [in]: Padding. Must be set to 0. */
uint32_t numRois; /**< [in]: Number of ROIs. */
- NV_OF_ROI_RECT* roiData; /**< [in]: Pointer to the NV_OF_ROI_RECTs data. Size of this buffer should be atleast numROIs * sizeof(NV_OF_ROI_RECT). */
+ struct NV_OF_ROI_RECT* roiData; /**< [in]: Pointer to the NV_OF_ROI_RECTs data. Size of this buffer should be atleast numROIs * sizeof(NV_OF_ROI_RECT). */
} NV_OF_EXECUTE_INPUT_PARAMS;
/**