![]() |
VXLIB User Guide
|
Kernel for computing the median pixel over a window of imput image, for each pixel.
Computes the median pixel over a window of imput image, for each pixel. This kernel supports two types on implementaions based on kernel size i.e. 3 X 3 and M X N.
A 3 X 3 implementaion takes all 9 values present in the kernel, sorts them in ascending order and returns the middle i.e. 5th value as median value and the kernel is moved forward with the stride of 1.
A M X N implementaion takes values corresponding to the true values in MASK kernel of size M X N, sorts them in ascending order and returns the median and the kernel is moved forward with the stride of 1.
OpenVX Function Reference Page : https://www.khronos.org/registry/vx/specs/1.1/html/d3/d77/group__group__vision__function__median__image.html
Data Structures | |
| struct | VXLIB_median_InitArgs |
| Structure containing the parameters to initialize the kernel. More... | |
Functions | |
| int32_t | VXLIB_median_getHandleSize (VXLIB_median_InitArgs *pKerInitArgs) |
| This is a query function to calculate the size of internal handle. More... | |
| VXLIB_STATUS | VXLIB_median_init (VXLIB_kernelHandle handle, VXLIB_bufParams2D_t *bufParamsIn, VXLIB_bufParams2D_t *bufParamsMask, VXLIB_bufParams2D_t *bufParamsOut, VXLIB_bufParams2D_t *bufParamsScratch, const VXLIB_median_InitArgs *pKerInitArgs) |
| This function should be called before the VXLIB_median_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine. The results of these operations are stored in the handle. More... | |
| VXLIB_STATUS | VXLIB_median_init_checkParams (VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsMask, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_bufParams2D_t *bufParamsScratch, const VXLIB_median_InitArgs *pKerInitArgs) |
| This function checks the validity of the parameters passed to VXLIB_median_init function. This function is called with the same parameters as the VXLIB_median_init, and this function must be called before the VXLIB_median_init is called. More... | |
| VXLIB_STATUS | VXLIB_median_exec_checkParams (VXLIB_kernelHandle handle, const void *restrict pIn, const void *restrict pMask, const void *restrict pOut, const void *restrict pScratch) |
| This function checks the validity of the parameters passed to VXLIB_median_exec function. This function is called with the same parameters as the VXLIB_median_exec, and this function must be called before the VXLIB_median_exec is called. More... | |
| VXLIB_STATUS | VXLIB_median_exec (VXLIB_kernelHandle handle, void *restrict pIn, void *restrict pMask, void *restrict pOut, void *restrict pScratch) |
| This function is the main kernel compute function. More... | |
| void | VXLIB_median_perfEst (VXLIB_kernelHandle handle, const VXLIB_bufParams2D_t *bufParamsIn, const VXLIB_bufParams2D_t *bufParamsMask, const VXLIB_bufParams2D_t *bufParamsOut, const VXLIB_bufParams2D_t *bufParamsScratch, const VXLIB_median_InitArgs *pKerInitArgs, size_t *archCycles, size_t *estCycles) |
| This function estimates the archCycles and estCycles. More... | |
| int32_t VXLIB_median_getHandleSize | ( | VXLIB_median_InitArgs * | pKerInitArgs | ) |
This is a query function to calculate the size of internal handle.
| [in] | pKerInitArgs | : Pointer to structure holding init parameters |
Definition at line 49 of file VXLIB_median.cpp.
| VXLIB_STATUS VXLIB_median_init | ( | VXLIB_kernelHandle | handle, |
| VXLIB_bufParams2D_t * | bufParamsIn, | ||
| VXLIB_bufParams2D_t * | bufParamsMask, | ||
| VXLIB_bufParams2D_t * | bufParamsOut, | ||
| VXLIB_bufParams2D_t * | bufParamsScratch, | ||
| const VXLIB_median_InitArgs * | pKerInitArgs | ||
| ) |
This function should be called before the VXLIB_median_exec function is called. This function takes care of any one-time operations such as setting up the configuration of required hardware resources such as the streaming engine. The results of these operations are stored in the handle.
| [in] | handle | : Active handle to the kernel |
| [in] | bufParamsIn | : Pointer to the structure containing dimensional information of input image |
| [in] | bufParamsMask | : Pointer to the structure containing dimensional information of mask |
| [out] | bufParamsOut | : Pointer to the structure containing dimensional information of output image |
| [out] | bufParamsScratch | : Pointer to the structure containing dimensional information of scratch buffer |
| [in] | pKerInitArgs | : Pointer to the structure holding init parameters |
Definition at line 159 of file VXLIB_median.cpp.
| VXLIB_STATUS VXLIB_median_init_checkParams | ( | VXLIB_kernelHandle | handle, |
| const VXLIB_bufParams2D_t * | bufParamsIn, | ||
| const VXLIB_bufParams2D_t * | bufParamsMask, | ||
| const VXLIB_bufParams2D_t * | bufParamsOut, | ||
| const VXLIB_bufParams2D_t * | bufParamsScratch, | ||
| const VXLIB_median_InitArgs * | pKerInitArgs | ||
| ) |
This function checks the validity of the parameters passed to VXLIB_median_init function. This function is called with the same parameters as the VXLIB_median_init, and this function must be called before the VXLIB_median_init is called.
| [in] | handle | : Active handle to the kernel |
| [in] | bufParamsIn | : Pointer to the structure containing dimensional information of input image |
| [in] | bufParamsMask | : Pointer to the structure containing dimensional information of mask |
| [out] | bufParamsOut | : Pointer to the structure containing dimensional information of output image |
| [out] | bufParamsScratch | : Pointer to the structure containing dimensional information of scratch buffer |
| [in] | pKerInitArgs | : Pointer to the structure holding init parameters |
Definition at line 63 of file VXLIB_median.cpp.
| VXLIB_STATUS VXLIB_median_exec_checkParams | ( | VXLIB_kernelHandle | handle, |
| const void *restrict | pIn, | ||
| const void *restrict | pMask, | ||
| const void *restrict | pOut, | ||
| const void *restrict | pScratch | ||
| ) |
This function checks the validity of the parameters passed to VXLIB_median_exec function. This function is called with the same parameters as the VXLIB_median_exec, and this function must be called before the VXLIB_median_exec is called.
| [in] | handle | : Active handle to the kernel |
| [in] | pIn | : Pointer to the structure input image |
| [in] | pMask | : Pointer to the structure mask |
| [out] | pOut | : Pointer to the output buffer |
| [out] | pScratch | : Pointer to the scratch buffer |
Definition at line 131 of file VXLIB_median.cpp.
| VXLIB_STATUS VXLIB_median_exec | ( | VXLIB_kernelHandle | handle, |
| void *restrict | pIn, | ||
| void *restrict | pMask, | ||
| void *restrict | pOut, | ||
| void *restrict | pScratch | ||
| ) |
This function is the main kernel compute function.
Please refer to details under VXLIB_median_exec
| [in] | handle | : Active handle to the kernel |
| [in] | pIn | : Pointer to the structure input image |
| [in] | pMask | : Pointer to the structure mask |
| [out] | pOut | : Pointer to the output buffer |
| [out] | pScratch | : Pointer to the scratch buffer |
| Buffer | Row | Column |
|---|---|---|
| pIn | R | C |
| pMask | M | N |
| pOut | R - (M - 1) | C - (N - 1) |
| pScratch | M * N | C |
Definition at line 282 of file VXLIB_median.cpp.
| void VXLIB_median_perfEst | ( | VXLIB_kernelHandle | handle, |
| const VXLIB_bufParams2D_t * | bufParamsIn, | ||
| const VXLIB_bufParams2D_t * | bufParamsMask, | ||
| const VXLIB_bufParams2D_t * | bufParamsOut, | ||
| const VXLIB_bufParams2D_t * | bufParamsScratch, | ||
| const VXLIB_median_InitArgs * | pKerInitArgs, | ||
| size_t * | archCycles, | ||
| size_t * | estCycles | ||
| ) |
This function estimates the archCycles and estCycles.
| [in] | handle | : Active handle to the kernel |
| [in] | bufParamsIn | : Pointer to the structure containing dimensional information of input image |
| [in] | bufParamsMask | : Pointer to the structure containing dimensional information of mask |
| [in] | bufParamsOut | : Pointer to the structure containing dimensional information of output image |
| [in] | bufParamsScratch | : Pointer to the structure containing dimensional information of scratch buffer |
| [in] | pKerInitArgs | : Pointer to the structure holding init parameters |
| [out] | archCycles | : Arch compute cycles obtained from asm. |
| [out] | estCycles | : Estimated cycles including overhead. |
Definition at line 339 of file VXLIB_median_ci.cpp.