VisionWorks Toolkit Reference

December 18, 2015 | 1.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
IME : Partition Motion Field

Detailed Description

Partitions motion vector field for blocks onto motion vector field into quarter sized blocks (half size in each dimension).

For example, motion field for \( 4 \times 4 \) blocks from motion field for \( 8 \times 8 \) blocks.

The primitive uses best 2 motion vectors from the larger blocks in its immediate neighborhood to derive the motion vector for the smaller block as shown in the figure below:

partition_motion_field.png

To select the best two motion vector candidates, the algorithm uses the following cost formula:

\[ cost(MV_{cur}) = SAD(MV_{cur}) + smoothnessFactor * \sum_{MV} dist(MV_{cur}, MV) \]

After evaluating all 8 motion vectors to the current quarter sized block, the best 2 motion vectors satisfying the relation below are kept to represent the current block:

\[ dist(MV0, MV1) >= mvDivFactor \]

Functions

vx_node nvxPartitionMotionFieldNode (vx_graph graph, vx_image ref_image, vx_image cur_image, vx_image in_mv_0, vx_image in_mv_1, vx_image out_mv_0, vx_image out_mv_1, vx_float32 smoothnessFactor, vx_int32 mvDivFactor)
 [Graph] Partitions motion vector field for blocks onto motion vector field into quarter sized blocks (half size in each dimension). More...
 
vx_status nvxuPartitionMotionField (vx_context context, vx_image ref_image, vx_image cur_image, vx_image in_mv_0, vx_image in_mv_1, vx_image out_mv_0, vx_image out_mv_1, vx_float32 smoothnessFactor, vx_int32 mvDivFactor)
 [Immediate] Partitions motion vector field for blocks onto motion vector field into quarter sized blocks (half size in each dimension). More...
 

Function Documentation

vx_node nvxPartitionMotionFieldNode ( vx_graph  graph,
vx_image  ref_image,
vx_image  cur_image,
vx_image  in_mv_0,
vx_image  in_mv_1,
vx_image  out_mv_0,
vx_image  out_mv_1,
vx_float32  smoothnessFactor,
vx_int32  mvDivFactor 
)

[Graph] Partitions motion vector field for blocks onto motion vector field into quarter sized blocks (half size in each dimension).

Parameters
[in]graphSpecifies the graph.
[in]ref_imageSpecifies the reference image (8-bit grayscale).
[in]cur_imageSpecifies the current image (8-bit grayscale). It must have the same size as ref_image.
[in]in_mv_0Specifies the input motion field for bigger blocks (first motion vectors). The motion vectors are assumed to be stored in Q14.2 format (NVX_DF_IMAGE_2S16).
[in]in_mv_1Specifies the input motion field for bigger blocks (second motion vectors). It must have the same size and format as in_mv_0 image.
[out]out_mv_0Specifies the output motion field for smaller blocks (first motion vectors). It must have the same format as in_mv_0 image. It must have twice larger size in each dimension than in_mv_0 image.
[out]out_mv_1Specifies the optional output motion field for smaller blocks (second motion vectors), optional. It must have the same size and format as out_mv_0 image.
[in]smoothnessFactorSpecifies the smoothness factor in cost formula.
[in]mvDivFactorSpecifies the best motion vectors diversity factor.
Returns
A valid node reference or an error object (use vxGetStatus).
vx_status nvxuPartitionMotionField ( vx_context  context,
vx_image  ref_image,
vx_image  cur_image,
vx_image  in_mv_0,
vx_image  in_mv_1,
vx_image  out_mv_0,
vx_image  out_mv_1,
vx_float32  smoothnessFactor,
vx_int32  mvDivFactor 
)

[Immediate] Partitions motion vector field for blocks onto motion vector field into quarter sized blocks (half size in each dimension).

Parameters
[in]contextSpecifies the context.
[in]ref_imageSpecifies the reference image (8-bit grayscale).
[in]cur_imageSpecifies the current image (8-bit grayscale). It must have the same size as ref_image.
[in]in_mv_0Specifies the input motion field for bigger blocks (first motion vectors). The motion vectors are assumed to be stored in Q14.2 format (NVX_DF_IMAGE_2S16).
[in]in_mv_1Specifies the input motion field for bigger blocks (second motion vectors). It must have the same size and format as in_mv_0 image.
[out]out_mv_0Specifies the output motion field for smaller blocks (first motion vectors). It must have the same format as in_mv_0 image. It must have twice larger size in each dimension than in_mv_0 image.
[out]out_mv_1Specifies the optional output motion field for smaller blocks (second motion vectors), optional. It must have the same size and format as out_mv_0 image.
[in]smoothnessFactorSpecifies the smoothness factor in cost formula.
[in]mvDivFactorSpecifies the best motion vectors diversity factor.
Returns
A vx_status enumerator.
Return values
VX_SUCCESSNo errors.
VX_ERROR_INVALID_REFERENCESupplied parameters are not a valid references.
VX_ERROR_INVALID_PARAMETERSSupplied parameters are not valid.
VX_ERROR_INVALID_SCOPESupplied parameters are virtual objects that cannot be used in immediate mode.
VX_FAILUREInternal error in primitive implementation, check log for detailed information (Framework: Log).