Question about the Optical Flow Meta structure

Please provide complete information as applicable to your setup.

• Jetson
• DeepStream Version 6.0.0
• JetPack Version 4.6
• TensorRT Version 8.0.1
• Issue Type( Question)

I have some question about the NVDSOpticalFlowMeta structure. For reference the .h file’s contents are below.

/** 
 * @file
 * <b>NVIDIA Optical Flow Metadata </b>
 *
 * @b Description: This file defines the optical flow metadata.
 */

/**
 * @defgroup  ee_opticalflow_meta  Optical flow metadata
 *
 * Defines the optical flow metadata.
 * @ingroup NvDsMetaApi
 * @{
 */

#ifndef _NVDS_OPTICALFLOW_META_H_
#define _NVDS_OPTICALFLOW_META_H_

#include <gst/gst.h>

#ifdef __cplusplus
extern "C"
{
#endif

/**
 * Holds motion vector information about an element.
 */
typedef struct _NvOFFlowVector
{
    /** Holds the motion vector X component. */
    gshort flowx;

    /** Holds the motion vector Y component. */
    gshort flowy;
} NvOFFlowVector;

/**
 * Holds optical flow metadata about a frame.
 */
typedef struct
{
    /** Holds the number of rows in the frame for a given block size,
     e.g. if block size is 4 and frame height is 720, then the number of
     rows is (720/4) = 180. */
    guint rows;
    /** Holds the number of columns in the frame for given block size,
     e.g. if block size is 4 and frame width is 1280, then the number of
     columns is (1280/4) = 320. */
    guint cols;
    /** Holds the size of the motion vector. @see NvOFFlowVector. */
    guint mv_size;
    /** Holds the current frame number of the source. */
    gulong frame_num;
    /** Holds a pointer to the motion vector. */
    void *data;
    /** Reserved for internal use. */
    void *priv;
    /** Reserved for internal use. */
    void *reserved;
} NvDsOpticalFlowMeta;

#ifdef __cplusplus
}
#endif

#endif

/** @} */

  1. In the structure NvDsOpticalFlowMeta does the pointer void *data point to a variable of type NvOFFlowVector which then contains the flowx and flowy variables?

  2. Also as I understand it, the variables, rows and columns hold an integer value based on how many rows or columns are in the frame. But is there a value to specify a certain row and a certain column that would be used to find motion vector data at that specific row and column AKA that specific 4x4 block?

  3. This kind of ties into the other two questions but if I was trying to access the flowx and flowy values of a motion vector, how would I know or specify which block to get the motion vector from?

The reason for these questions is that I would like to output the optical flow vectors at every block of a frame. I just don’t understand how that would be achieved or if it is even possible just from looking at the nvds_opticalflow_meta.h

the same topic How do I get Optical Flow metadata from a pad_bufer_probe method? ?
some inferences:
deepstream_python_apps/bindfunctions.cpp at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub

1 Like

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

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