The OpenVX Specification
r31169
|
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.
The second method depends on using strings to get the kernel reference.
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 maximum string length of a kernel name to be added to OpenVX. | |
Typedefs | |
typedef struct _vx_kernel * | vx_kernel |
An opaque reference to the descriptor of a kernel. More... | |
Enumerations | |
enum | vx_kernel_attribute_e { VX_KERNEL_ATTRIBUTE_PARAMETERS = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x0, VX_KERNEL_ATTRIBUTE_NAME = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x1, VX_KERNEL_ATTRIBUTE_ENUM = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x2, VX_KERNEL_ATTRIBUTE_LOCAL_DATA_SIZE = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x3, VX_KERNEL_ATTRIBUTE_LOCAL_DATA_PTR = ((( VX_ID_KHRONOS ) << 20) | ( VX_TYPE_KERNEL << 8)) + 0x4 } |
The kernel attributes list. More... | |
enum | vx_kernel_e { VX_KERNEL_INVALID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x0, VX_KERNEL_COLOR_CONVERT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1, VX_KERNEL_CHANNEL_EXTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x2, VX_KERNEL_CHANNEL_COMBINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x3, VX_KERNEL_SOBEL_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x4, VX_KERNEL_MAGNITUDE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x5, VX_KERNEL_PHASE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x6, VX_KERNEL_SCALE_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x7, VX_KERNEL_TABLE_LOOKUP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x8, VX_KERNEL_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x9, VX_KERNEL_EQUALIZE_HISTOGRAM = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xA, VX_KERNEL_ABSDIFF = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xB, VX_KERNEL_MEAN_STDDEV = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xC, VX_KERNEL_THRESHOLD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xD, VX_KERNEL_INTEGRAL_IMAGE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xE, VX_KERNEL_DILATE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0xF, VX_KERNEL_ERODE_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x10, VX_KERNEL_MEDIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x11, VX_KERNEL_BOX_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x12, VX_KERNEL_GAUSSIAN_3x3 = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x13, VX_KERNEL_CUSTOM_CONVOLUTION = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x14, VX_KERNEL_GAUSSIAN_PYRAMID = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x15, VX_KERNEL_ACCUMULATE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x16, VX_KERNEL_ACCUMULATE_WEIGHTED = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x17, VX_KERNEL_ACCUMULATE_SQUARE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x18, VX_KERNEL_MINMAXLOC = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x19, VX_KERNEL_CONVERTDEPTH = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1A, VX_KERNEL_CANNY_EDGE_DETECTOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1B, VX_KERNEL_AND = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1C, VX_KERNEL_OR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1D, VX_KERNEL_XOR = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1E, VX_KERNEL_NOT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x1F, VX_KERNEL_MULTIPLY = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x20, VX_KERNEL_ADD = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x21, VX_KERNEL_SUBTRACT = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x22, VX_KERNEL_WARP_AFFINE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x23, VX_KERNEL_WARP_PERSPECTIVE = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x24, VX_KERNEL_HARRIS_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x25, VX_KERNEL_FAST_CORNERS = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x26, VX_KERNEL_OPTICAL_FLOW_PYR_LK = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x27, VX_KERNEL_REMAP = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x28, VX_KERNEL_HALFSCALE_GAUSSIAN = VX_KERNEL_BASE(VX_ID_KHRONOS, VX_LIBRARY_KHR_BASE) + 0x29, VX_KERNEL_MAX_1_0 } |
The standard list of available vision kernels. More... | |
Functions | |
vx_kernel VX_API_CALL | vxGetKernelByEnum (vx_context context, vx_enum kernel) |
Obtains a reference to the kernel using the vx_kernel_e enumeration. 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. 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. More... | |
vx_status VX_API_CALL | vxReleaseKernel (vx_kernel *kernel) |
Release the reference to the kernel. The object may not be garbage collected until its total reference count is zero. More... | |
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 1348 of file vx_types.h.
Data Fields | ||
---|---|---|
vx_enum | enumeration |
The kernel enumeration value from vx_kernel_e (or an extension thereof).
|
vx_char | name[VX_MAX_KERNEL_NAME] |
The kernel name in dotted hierarchical format. e.g. "org.khronos.openvx.sobel3x3".
|
typedef struct _vx_kernel* vx_kernel |
An opaque reference to the descriptor of a kernel.
Definition at line 174 of file vx_types.h.
enum vx_kernel_e |
The standard list of available vision kernels.
Each kernel listed here can be used with the vxGetKernelByEnum
call. When programming the parameters, use
VX_INPUT
for [in] VX_OUTPUT
for [out] VX_BIDIRECTIONAL
for [in,out]When programming the parameters, use
VX_TYPE_IMAGE
for a vx_image
in the size field of vxGetParameterByIndex
or vxSetParameterByIndex
* VX_TYPE_ARRAY
for a vx_array
in the size field of vxGetParameterByIndex
or vxSetParameterByIndex
* Enumerator | |
---|---|
VX_KERNEL_INVALID |
The invalid kernel is used to for conformance failure in relation to some kernel operation (Get/Release). If the kernel is executed it shall always return an error. The kernel has no parameters. To address by name use "org.khronos.openvx.invalid". |
VX_KERNEL_COLOR_CONVERT |
The Color Space conversion kernel. The conversions are based on the
|
VX_KERNEL_CHANNEL_EXTRACT |
The Generic Channel Extraction Kernel. This kernel can remove individual color channels from an interleaved or semi-planar, planar, sub-sampled planar image. A client could extract a red channel from an interleaved RGB image or do a Luma extract from a YUV format.
|
VX_KERNEL_CHANNEL_COMBINE |
The Generic Channel Combine Kernel. This kernel combine multiple individual planes into a single multiplanar image of the type specified in the output image.
|
VX_KERNEL_SOBEL_3x3 |
The Sobel 3x3 Filter Kernel.
|
VX_KERNEL_MAGNITUDE |
The Magnitude Kernel. This kernel produces a magnitude plane from two input gradients.
|
VX_KERNEL_PHASE |
The Phase Kernel. This kernel produces a phase plane from two input gradients.
|
VX_KERNEL_SCALE_IMAGE |
The Scale Image Kernel. This kernel provides resizing of an input image to an output image. The scaling factor is determined but the relative sizes of the input and output.
|
VX_KERNEL_TABLE_LOOKUP |
The Table Lookup kernel.
|
VX_KERNEL_HISTOGRAM |
The Histogram Kernel.
|
VX_KERNEL_EQUALIZE_HISTOGRAM |
The Histogram Equalization Kernel.
|
VX_KERNEL_ABSDIFF |
The Absolute Difference Kernel.
|
VX_KERNEL_MEAN_STDDEV |
The Mean and Standard Deviation Kernel.
|
VX_KERNEL_THRESHOLD |
The Threshold Kernel.
|
VX_KERNEL_INTEGRAL_IMAGE |
The Integral Image Kernel.
|
VX_KERNEL_DILATE_3x3 |
The dilate kernel.
|
VX_KERNEL_ERODE_3x3 |
The erode kernel.
|
VX_KERNEL_MEDIAN_3x3 |
The median image filter.
|
VX_KERNEL_BOX_3x3 |
The box filter kernel.
|
VX_KERNEL_GAUSSIAN_3x3 |
The gaussian filter kernel.
|
VX_KERNEL_CUSTOM_CONVOLUTION |
The custom convolution kernel.
|
VX_KERNEL_GAUSSIAN_PYRAMID |
The gaussian image pyramid kernel.
|
VX_KERNEL_ACCUMULATE |
The accumulation kernel.
|
VX_KERNEL_ACCUMULATE_WEIGHTED |
The weigthed accumulation kernel.
|
VX_KERNEL_ACCUMULATE_SQUARE |
The squared accumulation kernel.
|
VX_KERNEL_MINMAXLOC |
The min and max location kernel.
|
VX_KERNEL_CONVERTDEPTH |
The bit-depth conversion kernel.
|
VX_KERNEL_CANNY_EDGE_DETECTOR |
The Canny Edge Detector.
|
VX_KERNEL_AND |
The Bitwise And Kernel.
|
VX_KERNEL_OR |
The Bitwise Inclusive Or Kernel.
|
VX_KERNEL_XOR |
The Bitwise Exclusive Or Kernel.
|
VX_KERNEL_NOT |
The Bitwise Not Kernel.
|
VX_KERNEL_MULTIPLY |
The Pixelwise Multiplication Kernel.
|
VX_KERNEL_ADD |
The Addition Kernel.
|
VX_KERNEL_SUBTRACT |
The Subtraction Kernel.
|
VX_KERNEL_WARP_AFFINE |
The Warp Affine Kernel.
|
VX_KERNEL_WARP_PERSPECTIVE |
The Warp Perspective Kernel.
|
VX_KERNEL_HARRIS_CORNERS |
The Harris Corners Kernel.
|
VX_KERNEL_FAST_CORNERS |
The FAST Corners Kernel.
|
VX_KERNEL_OPTICAL_FLOW_PYR_LK |
The Optical Flow Pyramid (LK) Kernel.
|
VX_KERNEL_REMAP |
The Remap Kernel.
|
VX_KERNEL_HALFSCALE_GAUSSIAN |
The Half Scale Gaussian Kernel.
|
Definition at line 55 of file vx_kernels.h.
The kernel attributes list.
Enumerator | |
---|---|
VX_KERNEL_ATTRIBUTE_PARAMETERS |
Queries a kernel for the number of parameters the kernel supports. Use a |
VX_KERNEL_ATTRIBUTE_NAME |
Queries the name of the kernel. Not settable. Use a |
VX_KERNEL_ATTRIBUTE_ENUM |
Queries the enum of the kernel. Not settable. Use a |
VX_KERNEL_ATTRIBUTE_LOCAL_DATA_SIZE |
The local data area allocated with each kernel when it becomes a node. Use a
|
VX_KERNEL_ATTRIBUTE_LOCAL_DATA_PTR |
The local data pointer allocated with each kernel when it becomes a node. Use a void pointer parameter. Use a |
Definition at line 734 of file vx_types.h.
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.
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
[in] | context | The reference to the implementation context. |
[in] | name | The string of the name of the kernel to get. |
0 | The kernel name is not found in the context. |
vxLoadKernels
if the kernel is not provided by the OpenVX implementation. vx_kernel VX_API_CALL vxGetKernelByEnum | ( | vx_context | context, |
vx_enum | kernel | ||
) |
Obtains a reference to the kernel using the vx_kernel_e
enumeration.
Enum values above the standard set are assumed to apply to loaded libraries.
[in] | context | The reference to the implementation context. |
[in] | kernel | A value from vx_kernel_e or a vendor or client-defined value. |
vx_kernel
. 0 | The kernel enumeration is not found in the context. |
vxLoadKernels
if the kernel is not provided by the OpenVX implementation. 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.
[in] | kernel | The kernel reference to query. |
[in] | attribute | The attribute to query. Use a vx_kernel_attribute_e . |
[out] | ptr | The pointer to the location at which to store the resulting value. |
[in] | size | The size of the container to which ptr points. |
vx_status_e
enumeration. VX_SUCCESS | No errors. |
VX_ERROR_INVALID_REFERENCE | If the kernel is not a vx_kernel . |
VX_ERROR_INVALID_PARAMETERS | If any of the other parameters are incorrect. |
VX_ERROR_NOT_SUPPORTED | If the attribute value is not supported in this implementation. |
Release the reference to the kernel. The object may not be garbage collected until its total reference count is zero.
[in] | kernel | The pointer to the kernel reference to release. |
vx_status_e
enumeration. VX_SUCCESS | No errors. |
VX_ERROR_INVALID_REFERENCE | If kernel is not a vx_kernel . |