The OpenVX Specification  a73e458

Detailed Description

Defines the Kernel Object and Interface.

A Kernel in OpenVX is the abstract representation of an computer vision function, such as a “Sobel Gradient” or “Lucas Kanade Feature Tracking”. A vision function may implement many similar or identical features from other functions, but it is still considered a single unique kernel as long as it is named by the same string and enumeration and conforms to the results specified by OpenVX. Kernels are similar to function signatures in this regard.

In each of the cases, a client of OpenVX could request the kernels in nearly the same manner. There are two main approaches, which depend on the method a client calls to get the kernel reference. The first uses enumerations.

vx_node node = vxCreateGenericNode(graph, kernel);

The second method depends on using strings to get the kernel reference.

vx_kernel kernel = vxGetKernelByName(context, "org.khronos.openvx.sobel_3x3");
vx_node node = vxCreateGenericNode(graph, kernel);

Modules

 The list of available libraries
 The standard list of available libraries [R00400].
 
 The list of available kernels
 The standard list of available vision kernels.
 

Data Structures

struct  vx_kernel_info_t
 The Kernel Information Structure. This is returned by the Context to indicate which kernels are available in the OpenVX implementation. More...
 

Macros

#define VX_MAX_KERNEL_NAME   (256)
 Defines the length of a kernel name string to be added to OpenVX, including the trailing zero [R01652].
 

Typedefs

typedef struct _vx_kernel * vx_kernel
 An opaque reference to the descriptor of a kernel. More...
 

Functions

vx_kernel VX_API_CALL vxGetKernelByEnum (vx_context context, vx_enum kernel)
 Obtains a reference to the kernel [R00656]. More...
 
vx_kernel VX_API_CALL vxGetKernelByName (vx_context context, const vx_char *name)
 Obtains a reference to a kernel using a string to specify the name [R00650]. More...
 
vx_status VX_API_CALL vxQueryKernel (vx_kernel kernel, vx_enum attribute, void *ptr, vx_size size)
 This allows the client to query the kernel to get information about the number of parameters, enum values, etc [R00661]. More...
 
vx_status VX_API_CALL vxReleaseKernel (vx_kernel *kernel)
 Release the reference to the kernel [R00667]. The object may not be garbage collected until its total reference count is zero. More...
 

Data Structure Documentation

◆ vx_kernel_info_t

struct vx_kernel_info_t

The Kernel Information Structure. This is returned by the Context to indicate which kernels are available in the OpenVX implementation.

Definition at line 1635 of file vx_types.h.

Data Fields
vx_enum enumeration The kernel enumeration value from The list of available kernels (or an extension thereof).
See also
vxGetKernelByEnum
vx_char name[VX_MAX_KERNEL_NAME] The kernel name in dotted hierarchical format. e.g. "org.khronos.openvx.sobel_3x3".
See also
vxGetKernelByName

Typedef Documentation

◆ vx_kernel

typedef struct _vx_kernel* vx_kernel

An opaque reference to the descriptor of a kernel.

See also
vxGetKernelByName
vxGetKernelByEnum

Definition at line 198 of file vx_types.h.

Function Documentation

◆ vxGetKernelByName()

vx_kernel VX_API_CALL vxGetKernelByName ( vx_context  context,
const vx_char name 
)

Obtains a reference to a kernel using a string to specify the name [R00650].

User Kernels follow a "dotted" heirarchical syntax. For example: "com.company.example.xyz". The following are strings specifying the kernel names:

org.khronos.openvx.color_convert

org.khronos.openvx.channel_extract

org.khronos.openvx.channel_combine

org.khronos.openvx.sobel_3x3

org.khronos.openvx.magnitude

org.khronos.openvx.phase

org.khronos.openvx.scale_image

org.khronos.openvx.table_lookup

org.khronos.openvx.histogram

org.khronos.openvx.equalize_histogram

org.khronos.openvx.absdiff

