![]() |
VisionWorks Toolkit ReferenceDecember 18, 2015 | 1.2 Release |
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:
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... | |
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).
[in] | graph | Specifies the graph. |
[in] | ref_image | Specifies the reference image (8-bit grayscale). |
[in] | cur_image | Specifies the current image (8-bit grayscale). It must have the same size as ref_image . |
[in] | in_mv_0 | Specifies 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_1 | Specifies 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_0 | Specifies 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_1 | Specifies 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] | smoothnessFactor | Specifies the smoothness factor in cost formula. |
[in] | mvDivFactor | Specifies the best motion vectors diversity factor. |
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).
[in] | context | Specifies the context. |
[in] | ref_image | Specifies the reference image (8-bit grayscale). |
[in] | cur_image | Specifies the current image (8-bit grayscale). It must have the same size as ref_image . |
[in] | in_mv_0 | Specifies 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_1 | Specifies 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_0 | Specifies 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_1 | Specifies 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] | smoothnessFactor | Specifies the smoothness factor in cost formula. |
[in] | mvDivFactor | Specifies the best motion vectors diversity factor. |
VX_SUCCESS | No errors. |
VX_ERROR_INVALID_REFERENCE | Supplied parameters are not a valid references. |
VX_ERROR_INVALID_PARAMETERS | Supplied parameters are not valid. |
VX_ERROR_INVALID_SCOPE | Supplied parameters are virtual objects that cannot be used in immediate mode. |
VX_FAILURE | Internal error in primitive implementation, check log for detailed information (Framework: Log). |