.. _vvas_xoptflow: vvas_xoptflow ============== Optical flow is one of the key functions used in many image processing and computer vision applications like object tracking, motion based segmentation, depth estimation, stitching and video frame rate conversion etc. Optical flow is estimated using previous and current frame pixel information. For optical flow estimation this plug-in uses hardware accelerator of ``xfopencv`` **non-pyramid optical flow**. This non-pyramid optical flow function takes current and previous frame as input and generates two floating point buffers of x and y direction displacements. Optical flow plug-in attaches these displacement buffers as **gstvvasofmeta**. For implementation details, refer to `vvas_xoptflow source code <https://github.com/Xilinx/VVAS/tree/master/vvas-gst-plugins/sys/optflow>`_ .. figure:: ../../images/vvas_optflow_blockdiagram.png :align: center :scale: 80 Prerequisite -------------- This plug-in uses **dense_non_pyr_of_accel** kernel. Make sure your xclbin has this kernel. Input and Output -------------------- Accepts buffer of NV12 format and generates two metadata buffers of type float and each size equal to the size of frame. For details about the meta data structure, refer to :ref:`vvas_optflow_metadata` Plug-in Properties ------------------- Table 6: vvas_xoptflow Plug-in Properties +--------------------+-------------+---------------+----------------------+------------------+ | | | | | | | **Property Name** | **Type** | **Range** | **Default** | **Description** | | | | | | | +====================+=============+===============+======================+==================+ | xclbin-location | String | NA | ./binary_container_1 | location of | | | | | .xclbin | xclbin | +--------------------+-------------+---------------+----------------------+------------------+ | dev-idx | Integer | 0 to 31 | 0 | device index | +--------------------+-------------+---------------+----------------------+------------------+ .. ------------ MIT License Copyright (c) 2023 Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.