org.khronos.openvx.mean_stddev

org.khronos.openvx.threshold

org.khronos.openvx.integral_image

org.khronos.openvx.dilate_3x3

org.khronos.openvx.erode_3x3

org.khronos.openvx.median_3x3

org.khronos.openvx.box_3x3

org.khronos.openvx.gaussian_3x3

org.khronos.openvx.custom_convolution

org.khronos.openvx.gaussian_pyramid

org.khronos.openvx.accumulate

org.khronos.openvx.accumulate_weighted

org.khronos.openvx.accumulate_square

org.khronos.openvx.minmaxloc

org.khronos.openvx.convertdepth

org.khronos.openvx.canny_edge_detector

org.khronos.openvx.and

org.khronos.openvx.or

org.khronos.openvx.xor

org.khronos.openvx.not

org.khronos.openvx.multiply

org.khronos.openvx.add

org.khronos.openvx.subtract

org.khronos.openvx.warp_affine

org.khronos.openvx.warp_perspective

org.khronos.openvx.harris_corners

org.khronos.openvx.fast_corners

org.khronos.openvx.optical_flow_pyr_lk

org.khronos.openvx.remap

org.khronos.openvx.halfscale_gaussian

org.khronos.openvx.laplacian_pyramid

org.khronos.openvx.laplacian_reconstruct

org.khronos.openvx.non_linear_filter

Parameters
[in]contextThe reference to the implementation context [R00651].
[in]nameThe string of the name of the kernel to get [R00652].
Returns
A kernel reference [R00653]. Any possible errors preventing a successful completion of the function should be checked using vxGetStatus [R00654].
Precondition
vxLoadKernels if the kernel is not provided by the OpenVX implementation.
Note
User Kernels should follow a "dotted" hierarchical syntax [R00655]. For example: "com.company.example.xyz".

◆ vxGetKernelByEnum()

vx_kernel VX_API_CALL vxGetKernelByEnum ( vx_context  context,
vx_enum  kernel 
)

Obtains a reference to the kernel [R00656].

Enum values above the standard set are assumed to apply to loaded libraries.

Parameters
[in]contextThe reference to the implementation context [R00657].
[in]kernelA value from The list of available kernels or a vendor or client-defined value [R00658].
Returns
A vx_kernel reference [R00659]. Any possible errors preventing a successful completion of the function should be checked using vxGetStatus [R00660].
Precondition
vxLoadKernels if the kernel is not provided by the OpenVX implementation.

◆ vxQueryKernel()

vx_status VX_API_CALL vxQueryKernel ( vx_kernel  kernel,
vx_enum  attribute,
void *  ptr,
vx_size  size 
)

This allows the client to query the kernel to get information about the number of parameters, enum values, etc [R00661].

Parameters
[in]kernelThe kernel reference to query [R00662].
[in]attributeThe attribute to query. Use a The Kernel Attribute Constants [R00663].
[out]ptrThe pointer to the location at which to store the resulting value [R00664].
[in]sizeThe size of the container to which ptr points [R00665].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00666].
VX_ERROR_INVALID_REFERENCEkernel is not a valid vx_kernel reference.
VX_ERROR_INVALID_PARAMETERSIf any of the other parameters are incorrect.
VX_ERROR_NOT_SUPPORTEDIf the attribute value is not supported in this implementation.

◆ vxReleaseKernel()

vx_status VX_API_CALL vxReleaseKernel ( vx_kernel kernel)

Release the reference to the kernel [R00667]. The object may not be garbage collected until its total reference count is zero.

Parameters
[in]kernelThe pointer to the kernel reference to release [R00668].
Postcondition
After returning from this function the reference is zeroed [R00669].
Returns
A The vx_status Constants value.
Return values
VX_SUCCESSNo errors; any other value indicates failure [R00670].
VX_ERROR_INVALID_REFERENCEkernel is not a valid vx_kernel reference.