Open VX Provisional Specification 1.0 (r23564)
-
Upload
the-khronos-group-inc -
Category
Technology
-
view
1.344 -
download
3
description
Transcript of Open VX Provisional Specification 1.0 (r23564)
The OpenVX™ [Provisional] Specification
Version 1.0
Document Revision: r23564Generated on Thu Oct 17 2013 12:39:29
Khronos Vision Working Group
Editor: Susheel GautamEditor: Erik Rainey
Copyright ©2013 The Khronos Group Inc.
i
Copyright ©2013 The Khronos Group Inc. All Rights Reserved.This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It
or any components may not be reproduced, republished, distributed, transmitted, displayed, broadcast or otherwiseexploited in any manner without the express prior written permission of Khronos Group. You may use this specifica-tion for implementing the functionality therein, without altering or removing any trademark, copyright or other noticefrom the specification, but the receipt or possession of this specification does not convey any rights to reproduce,disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part.
Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronosto copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE ismade for the specification and the latest available update of the specification for any version of the API is usedwhenever possible. Such distributed specification may be re-formatted AS LONG AS the contents of the specifi-cation are not changed in any way. The specification may be incorporated into a product that is sold as long assuch product includes significant independent work developed by the seller. A link to the current version of thisspecification on the Khronos Group web-site should be included whenever possible with specification distributions.
Khronos Group makes no, and expressly disclaims any, representations or warranties, express or implied, re-garding this specification, including, without limitation, any implied warranties of merchantability or fitness for aparticular purpose or non-infringement of any intellectual property. Khronos Group makes no, and expressly dis-claims any, warranties, express or implied, regarding the correctness, accuracy, completeness, timeliness, andreliability of the specification. Under no circumstances will the Khronos Group, or any of its Promoters, Contributorsor Members or their respective partners, officers, directors, employees, agents or representatives be liable for anydamages, whether direct, indirect, special or consequential damages for lost revenues, lost profits, or otherwise,arising from or in connection with these materials.
Khronos, DevU, StreamInput, glTF, WebGL, WebCL, COLLADA, OpenKODE, OpenVG, OpenVX, OpenSL ESand OpenMAX are trademarks of the Khronos Group Inc. ASTC is a trademark of ARM Holdings PLC, OpenCL isa trademark of Apple Inc. and OpenGL is a registered trademark and the OpenGL ES and OpenGL SC logos aretrademarks of Silicon Graphics International used under license by Khronos. All other product names, trademarks,and/or company names are used solely for identification and belong to their respective owners.
Contents
1 Introduction 21.1 Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 Scope of Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 Normative References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.5 Version/Change History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.6 Requirements Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.7 Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.7.1 Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.8 Glossary and Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.9 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Design Overview 52.1 Software Landscape . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2 Design Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2.1 Hardware Optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.2.2 Hardware Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3.1 Portability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3.2 Opaqueness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 OpenVX Framework Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.5 OpenVX Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5.1 Virtual Data Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.6 Graphs Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6.1 Linking Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.6.2 Node Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.6.3 Graph Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.6.4 Execution Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Asychronous Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.6.5 Graph Formalisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.6.6 Node Execution Independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.6.7 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.7 ”User” Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.7.1 Parameter Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.7.2 User Kernel Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.8 Callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.9 Immediate Mode Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.10 Kernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.10.1 Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.10.2 Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.11 Hinting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.12 Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.13 Lifecycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.13.1 OpenVX Context Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.13.2 Graph Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.13.3 Data Object Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
OpenVX Image Lifecycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
ii
CONTENTS iii
2.14 Host Memory Data Object Access Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.15 Code Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.15.1 OpenVX Example Code Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.16 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.16.1 User Node Tiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3 Module Documentation 223.1 OpenVX Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2 OpenVX Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.3 Object: Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
vx context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
vx context attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26vx import type e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27vx termination criteria e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.3.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27vxCreateContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27vxGetContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27vxQueryContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28vxReleaseContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28vxSetImmediateBorderMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.4 Object: Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.4.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
struct vx imagepatch addressing t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.4.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
vx image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.4.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
vx channel range e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33vx color space e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34vx image attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.4.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34vxAccessImagePatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34vxCommitImagePatch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36vxComputeImagePatchSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38vxCreateImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38vxCreateImageFromHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38vxCreateImageFromROI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39vxCreateUniformImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39vxCreateVirtualImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40vxCreateVirtualImageWithFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41vxFormatImagePatchAddress1d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41vxFormatImagePatchAddress2d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43vxGetValidRegionImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45vxQueryImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45vxReleaseImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46vxSetImageAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.5 Object: Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483.5.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
vx buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483.5.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
vx buffer attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.5.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
CONTENTS iv
vxAccessBufferRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49vxCommitBufferRange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50vxComputeBufferRangeSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50vxCreateBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50vxCreateBufferFromHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51vxCreateVirtualBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51vxQueryBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52vxReleaseBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.6 Object: Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.6.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
vx kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553.6.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
vx kernel attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55vx kernel e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.6.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63vxGetKernelByEnum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63vxGetKernelByName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64vxQueryKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64vxReleaseKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.7 Object: Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663.7.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
vx node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67vx nodecomplete f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.7.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67vx node attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.7.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67vxAssignNodeCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67vxCreateNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68vxQueryNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68vxReleaseNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69vxRetrieveNodeCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69vxSetNodeAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.8 Object: Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 723.8.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
vx action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72vx graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.8.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72vx action e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72vx graph attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
3.8.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73vxAddParameterToGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73vxCreateGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74vxGetGraphParameterByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74vxIsGraphVerified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75vxProcessGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75vxQueryGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76vxReleaseGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77vxScheduleGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77vxSetGraphParameterByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78vxVerifyGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78vxWaitGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.9 Object: Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803.9.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
vx parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
CONTENTS v
3.9.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81vx direction e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81vx parameter attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81vx parameter state e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.9.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81vxGetParameterByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81vxQueryParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82vxReleaseParameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82vxSetParameterByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83vxSetParameterByReference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.10 Object: Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.10.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
vx reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.10.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
vx reference attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.10.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
vxQueryReference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 853.11 Object: Pyramid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 873.11.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
vx pyramid attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883.11.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
vxCreatePyramid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88vxGetPyramidLevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88vxQueryPyramid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88vxReleasePyramid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
3.12 Object: Scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903.12.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
vx scalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903.12.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
vx scalar attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903.12.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
vxQueryScalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903.13 Object: Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 923.13.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
vx delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 923.13.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
vx delay attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933.13.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
vxAgeDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93vxAssociateDelayWithNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93vxCreateBufferDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94vxCreateImageDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94vxDissociateDelayFromNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95vxGetBufferFromDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95vxGetImageFromDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95vxQueryDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96vxReleaseDelay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.14 Object: Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973.14.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
struct vx target kernel t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973.14.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
vx target attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 983.14.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
CONTENTS vi
vxAssignNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98vxGetTargetByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98vxGetTargetByName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99vxQueryTarget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99vxReleaseTarget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.15 Framework: Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1013.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1013.15.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
vxAddLogEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101vxGetLogEntry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.16 Object: Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033.16.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
vx rectangle attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1033.16.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
vxAccessRectangleCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104vxCommitRectangleCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105vxCreateRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105vxQueryRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105vxReleaseRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106vxSetRectangleAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.17 Object: Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1073.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1073.17.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
vx coordinates attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1073.17.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
vxAccessCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107vxCommitCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108vxCreateCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108vxQueryCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108vxReleaseCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108vxSetCoordinatesAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.18 Object: Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1103.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1103.18.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
vx convolution attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1103.18.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
vxAccessConvolutionCoefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111vxCommitConvolutionCoefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111vxCreateConvolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111vxQueryConvolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112vxReleaseConvolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112vxSetConvolutionAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.19 Object: Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1133.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1133.19.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
vx distribution attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1133.19.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
vxAccessDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114vxCommitDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114vxCreateDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114vxQueryDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115vxReleaseDistribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.20 Object: Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1163.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1163.20.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
vx matrix attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1163.20.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
CONTENTS vii
vxAccessMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116vxCommitMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117vxCreateMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117vxQueryMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117vxReleaseMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
3.21 Object: Threshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1193.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1193.21.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
vx threshold attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119vx threshold type e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
3.21.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120vxCreateThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120vxQueryThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120vxReleaseThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120vxSetThresholdAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
3.22 Object: Keypoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1233.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1233.22.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
struct vx keypoint t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1233.22.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
vxAccessKeypoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123vxCommitKeypoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124vxCreateKeypoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124vxReleaseKeypoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
3.23 Object: LUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263.23.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
vx lut attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263.23.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
vxAccessLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126vxCommitLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127vxCreateLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127vxQueryLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128vxReleaseLUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
3.24 Object: List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1303.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1303.24.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
vx list attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131vx list iterator e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
3.24.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131vxAddListItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131vxCreateList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132vxEmptyList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132vxGetListItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132vxQueryList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133vxReleaseList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
3.25 Object: Remap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1343.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1343.25.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
vx remap attribute e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1343.25.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
vxCreateRemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135vxGetRemapPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136vxQueryRemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136vxReleaseRemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136vxSetRemapPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
3.26 Framework: Hint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1383.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
CONTENTS viii
3.26.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138vx hint e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
3.26.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138vxHint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
3.27 Framework: Directive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1403.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1403.27.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
vx directive e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1403.27.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
vxDirective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1403.28 Framework: Users Supplied Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
3.28.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1423.28.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
struct vx meta format t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1433.28.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
vx kernel deinitialize f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143vx kernel f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143vx kernel initialize f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143vx kernel input validate f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143vx kernel output validate f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144vx publish kernels f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
3.28.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145vxAddKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145vxAddParameterToKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145vxFinalizeKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146vxLoadKernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146vxRemoveKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147vxSetKernelAttribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
3.29 Framework: Performance Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1493.29.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1493.29.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
struct vx perf t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1493.30 OpenVX Helper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
3.30.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1503.30.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
struct vx kernel description t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150struct vx param description t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151struct vx parameter item t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
3.30.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151vxAddParameterToGraphByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151vxAlterRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152vxClearLog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152vxCreateNodeByStructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152vxFindTarget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153vxLinkParametersByIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153vxLinkParametersByReference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154vxSetAffineRotationMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
3.31 OpenVX Kernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1553.31.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
3.32 Kernel: Color Convert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573.32.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573.32.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
vxColorConvertNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157vxuColorConvert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
3.33 Kernel: Channel Extract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1593.33.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1593.33.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
vxChannelExtractNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
CONTENTS ix
vxuChannelExtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1593.34 Kernel: Channel Combine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.34.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1613.34.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
vxChannelCombineNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161vxuChannelCombine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.35 Kernel: Sobel 3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1633.35.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1633.35.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
vxSobel3x3Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163vxuSobel3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
3.36 Kernel: Magnitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1653.36.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1653.36.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
vxMagnitudeNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165vxuMagnitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
3.37 Kernel: Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1673.37.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1673.37.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
vxPhaseNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167vxuPhase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
3.38 Kernel: Scale Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1693.38.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1693.38.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
vxScaleImageNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169vxuHalfScaleGaussian3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170vxuScaleImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
3.39 Kernel: TableLookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1713.39.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1713.39.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
vxTableLookupNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171vxuTableLookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
3.40 Kernel: Histogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723.40.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723.40.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
vxHistogramNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172vxuHistogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
3.41 Kernel: Equalize Histogram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1733.41.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1733.41.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
vxEqualizeHistNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173vxuEqualizeHist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
3.42 Kernel: Absolute Difference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1743.42.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1743.42.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
vxAbsDiffNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174vxuAbsDiff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
3.43 Kernel: Mean and Standard Deviation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1753.43.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1753.43.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
vxMeanStdDevNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175vxuMeanStdDev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
3.44 Kernel: Thresholding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1773.44.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1773.44.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
vxThresholdNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177vxuThreshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
3.45 Kernel: Integral Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
CONTENTS x
3.45.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1793.45.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
vxIntegralImageNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179vxuIntegralImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
3.46 Kernel: Erode Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1803.46.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1803.46.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
vxErode3x3Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180vxuErode3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
3.47 Kernel: Dilate Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1813.47.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1813.47.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
vxDilate3x3Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181vxuDilate3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
3.48 Kernel: Median Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1823.48.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1823.48.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
vxMedian3x3Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182vxuMedian3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
3.49 Kernel: Box Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1833.49.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1833.49.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
vxBox3x3Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183vxuBox3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
3.50 Kernel: Gaussian Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1843.50.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1843.50.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
vxGaussian3x3Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184vxuGaussian3x3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
3.51 Kernel: Custom Convolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1853.51.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1853.51.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
vxConvolveNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185vxuConvolve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
3.52 Kernel: Image Pyramid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1873.52.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1873.52.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
vxPyramidNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187vxuPyramid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
3.53 Kernel: Accumulate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1893.53.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1893.53.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
vxAccumulateImageNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189vxuAccumulateImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
3.54 Kernel: Accumulate Weighted . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1903.54.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1903.54.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
vxAccumulateWeightedImageNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190vxuAccumulateWeightedImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
3.55 Kernel: Accumulate Squared . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1923.55.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1923.55.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
vxAccumulateSquareImageNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192vxuAccumulateSquareImage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
3.56 Kernel: Min, Max Location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1933.56.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1933.56.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
vxMinMaxLocNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
CONTENTS xi
vxuMinMaxLoc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1933.57 Kernel: Bitwise And . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
3.57.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1953.57.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
vxAndNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195vxuAnd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
3.58 Kernel: Bitwise Inclusive Or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1973.58.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1973.58.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
vxOrNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197vxuOr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
3.59 Kernel: Bitwise Exclusive Or . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1993.59.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1993.59.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
vxuXor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199vxXorNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
3.60 Kernel: Bitwise Not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2013.60.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2013.60.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
vxNotNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201vxuNot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
3.61 Kernel: Pixel-wise Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2023.61.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2023.61.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
vxMultiplyNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202vxuMultiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
3.62 Kernel: Arithmetic Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2043.62.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2043.62.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
vxAddNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204vxuAdd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
3.63 Kernel: Arithmetic Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2063.63.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2063.63.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
vxSubtractNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206vxuSubtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
3.64 Kernel: Convert Bit depth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2083.64.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2083.64.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
vxConvertDepthNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208vxuConvertDepth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
3.65 Kernel: Canny Edge Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2103.65.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2103.65.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
vx norm type e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2113.65.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
vxCannyEdgeDetectorNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211vxuCannyEdgeDetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
3.66 Kernel: Warp Affine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2133.66.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2133.66.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
vxuWarpAffine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213vxWarpAffineNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
3.67 Kernel: Warp Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2153.67.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2153.67.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
vxuWarpPerspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215vxWarpPerspectiveNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
CONTENTS xii
3.68 Kernel: Harris Corners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2173.68.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2173.68.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
vxHarrisCornersNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217vxuHarrisCorners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
3.69 Kernel: Fast Corners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2193.69.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2193.69.2 Segment Test Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2193.69.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
vxFastCornersNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220vxuFastCorners . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
3.70 Kernel: Optical Flow Pyramid (LK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2213.70.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2213.70.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
vxOpticalFlowPyrLKNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222vxuOpticalFlowPyrLK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
3.71 Kernel: Remap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2253.71.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2253.71.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
vxRemapNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225vxuRemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
3.72 Node: Border Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2273.72.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2273.72.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
struct vx border mode t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2273.72.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
vx border mode e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2273.73 OpenVX Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
3.73.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2313.73.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
vx status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2313.73.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
vx bool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232vx channel e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232vx convert policy e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232vx enum e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233vx fourcc e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233vx interpolation type e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234vx status e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234vx type e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
3.74 OpenVX Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2373.74.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2373.74.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
VX ENUM BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237VX FMT REF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237VX FMT SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237VX FOURCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237VX SCALE UNITY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
3.75 OpenVX Defines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2393.75.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2393.75.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
VX TYPE MASK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239VX VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239VX VERSION MAJOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239VX VERSION MINOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
3.76 OpenVX Vendors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2403.76.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2403.76.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
CONTENTS 1
vx vendor id e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2403.77 OpenVX Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
3.77.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2423.77.2 Data Structure Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
struct vx graph factory t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2433.77.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
vx factory name e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2433.77.4 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
factories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2433.78 Example: User Defined Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
3.78.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2443.78.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
xyz params e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2443.78.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
vxPublishKernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244XYZDeinitialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245XYZInitialize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245XYZInputValidator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246XYZKernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246XYZOutputValidator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
4 Data Structure Documentation 2484.1 vx tiling kernel t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
4.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2484.1.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248border . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248enumeration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248input validator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249nbhd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249num params . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249output validator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
5 Example Documentation 2505.1 vx eyetrack.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2505.2 vx factory corners.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2515.3 vx factory edge.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2525.4 vx factory pipeline.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2535.5 vx helper.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2555.6 vx parameters.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2585.7 vx tiling add.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2595.8 vx tiling alpha.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2605.9 vx tiling box.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2605.10 vx tiling ext.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2615.11 vx tiling gaussian.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2655.12 vx tiling main.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2665.13 vx xyz ext.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2685.14 xyz module.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Chapter 1
Introduction
1.1 Abstract
OpenVX is a low level programming framework for the Computer Vision domain. OpenVX has been designed forsupporting modern hardware systems such as mobile and embedded SoCs, and desktop systems. These systemsare typically parallel and heterogeneous. They can contain a combination of multi-core CPUs, DSP subsystems,GPUs, dedicated vision computing fabrics, and hardwired functions. Their memory hierarchy can be complex,distributed, and not fully consistent across the system.
By the abstractions it provides, OpenVX intends to maximize performance portability across these hardwareplatforms and thus to provide high-level vision frameworks with a means to address, efficiently, current and futurehardware systems with minimal impact on application source code. OpenVX contains
• a library of useful predefined or customizable vision functions,
• a graph-based execution model enabling task- and data-independent execution, as well as data tiling opti-mization extensions,
• a set of specific memory objects that abstract the physical memory layout and location.
Since the computer vision domain is still evolving fast, OpenVX provides an extensibility mechanism with user-defined functions that can be added to the application graph.
OpenVX consists of a C API for building, verifying, coordinating graphs execution, and for accessing memoryobjects. OpenVX also defines a vxu utility library which exposes each OpenVX predefined function as a C functionthat can be called directly, without creating a graph. The vxu does not benefit from the optimizations enabled bygraphs, however, it can be used as a first, and simpler, optimization step by computer vision programmers.
1.2 Purpose
The purpose of this document is to detail the Application Programming Interface (API) for OpenVX.
1.3 Scope of Specification
The scope of this document is to provide the standard by which an implementation of OpenVX will be judged to beconformant from an interface (API) point of view. This document does not contain the conformance standards foreach kernel.
1.4 Normative References
The section ”Module Documentation” forms the normative part of the specification. Each API definition provided inthat chapter has certain preconditions and postconditions specified that are normative. If these normative conditionsare not met, the behavior of the function is undefined.
2
CHAPTER 1. INTRODUCTION 3
1.5 Version/Change History
• 1.0 ALPHA - September 24, 2013 - Provisional Specification sent to Promoter Board for review.
• 1.0 BETA - November 30, 2013 - Provisional Specification Ratified.
• 1.0 - ??? 2014 - Final Specification Ratified.
1.6 Requirements Language
In this specification, ’shall’ or ’must’ is used to express a requirement that is binding, ’should’ is used to expressdesign goals or recommended actions, and ’may’ is used to express an allowed behavior. All other text is explanatoryor provided for information only.
1.7 Typographical Conventions
Italics are used in this specification to denote an emphasis on a particular concept or to denote an abstraction of aconcept.
Bold words indicate warnings or strongly communicated concepts which are intended to draw attention to thetext.
Throughout this specification, code examples may be given to highlight a particular issue. They will be givenusing the format as shown below:
/* Example Code Section */int main(int argc, char *argv[]){
return 0;}
1.7.1 Naming Conventions
Opaque objects and atomics are named as vx object, e.g., vx image or vx uint8, with an underscoreseparating the object name from the ”vx” prefix.
Defined Structures are named as vx struct t, e.g., vx imagepatch addressing t, with underscoresseparating the structure from the ”vx” prefix and a ”t” to denote that it is a structure.
Defined Enumerations are names as vx enum e, e.g., vx type e, with underscores separating the enumer-ation from the ”vx” prefix and an ”e” to denote that it is an enumerated value.
Application Programmer’s Interfaces are named vxSomeFunction() with camel-casing and no underscores,e.g., vxCreateContext().
Kernels also have a naming convention that follows a lower-case inverse dotted hierarchy similar to Java Pack-ages, e.g.:
"org.khronos.openvx.color convert".
This is done in order to minimize the possibility of name collisions and to promote sorting and readability whenquerying the namespace of available kernels. Each kernel should have a unique dotted name of the style: tld.-vendor.library.kernel. The hierarchy of such kernel namespaces is undefined outside the subdomain ”org.khronos”,but should follow existing international standards. For OpenVX-specified kernels, the ”kernel” section of the uniquename is not camel-cased and uses underscores to separate words.
1.8 Glossary and Acronyms
• FOURCC: a 32-bit representation of an image format which is a combination of four 8-bit character codes.
• Atomic: The specification will occasionally mention ”atomics” which is used to mean a C primitive data type.Usages which have additional wording such as ”atomic operations” do not carry this meaning.
• Kernel: OpenVX uses the term ”kernel” to mean a computer vision function, not an Operating System kernel.
• Framework: Term used to refer to an implementation of an API.
CHAPTER 1. INTRODUCTION 4
• Engine: Term used to refer to an implementation of an API.
• API: Application Programming Interface that specifies how a software component interacts with another.
1.9 Acknowledgements
Without the contributions from this partial list of the follow individuals from the Khronos Working Group and thecompanies which they represented at the time, this specification would not be possible:
• Erik Rainey - Texas Instruments, Inc.
• Susheel Gautam - QUALCOMM
• Victor Eruhimov - Itseez
• Doug Knisely - QUALCOMM
• Frank Brill - NVIDIA
• Kari Pulli - NVIDIA
• Tomer Schwartz - Broadcom Corporation
• Shervin Emami - NVIDIA
• Thierry Lepley - STMicroelectronics International NV
• Olivier Pothier - STMicroelectronics International NV
• Andy Kuzma - Intel
• Shorin Kyo - Renesas Electronics
• Renato Grottesi - ARM Limited
• Dave Schreiner - ARM Limited
• Chris Tseng - Texas Instruments, Inc.
• Daniel Laroche - Cognivue Corporation
• Andrew Garrard - Samsung Electronics
• Tomer Yanir - Samsung Electronics
• Erez Natan - Samsung Electronics
• Chang-Hyo Yu - Samsung Electronics
• Hans-Peter Nilsson - Axis Communications
• Stephen Neuendorffer - Xilinx, Inc.
• Amit Shoham - BDTi
• Paul Buxton - Imagination Technologies
• Yuki Kobayashi - Renesas Electronics
• Cormac Brick - Movidius Ltd
• Mikael Bourges-Sevenier - Aptina Imaging Corporation
• Tao Zhang - QUALCOMM
Chapter 2
Design Overview
2.1 Software Landscape
OpenVX is intended to used either as purely the acceleration layer of many commonly-used Computer VisionFramework and/or Engines, or directly from applications when the need suites. In most cases existing APIs fromvarious sources are already present and OpenVX would be accessed from within these existing APIs. Applicationswhich are performance sensitive may want to consider refactoring their Computer Vision algorithms to accomodateusing this API.
Computer VisionApplications
High-LevelVision Framework
ISV VisionEngines
OpenVX
VendorHardware
Figure 2.1: OpenVX Usage Overview
5
CHAPTER 2. DESIGN OVERVIEW 6
2.2 Design Objectives
This specification was designed as a Framework of standardized Computer Vision functions (or kernels) designedto run on a wide variety of platforms which are intended to be accelerated by a Vendor’s implementation on thatplatform. OpenVX is intended to improve the performance (in a variety of meanings) of vision applications bycreating an abstraction for commonly-used vision kernels, and an abstraction for combinations of kernels (a ’graph’)and minimizing run-time overhead.
These required kernels cover common use cases required by vision applications (e.g. object detection).
2.2.1 Hardware Optimizations
Vendors may choose to achieve this design objective through parallelism and/or specialized hardware offload tech-niques or any number of other methods. This specification makes no statements as to what methodology is re-quired. This specification also makes no statement or requirements on a ”level of performance” as this may varywildly across platforms.
2.2.2 Hardware Limitations
The focus is on kernels which are commonly known to lend themselves to an appreciable level of hardware basedoptimization. Future versions of this specification may adopt more kernels as part of the standard based on abroadly-available set of hardware able to accelerate said kernels.
2.3 Assumptions
2.3.1 Portability
It is assumed that there is an upper limit to the portability of a framework across various platforms and environments.The intent is to obtain the most possible portability, while recognizing that this API is intended to be used on specificdevices which have specific requirements. Tradeoffs are made for portability where possible. For example, portableGraphs constructed using this API should work on any OpenVX implementation and return similar results within thebounds of the conformance tests.
2.3.2 Opaqueness
The API is designed to be opaque in order to not force hardware-specific requirements into any particular implemen-tation. OpenVX is intended to address a very broad range of devices, platforms, and uses; everything from deeplyembedded to desktop, and even to the distributed computing. The range of implementations are quite different andas such, the API shall only address all these spaces through opaqueness.
For example, the API does not want to dictate byte packing or alignment for structures on architectures whichpotentially may not be able to comply and thereby require the implementor to track two structures (one that maps tothe hardware alignment and one that does not).
To avoid this issue, the API does not specify memory layout of opaque objects.This specification does not dictate any requirements on memory allocation methods for opaque data objects.
All data, except user-facing structures, are opaque and hidden behind a reference which may be as thin or thick asan implementation needs. Each implementation provides the standardized interfaces for accessing data that takescare of specialized hardware, platform, or allocation requirements. Memory which is ”imported” or ”shared” fromother APIs is not subsumed by OpenVX and is still maintained and accessible by the originator.
2.4 OpenVX Framework Objects
• Object: Context - The OpenVX context is the object domain for all OpenVX objects. All data objects ”live”in the context as well as all framework objects. The OpenVX context keeps reference counts on all objectsand must do garbage collection during its deconstruction to free lost references. While multiple clients mayconnect to the OpenVX context, all data is private in that the references which refer to data objects are givenonly to the creating party. Multiple targets share the same Context within OpenVX to enable shared data forcomputation.
CHAPTER 2. DESIGN OVERVIEW 7
• Object: Kernel - The individual computer vision function, such as a ”Sobel Gradient” or ”Lucas Kanade FeatureTracking”. This does not refer to HLOS kernels, such as the Linux Kernel. A single function may implementmany features, but this constitutes a single kernel as long as it is contained in a single function.
• Object: Target - A target is any configuration of hardware device(s) which shall execute OpenVX kernels. Avendor may arrange multiple configurations of the same hardware or have multiple hardware targets. Thisarrangement or usage of hardware for targets is completely left to the vendor to decide. The clients of Open-VX must be able to query the implementation to discover what targets are available. The returned informationis vendor specific.
• Object: Parameter - Abstract input, output, or bidirectional data object passed to a computer vision kernel.This object contains the signature of that parameter’s usage from the kernel description. This informationincludes:
– Signature Index - The numbered index of the parameter in the signature.
– Object Type - e.g. VX TYPE IMAGE or VX TYPE BUFFER or some other object type from vx type-e.
– Usage Model - e.g. VX INPUT, VX OUTPUT, or VX BIDIRECTIONAL.
– Presence State - e.g. VX PARAMETER STATE REQUIRED, or VX PARAMETER STATE OPTION-AL.
• Object: Node - A node is an instance of a kernel which will be paired with a specific set of references. Nodesare created from and associated with a single graph only.
• Object: Graph - A set of nodes connected in a directed (only goes one-way) acyclic (does not loop back)fashion. A Graph may have sets of Nodes which are unconnected to other sets of Nodes within the sameGraph. See Graph Formalisms.
2.5 OpenVX Data Objects
• Object: Image An opaque image object which may be some format in vx fourcc e.
• Object: Buffer An opaque buffer object which could be an array of primitive data types, a structure or an arrayof structures.
• Object: Scalar An opaque object which contains a single primitive data type.
• Object: Coordinates An opaque object which contains N dimensional array of vx int32 values.
• Object: Convolution An opaque object which contains MxN matrix of vx int16 values. Also contains ascaling factor for normalization. Used specifically with vxuConvolve and vxConvolveNode.
• Object: Matrix An opaque object which contains MxN matrix of some scalar values.
• Object: LUT An opaque lookup table object used with vxTableLookupNode and vxuTableLookup.
• Object: List An opaque list object which shall contain other objects.
• Object: Rectangle An opaque rectangle object which contains a starting and ending coordinate bound withinsome vx image pixel space.
• Object: Threshold An opaque object which contains the thresholding configuration.
• Object: Pyramid An opaque object which contains multiple levels of scaled vx image objects.
• Object: Delay An opaque object which contains a manually control temporally-delayed list of objects.
CHAPTER 2. DESIGN OVERVIEW 8
2.5.1 Virtual Data Objects
Some data objects may not be accessed by clients of OpenVX and are purely present for the purpose of declaringdata dependencies between nodes in a graph. The contents of such data objects are never accessed by the client.To further optimize graphs with these properties, virtual data objects may be used to create the data dependenciesbetween two or more nodes. Virtual data has several properties apart from other data objects
• Inaccessible - No calls to an Access/Commit API shall succeed given a reference to an object created througha Virtual create function from a Graph external perspective. Calls to Access/Commit from within User Sup-plied Nodes may succeed as they are Graph internal.
• Dimensionless or Formatless - Virtual data objects may return zeros or generic values for formats whenqueried.
• Optimizations - Virtual data may not actual be created during Graph execution and therefore may be of zerosize.
2.6 Graphs Concepts
The graph is the central computation concept of the OpenVX Frameworking Layer. The purpose of using Graphs toexpress the Computer Vision problem is to allow for the possibility of any implementation to maximize its optimizationpotential because all the operations of the Graph and its dependencies are known ahead of time, before the graphis processed.
Graphs are composed of one or more Nodes which are added to the Graph through Node creation functions.Graphs in OpenVX must be created ahead of processing time, verified by the implementation at time of processingor by a call to vxVerifyGraph and can then be processed later.. Verified graphs may be processed as manytimes as needed.
2.6.1 Linking Nodes
Graph Nodes are linked together via data dependencies with no explicitly-stated ordering. The same referencemay be linked to other nodes. Linking has a limitation however, in that only one node in a graph may output to anyspecific data object reference. That is, only a single writer of an object may exist in a given graph. This preventsindeterminate ordering from data dependencies. All writers in a graph shall produce output data before any readerof that data accesses it.
2.6.2 Node Parameters
Parameters to node creation functions are defined as either atomic types, such as vx int32, vx enum, or asobjects, such as vx scalar, vx image. The atomic variables of the Node creation functions shall be convertedby the framework into vx scalar references for use by the Nodes. All node parameter objects may be modifiedby retrieving the reference to the vx parameter via vxGetParameterByIndex, then passing that to vx-QueryParameter to retrieve the reference to the object.
vx parameter param = vxGetParameterByIndex(node, p);vx reference ref;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &ref, sizeof(ref));
If the type of the parameter is unknown, it may be retrieved with the same function.vx enum type;vxQueryParameter(param, VX PARAMETER ATTRIBUTE TYPE, &type, sizeof(type));/* cast the ref to the correct vx <type>. Atomics are now vx scalar */
2.6.3 Graph Parameters
Parameters may exist on Graphs as well. These parameters are defined by the author of the Graph and each Graphparameter is defined as a specific parameter from a Node within the Graph using vxAddParameterToGraph.Graph parameters are used to communicate to the implementation that there are specific Node parameters whichmay be modified by the client between Graph executions. Additionally they are parameters which the client may setwithout the reference to the Node, but with the reference to the Graph using vxSetGraphParameterByIndex.This allows for the Graph authors to construct Graph Factories. How these methods work falls outside the scopeof this document, but an example Graph Factory is provided for informative reasons in the Example section. Seevx graph factory.c.
CHAPTER 2. DESIGN OVERVIEW 9
2.6.4 Execution Model
Graphs must execute in both Synchronous blocking mode (in that vxProcessGraph will block until the graph hascompleted) and in Asychronous single-issue-per-reference mode (via vxScheduleGraph and vxWaitGraph).
Asychronous Mode
In asynchronous mode, Graphs must be single issue per reference. This means that given a constructed graphreference g1, it may be scheduled multiple times but will only execute sequentially with respect to itself. Multiplegraphs references given to the asynchronous graph interface do not have a defined behavior and may execute inparallel or series based on the behavior or the vendor’s implementation.
2.6.5 Graph Formalisms
In order to use graphs several rules must be put in place to allow deterministic execution of Graphs. The behaviorof a processGraph(G) call is determined by the structure of the Processing Graph G. The Processing Graph is abipartite graph consisting of a set of Nodes N1..Nn and a set of data objects d1..di. Each edge (Nx, Dy) in the graphrepresents a data object Dy that is written by Node Nx and each edge (Dx, Ny) represents a data object Dx that isread by Node Ny. Each edge e has a name Name(e), which gives the parameter name of the node that referencesthe corresponding data object. Each Node Parameter also as a type Type(node, name) in {INPUT, OUTPUT, INO-UT}. Some data objects are ’Virtual’, and some data objects are ’Delay’. ’Delay’ data objects are just collectionsof data objects with indexing (like an image list) and known linking points in a graph. A node may be classified asa ’head node’, which has no backward dependency. Alternatively, a node may be a ’dependent node’ which has abackward dependency to the ’head node’. In addition, the Processing Graph has several restrictions:
1. (Output typing) Every output edge (Nx, Dy) requires Type(Nx, Name(Nx, Dy)) in {OUTPUT, INOUT}
2. (Input typing) Every input edge (Ix, Dy) requires Type(Ny, Name(Dx, Ny)) in {INPUT} or {INOUT}
3. (Single Writer) Every data object is the target of at most one output edge.
4. (Broken Cycles) Every cycle in G must contain at least input edge (Dx, Ny) where Dx is Delay.
5. (Virtual images must have a source) If Dy is Virtual, then there is at least one output edge that writes Dy (Nx,Dy)
6. (Bidirectional data objects shall not be virtual) If Type(Nx, Name(Nx, Dy)) is INOUT implies Dy is non-Virtual.
7. (Delay data objects shall not be virtual) If Dx is Delay then it shall not be Virtual.
The execution of each node in a graph consists of an atomic operation (sometimes referred to as ’firing’) thatconsumes data representing each input data object, processes it, and produces data representing each outputdata object. A node may execute when all of its input edges are marked ’present’. Before the graph executes, thefollowing initial marking is used:
• all input edges (Dx, Ny) from non-Virtual objects Dx are marked (presumably these must be set by the userbefore calling processGraph)
• all input edges (Dx, Ny) with an output edge (Nz, Dx) are unmarked
• all input edges (Dx, Ny) where Dx is a delay data object are marked
Processing a node results in unmarking all the corresponding input edges and marking all its output edgesmarking an output edge (Nx, Dy) where Dy is not a Delay results in marking all of the input edges (Dy, Nz).Following these rules, it is possible to statically schedule the nodes in a graph as follows: Construct a precedencegraph P, including all the nodes N1..Nx, and an edge (Nx, Nz) for every pair of edges (Nx, Dy) and (Dy, Nz) whereDy is not a delay. Then unconditionally fire each node according to any topological sort of P.
Following assertions should be verified:
• P is a DAG (implied by 4 and the way it is constructed)
• Every data object has a value when it is executed (implied by 5, 6, 7, and the marking)
• Execution is deterministic if the nodes are deterministic (implied by 3, 4, and the marking)
CHAPTER 2. DESIGN OVERVIEW 10
• Every node completes its execution exactly once
The execution model described here just acts as a formalism. For example, independent processing is allowedacross multiple depended and depending nodes and edges, provided that the result is invariant with the executionmodel described here.
2.6.6 Node Execution Independence
In this example a client computes the gradient magnitude and gradient phase from a blurred input image. The vx-MagnitudeNode and vxPhaseNode are independently computed, in that each does not depend on the outputof the other. OpenVX does not mandate that they are run simultaneously or in parallel but it could be implementedthis way by the vendor of the OpenVX implementation.
LumaExtract
VirtualImage
Blur
VirtualImage
Gradients
VirtualImage
VirtualImage
Magnitude
FOURCC_U8Image
Phase
FOURCC_U8Image
UYVYImage
Figure 2.2: A simple graph with some independent nodes.
The code to construct such a graph with by explicitly stating data dependencies is:
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
CHAPTER 2. DESIGN OVERVIEW 11
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/#include <VX/vx.h>
vx status run example parallel(void){
vx status status = VX SUCCESS;vx context context = vxCreateContext();if (context){
vx image images[] = {vxCreateImage(context, 640, 480, FOURCC UYVY),vxCreateImage(context, 640, 480, FOURCC U8),
};vx image virts[] = {
vxCreateVirtualImage(context),vxCreateVirtualImage(context),vxCreateVirtualImage(context),vxCreateVirtualImage(context),vxCreateVirtualImage(context),
};vx graph graph = vxCreateGraph(context);if (graph){
vx node nodes[] = {vxChannelExtractNode(graph, images[0],
VX CHANNEL Y, virts[0]),vxGaussian3x3Node(graph, virts[0], virts[1]),vxSobel3x3Node(graph, virts[1], virts[2], virts[3]),vxMagnitudeNode(graph, virts[2], virts[3], virts[4]),vxPhaseNode(graph, virts[2], virts[3], virts[5]),
};status = vxVerifyGraph(graph);if (status == VX SUCCESS){
status = vxProcessGraph(graph);}/* typically you would destroy all nodes too */vxReleaseGraph(&graph);
}/* typically you would destroy all images too */vxReleaseContext(&context);
}return status;
}
2.6.7 Verification
Graphs within OpenVX must go through a rigorous validation process before execution in order to satify the designconcept of eliminating run-time overhead (parameter checking) which will guarantee safe execution of the graph.OpenVX must check for (but is not limited to) these conditions:
• Parameters To Nodes:
– Each required parameter is given to the node (vx parameter state e). Optional parameters may not bepresent and therefore are not checked when absent. If present, they are checked.
– Each parameter given to a node must be of the right ”direction” (a value from vx direction e).
– Each parameter given to a node must be of the right ”object type” (from the object range of vx type e).
– Each parameter attribute or value which has algorithmic significance must be verified. In the case of ascalar value, it may need to be ranged checked (e.g. 0.5 <= k <= 1.0). In the case of vxScale-ImageNode, the relation of the input image dimensions to the output image dimensions determinesthe scaling factor. These values or attributes of data objects must be checked for compatibility on eachplatform.
– Graph Connectivity - the vx graph must be a DAG (Directed, Acyclic Graph). No cycles, or feedbackis allowed. The vx delay object has been designed to explicitly address feedback between Graphexecutions.
– Resolution of Virtual Data Objects - Any changes to Virtual data objects from unspecified to specificformat or dimensions, as well as the related creation of objects of specific type that are observable atprocessing time takes place at Verification time.
CHAPTER 2. DESIGN OVERVIEW 12
2.7 ”User” Nodes
OpenVX supports the concept of client-supplied functions or User-Supplied Nodes which shall be executed frominside the Graph or are Graph internal. The purpose of this paradigm is to further exploit independent operation ofnodes within the OpenVX platform.
LumaExtract
VirtualImage
Blur
VirtualImage
Gradients
VirtualImage
VirtualImage
Magnitude
VirtualImage
Phase
VirtualImage
vxMyKernelNode(User)
FOURCC_U8Image
vxMyFilterNode(User)
VirtualImage
UYVYImage
Figure 2.3: A graph with user nodes which are independent of the ”base” nodes.
In this example, the graph does not have to be halted to execute client-supplied nodes and then resumed. Thesenodes shall be executed in an independent fashion with respect to independent base nodes within OpenVX. Thisallows implementations to further minimize execution time if hardware to exploit this property exists.
2.7.1 Parameter Validation
User nodes must aid in the Graph Verification effort by providing explicit validation functions for each kernel theyimplement. Each parameter passed to the user node will be validated using the client-supplied validation functions.In this case, the client must check these additional attributes or values of each parameter:
• If an attribute or value of the parameter has algorithmic significance, it must be checked. For example, thesize of buffer, or the value of a scalar to be within a range, or a dimensionality constraint of an image suchas width divisibility (some implementations must have image pixel width be evenly divisible by some fixednumber).
• If the output parameters depend on attributes or values from input parameters, those relationships must bechecked (typically within the output validator).
CHAPTER 2. DESIGN OVERVIEW 13
2.7.2 User Kernel Naming Conventions
Users kernels must be export with a unique name (see Naming Conventions for information on OpenVX conven-tions) and a unique enumeration. Clients of OpenVX may use either the name or enumeration to retrieve a kernel,so collisions will cause problems. For kernel authors, the enumerations may be extended by following this example:
#define VX LIBRARY XYZ (0x3)
enum vx kernel xyz ext e {VX KERNEL KHR XYZ = VX KERNEL BASE(VX ID KHRONOS, VX LIBRARY XYZ) + 0x0,
};
Each vendor of a kernel or an implementation must apply to Khronos to get a unique identifier (up to a limit of 212−1vendors). Until they obtain a unique ID vendors must use VX ID DEFAULT.
In order to construct a kernel enumeration, a vendor must have both their ID and a library ID. The library ID’s arecompletely vendor defined (however when using the VX ID DEFAULT ID, many libraries may collide in namespace).
Once both are defined, a kernel enumeration may be constructed using the VX KERNEL BASE macro and anoffset (optional, but very helpful for long enumerations).
2.8 Callbacks
Callbacks are a method to control graph flow and to make decisions based on completed work. The vxAssign-NodeCallback call takes as a parameter a callback function. This function will be called after the execution ofthe particular node, but prior to the completion of the graph. If nodes are arranged into independent sets, the orderof the callbacks in unspecified. Nodes which are arranged in a serial fashion due to data dependencies will performcallbacks in order. The callback function may use the node reference to extract parameters from the node, thenextract the data references. Data outputs of Nodes with callbacks shall be available (via Access/Commit methods)when the callback is called.
The callback must return a vx action code which indicates how the graph processing should proceed.
• If VX ACTION CONTINUE is returned, the graph will continue execution with no changes.
• If VX ACTION ABANDON is returned, all further nodes following this node in the graph will not execute.Executions of nodes in independent branches of the graph are unspecificied.
• If VX ACTION RESTART is returned, all further nodes following this node of the graph will not execute.Executions of nodes in independent branches of the graph are unspecificied. Once the graph halts it willrestart execution.
2.9 Immediate Mode Functions
OpenVX also contains an interface defined within <VX/vxu.h> which allows for immediate execution of ker-nels. These interfaces are prefixed with vxu to distinguish them from the Node interfaces which are of the formvx<Name>Node. Each of these interfaces replicates a Node interface with some exceptions, notably vxuHalf-ScaleGaussian3x3. Immediate mode functions are defined to behave as Single Node Graphs, which have noleaking side-effects (e.g. no Log entries) within the Graph Framework after the function returns. The following Ker-nel tables refer to both the Immediate Mode and Graph Mode kernels. The Module documentation for each Kerneldraws a distinction on each API by noting that it is either an immediate mode function with the tag [Immediate] or itis a Graph mode function by the tag [Graph].
2.10 Kernels
OpenVX comes with a standard or ”base” set of kernels. The following table indicates the supported set of ker-nel, their input (first set of types) and output (second set) types and the version of OpenVX from which they aresupported.
2.10.1 Inputs
CHAPTER 2. DESIGN OVERVIEW 14
Kernel U8 U16 S16 S32 U32 F32 4CCAbsDiff 1.0Accumu-late
1.0
Accumulate-Squared
1.0
Accumulate-Weighted
1.0
Add 1.0 1.0And 1.0Box3x3 1.0Canny-Edge-Detector
1.0
Channel-Combine
1.0
Channel-Extract
1.0
Channel-ExtractRef
1.0
Color-Convert
1.0
Convert-Image-Depth
1.0 1.0
Convolve 1.0Dilate3x3 1.0Equalize-Histogram
1.0
Erode3x3 1.0Fast-Corners
1.0
Gaus-sian3x3
1.0
Harris-Corners
1.0
HalfScale-Gaussian3x3
1.0
Histogram 1.0Integral-Image
1.0
Inv 1.0Table-Lookup
1.0
Magnitude 1.0MeanStd-Dev
1.0
CHAPTER 2. DESIGN OVERVIEW 15
Median3x3 1.0MinMax-Loc
1.0 1.0
Multiply 1.0 1.0Optical-FlowLK
1.0
Or 1.0Phase 1.0Pyramid 1.0Remap 1.0Scale-Image
1.0
Sobel3x3 1.0Subtract 1.0 1.0Threshold 1.0Undistort 1.0WarpAffine 1.0Warp-Perspective
1.0
Xor 1.0
2.10.2 Outputs
Kernel U8 U16 S16 U32 S32 F32 4CCAbsDiff 1.0Accumu-late
1.0
Accumulate-Squared
1.0
Accumulate-Weighted
1.0
Add 1.0 1.0And 1.0Box3x3 1.0Canny-Edge-Detector
1.0
Channel-Combine
1.0
Channel-Extract
1.0
Channel-ExtractRef
1.0
Color-Convert
1.0
Convert-Image-Depth
1.0 1.0
Convolve 1.0 1.0Dilate3x3 1.0Equalize-Histogram
1.0
CHAPTER 2. DESIGN OVERVIEW 16
Erode3x3 1.0Fast-Corners
1.0
Gaus-sian3x3
1.0
Harris-Corners
1.0
HalfScale-Gaussian3x3
1.0
Histogram 1.0Integral-Image
1.0
Inv 1.0Table-Lookup
1.0
Magnitude 1.0MeanStd-Dev
1.0
Median3x3 1.0MinMax-Loc
1.0 1.0 1.0
Multiply 1.0 1.0Optical-FlowLK
1.0
Or 1.0Phase 1.0Pyramid 1.0 1.0Remap 1.0Scale-Image
1.0
Sobel3x3 1.0Subtract 1.0 1.0Threshold 1.0Undistort 1.0WarpAffine 1.0Warp-Perspective
1.0
Xor 1.0
2.11 Hinting
The specification defines a Hinting API which allows programmer preferences to be fed to the implementation. SeeFramework: Hint. It is assumed that most of the hints will be vendor or implementation specific. Check with thevendor of the implementation of OpenVX for information on vendor-specific extensions.
2.12 Directives
The specification defines a Directive API to control implementation behavior. This may allow things like disablingparallelism for debugging, enabling cache writing-through for some buffers, or any implementation-specific optimiza-tion.
2.13 Lifecycles
2.13.1 OpenVX Context Lifecycle
The lifecycle model for an OpenVX vx context.
CHAPTER 2. DESIGN OVERVIEW 17
Client OpenVX
vxCreateContext()
vx_context context
all calls to OpenVX
vxReleaseContext(&context)
2.13.2 Graph Lifecycle
The OpenVX has four main phases of graph lifecycle:
• Construction - Graphs are created, Nodes are connected together by setting parameters.
• Verification - The graphs are checked for consistency, correctness and other conditions. Memory allocationmay occur.
• Execution - The graphs are executed via vxProcessGraph or vxScheduleGraph. Between executionsdata may be updated by the client or external mechanism. The client of OpenVX may change reference ofinput data to a graph, but this may require the graph to be validated again.
• Deconstruction - Graphs are Released. All Nodes in the Graph are released.
Graph Construction
Graph Verification
Graph Execution data updates
Graph Deconstruction
Figure 2.4: Graph Lifecycle
CHAPTER 2. DESIGN OVERVIEW 18
2.13.3 Data Object Lifecycle
All objects in OpenVX follow a similar lifecycle model. All objects are
• Created via vxCreate<Object><Method> or retreived via vxGet<Object><Method> from theContext if they are internally created.
• Used within Graphs or Immediate functions
• Then objects must be released via vxRelease<Object>.
OpenVX Image Lifecycle
This is an example of the Image Lifecycle using the OpenVX Framework API. This would also apply to other datatypes with changes to the types and function names.
Client OpenVX
vxCreateImage(context, 320, 240, FOURCC_UYVY)
vx_image
other operations
vxVerifyGraph
vx_status
loop:
vxProcessGraph
vx_status
goto loop; // Repeat as needed
vxReleaseImage(&image)
2.14 Host Memory Data Object Access Patterns
For objects which are retrieved from OpenVX which are 2D in nature such as vx image, vx matrix, and vx-convolution, the manner in which the host-side has access to these memory region is well defined. Open-
VX uses a row-major storage (that is each unit in a column is memory adjacent to it’s row adjacent unit). Twodimensional objects are always declared in width (columns) by height (rows) notation (vxCreateImage or vx-CreateMatrix). Therefore when accessing these structures in ’C’ with arrays of declared size, users mustdeclare dimensions in the reverse order. This layout ensures ”row-wise” storage in ’C’ on the host. A pointer couldalso be allocated for the matrix data and would have to be addressed in this fashion:
#include <VX/vx.h>#include <stdlib.h>
vx matrix example random matrix(vx context context){
const vx size columns = 3;const vx size rows = 4;vx matrix m = vxCreateMatrix(context, VX TYPE FLOAT32, columns,
rows);if (m){
vx int32 j, i;vx float32 *mat = (vx float32 *)malloc(rows*columns*sizeof(
vx float32));if (mat){
vxAccessMatrix(m, mat);for (j = 0; j < rows; j++){
for (i = 0; i < columns; i++){
// assign random values <= 1.0
CHAPTER 2. DESIGN OVERVIEW 19
mat[j*columns + i] = (vx float32)rand()/RAND MAX;}
}vxCommitMatrix(m, mat);free(mat);
}}return m;
}
2.15 Code Flow
2.15.1 OpenVX Example Code Flow
Client OpenVX
System Initialization Phase
vxCreateContext
vx_context
Client OpenVX
Image and Buffer Creation Phase
vxCreateImagevxCreateBuffer
vx_imagevx_buffer
CHAPTER 2. DESIGN OVERVIEW 20
Client OpenVX
Kernel and Node Phase
vxCreateGraph(context)
vx_graph
(Optional) vxLoadKernels(context)
vx_status
<repeat>
vxGetKernelByEnum(context)
vx_kernel
<repeat>
vxCreateNode(graph)
vx_node
<repeat for each param on each kernel>
Client OpenVX
Graph Construction Phase
vxVerifyGraph
vx_status
<once per graph>
Client OpenVX
Valid graphs can be updated with new image data
vxProcessGraph(graph)
vx_status
<repeat>
CHAPTER 2. DESIGN OVERVIEW 21
Client OpenVX
Teardown Phase
vxReleaseNode
vx_status
<repeat>
vxReleaseKernel
vx_status
<repeat>
vxReleaseGraph
vx_status
<repeat>
vxReleaseImagevxReleaseBuffer
vx_status
<repeat>
vxReleaseContext
vx_status
2.16 Extensions
2.16.1 User Node Tiling
The User Node Tiling facility enables optimizations of the user nodes (e.g. locality of execution or parallelism) whenperforming computation on the image data. Modern processors have a diverse memory hierarchy that varies fromrelatively small but fast and expensive memory to relatively large but slow and inexpensive memory. Image datais typically too large to fit into the fast but small memory. The ability to break the image data into smaller sizedunits allows for optimized computation on these smaller units with fast memory access or parallel execution of auser node on multiple image tiles simultaneously. The OpenVX Graph Manager possesses the knowledge aboutthe memory hierarchy of the target and is hence in a position to break the image data into smaller units for memoryoptimization. Knowledge of the memory access pattern of an algorithm is key for the graph manager to enableoptimizations.
The Khronos OpenVX Working Group will include this extension as part of the OpenVX 1.1 specification, con-tingent on community feedback.
Chapter 3
Module Documentation
3.1 OpenVX Objects
The objects within OpenVX.
Modules
• Object: Buffer
The Buffer Object interface.
• Object: Context
The Context Object Interface.
• Object: Convolution
The Image Convolution Object interface.
• Object: Coordinates
The Image Pixel Coordinates Object interface.
• Object: Delay
The Delay Object interface.
• Object: Distribution
The Distribution Object Interface.
• Object: Graph
The Graph Object interface.
• Object: Image
The Image Object interface.
• Object: Kernel
The list of supported kernels and the Kernel Object interface.
• Object: Keypoint
The Keypoint Object Interface.
• Object: LUT
The Look-Up Table Interface.
• Object: List
The List Object Interface.
• Object: Matrix
The Matrix Object Interface.
• Object: Node
The Node Object interface.
• Object: Parameter
The Parameter Object interface.
• Object: Pyramid
The Image Pyramid Object Interface.
22
CHAPTER 3. MODULE DOCUMENTATION 23
• Object: Rectangle
The Rectangle Object interface.
• Object: Reference
The Reference Object interface.
• Object: Remap
The Remap Object Interface.
• Object: Scalar
The Scalar Object interface.
• Object: Target
The Target Object interface.
• Object: Threshold
The Threshold Object Interface.
3.1.1 Detailed Description
The objects within OpenVX. All objects in OpenVX derive from a vx reference and contain a reference to thevx context from which they were made, except the vx context itself.
CHAPTER 3. MODULE DOCUMENTATION 24
3.2 OpenVX Framework
The framework concepts and interfaces of OpenVX.
Modules
• Framework: Directive
The Directives Interface.
• Framework: Hint
The Hints Interface.
• Framework: Log
The debug logging interface.
• Framework: Performance Measurement
The Performance measurement and reporting interfaces.
• Framework: Users Supplied Nodes
User Extensions are a method to extend OpenVX with User defined kernels which can be loaded by OpenVX andincluded as nodes in the graph or immediate functions.
3.2.1 Detailed Description
The framework concepts and interfaces of OpenVX. These interfaces are used to perform tasks such as perfor-mance measurement on vx graph or vx node objects, obtain debugging information, or set directives and hintsto the implementation. While they all affect the vx context, they are not considered direct methods of the context.
CHAPTER 3. MODULE DOCUMENTATION 25
3.3 Object: Context
The Context Object Interface.
Typedefs
• typedef vx reference vx context
An opaque reference to the implementation context.
Enumerations
• enum vx context attribute e {VX CONTEXT ATTRIBUTE VENDOR ID = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT << 8))+ 0x0,VX CONTEXT ATTRIBUTE VERSION = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT << 8)) +0x1,VX CONTEXT ATTRIBUTE NUMKERNELS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT <<8)) + 0x2,VX CONTEXT ATTRIBUTE NUMMODULES = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT <<8)) + 0x3,VX CONTEXT ATTRIBUTE NUMREFS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT << 8)) +0x4,VX CONTEXT ATTRIBUTE NUMTARGETS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT <<8)) + 0x5,VX CONTEXT ATTRIBUTE IMPLEMENTATION = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT<< 8)) + 0x6,VX CONTEXT ATTRIBUTE EXTENSIONS SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT<< 8)) + 0x7,VX CONTEXT ATTRIBUTE EXTENSIONS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONTEXT <<8)) + 0x8,VX CONTEXT ATTRIBUTE CONVOLUTION MAXIMUM DIMENSION = ((( VX ID KHRONOS ) << 20) | (VX TYPE CONTEXT << 8)) + 0x9 }
A list of context attributes.
• enum vx import type e {VX IMPORT TYPE NONE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM IMPORT MEM << 12)) + 0x0,VX IMPORT TYPE HOST = ((( VX ID KHRONOS ) << 20) | ( VX ENUM IMPORT MEM << 12)) + 0x1 }
An enumeration of memory import types.
• enum vx termination criteria e {VX TERM CRITERIA ITERATIONS = ((( VX ID KHRONOS ) << 20) | ( VX ENUM TERM CRITERIA <<12)) + 0x0,VX TERM CRITERIA EPSILON = ((( VX ID KHRONOS ) << 20) | ( VX ENUM TERM CRITERIA << 12))+ 0x1,VX TERM CRITERIA BOTH = ((( VX ID KHRONOS ) << 20) | ( VX ENUM TERM CRITERIA << 12)) +0x2 }
The termination criteria list.
Functions
• vx context vxCreateContext ()
Creates a vx context
• vx context vxGetContext (vx reference reference)
Retrieves the context from any reference from within a context.
• vx status vxQueryContext (vx context context, vx enum attr, void ∗ptr, vx size size)
Queries the context for some specific information.
• void vxReleaseContext (vx context ∗context)
Releases the OpenVX object context.
CHAPTER 3. MODULE DOCUMENTATION 26
• vx status vxSetImmediateBorderMode (vx context context, vx border mode t ∗config)
Sets the border mode for immediate mode functions.
3.3.1 Detailed Description
The Context Object Interface. The OpenVX Context contains all other objects in OpenVX.
3.3.2 Typedef Documentation
typedef vx reference vx context
An opaque reference to the implementation context.
See Also
vxCreateContext
Definition at line 198 of file vx types.h.
3.3.3 Enumeration Type Documentation
enum vx context attribute e
A list of context attributes.
Enumerator
VX CONTEXT ATTRIBUTE VENDOR ID Used to query the unique vendor ID. Use a vx uint16.
VX CONTEXT ATTRIBUTE VERSION Used to query the OpenVX Version Number. Use a vx uint16
VX CONTEXT ATTRIBUTE NUMKERNELS Used to query the context for the number of active kernels. Usea vx uint32 parameter.
VX CONTEXT ATTRIBUTE NUMMODULES Used to query the context for the number of active modules.Use a vx uint32 parameter.
VX CONTEXT ATTRIBUTE NUMREFS Used to query the context for the number of active references. Usea vx uint32 parameter.
VX CONTEXT ATTRIBUTE NUMTARGETS Used to query the context for the number of active targets. Usea vx uint32 parameter.
VX CONTEXT ATTRIBUTE IMPLEMENTATION Used to query the context for it’s implementation name. Usea vx char[VX MAX IMPLEMENTATION NAME] array.
VX CONTEXT ATTRIBUTE EXTENSIONS SIZE Used to query the number of bytes in the extensions string.Use a vx size parameter.
VX CONTEXT ATTRIBUTE EXTENSIONS Used to query the number of bytes in the extensions string. Use avx char pointer allocated to the size returned from VX CONTEXT ATTRIBUTE EXTENSIONS SIZE.
VX CONTEXT ATTRIBUTE CONVOLUTION MAXIMUM DIMENSION The maximum range of either dimen-sion that a convolution matrix may be created with. Use a vx size parameter. Each vendor will have tosupport centered kernels of size w X h, where both w and h are odd numbers, 3 <= w <= n and 3 <= h<= n, where n is the value of the VX CONTEXT ATTRIBUTE CONVOLUTION MAXIMUM DIMENSI-ON attribute. n is an odd number that should not be smaller than 9. w and h may or may not be equal toeach other. All combinations of w and h meeting the conditions above should be supported. The behaviorof vxCreateConvolution is undefined for values larger than the value returned by this attribute.
Definition at line 689 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 27
enum vx import type e
An enumeration of memory import types.
Enumerator
VX IMPORT TYPE NONE For memory allocated through OpenVX, this is the import type.
VX IMPORT TYPE HOST The default memory type to import from the Host.
Definition at line 1043 of file vx types.h.
enum vx termination criteria e
The termination criteria list.
See Also
Kernel: Optical Flow Pyramid (LK)
Enumerator
VX TERM CRITERIA ITERATIONS Indicates a termination after a set number of iterations.
VX TERM CRITERIA EPSILON Indicates a termination after matching against the value of eplison providedto the function.
VX TERM CRITERIA BOTH Indicates that both an iterations and eplison method are employed. Whicheverone matches first, will cause the termination.
Definition at line 1164 of file vx types.h.
3.3.4 Function Documentation
vx context vxCreateContext ( )
Creates a vx contextThis creates a top level object context for OpenVX.
Note
This is required to do anything else.
Returns
The reference to the implementation context.
Return values
0 No context was created.∗ A context reference.
Postcondition
vxReleaseContext
Examples:
vx eyetrack.c, and vx tiling main.c.
Referenced by example eyetracking(), example super resolution(), and main().
vx context vxGetContext ( vx reference reference )
Retrieves the context from any reference from within a context.
CHAPTER 3. MODULE DOCUMENTATION 28
Parameters
in reference The reference to the extract the context from.
Returns
Returns the overall context which created the particular reference.
Examples:
vx helper.c, and vx xyz ext.c.
Referenced by vxCreateNodeByStructure().
vx status vxQueryContext ( vx context context, vx enum attr, void ∗ ptr, vx size size )
Queries the context for some specific information.Parameters
in context The reference to the context.in attr The attribute to query. Use a vx context attribute e.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No errorsVX ERROR INVALID REF-
ERENCEif the context is not a vx context.
VX ERROR INVALID PAR-AMETERS
if any of the other parameters are incorrect.
VX ERROR NOT SUPPO-RTED
if the attribute is not supported on this implementation.
Precondition
vxCreateContext
Postcondition
vxReleaseContext
Examples:
vx helper.c.
void vxReleaseContext ( vx context ∗ context )
Releases the OpenVX object context.All reference counted objects are garbage collected by the return of this call. No calls are possible using the
parameter context after the context has been released until a new reference from vxCreateContext is returned.All outstanding references to OpenVX objects from this context are invalid after this call.Parameters
CHAPTER 3. MODULE DOCUMENTATION 29
in context The pointer to the reference to the context.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateContext
Examples:
vx eyetrack.c, and vx tiling main.c.
Referenced by example eyetracking(), example super resolution(), and main().
vx status vxSetImmediateBorderMode ( vx context context, vx border mode t ∗ config )
Sets the border mode for immediate mode functions.Graph mode functions are unaffected by this function. If the immediate mode function does not support the
border mode, it must return an error (VX ERROR NOT SUPPORTED).Parameters
in context A reference to the overall context.in config A border structure which contains the value from vx border mode e and a
constant value for VX BORDER MODE CONSTANT.
Returns
vx status
Return values
VX SUCCESS Success.VX ERROR INVALID VAL-
UEThe mode value was not valid (or out of range).
VX ERROR INVALID REF-ERENCE
The context was invalid.
VX ERROR INVALID PAR-AMETERS
If config is NULL.
VX ERROR NOT SUPPO-RTED
Returned if the border mode is not supported.
Note
This is not guaranteed to be a thread-safe function with respect to immediate mode execution. The assumeddefault value for immediate mode functions is VX BORDER MODE UNDEFINED.
CHAPTER 3. MODULE DOCUMENTATION 30
3.4 Object: Image
The Image Object interface.
Data Structures
• struct vx imagepatch addressing t
The addressing image patch structure is used by the Host only to address pixels in an image patch. The fields of thestructure are defined as: More...
Macros
• #define VX IMAGEPATCH ADDR INIT {0u, 0u, 0, 0, 0u, 0u, 0u, 0u}Used to initialize a vx imagepatch addressing t structure on the stack.
Typedefs
• typedef vx reference vx image
An opaque reference to an image.
Enumerations
• enum vx channel range e {VX CHANNEL RANGE FULL = ((( VX ID KHRONOS ) << 20) | ( VX ENUM COLOR RANGE << 12)) +0x0,VX CHANNEL RANGE RESTRICTED = ((( VX ID KHRONOS ) << 20) | ( VX ENUM COLOR RANGE <<12)) + 0x1 }
The image channel range list used by the VX IMAGE ATTRIBUTE RANGE attribute of a vx image.
• enum vx color space e {VX COLOR SPACE NONE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM COLOR SPACE << 12)) + 0x0,VX COLOR SPACE BT601 525 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM COLOR SPACE << 12)) +0x1,VX COLOR SPACE BT601 625 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM COLOR SPACE << 12)) +0x2,VX COLOR SPACE BT709 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM COLOR SPACE << 12)) + 0x3,VX COLOR SPACE DEFAULT = VX COLOR SPACE BT709 }
The image color space list used by the VX IMAGE ATTRIBUTE SPACE attribute of a vx image.
• enum vx image attribute e {VX IMAGE ATTRIBUTE WIDTH = ((( VX ID KHRONOS ) << 20) | ( VX TYPE IMAGE << 8)) + 0x0,VX IMAGE ATTRIBUTE HEIGHT = ((( VX ID KHRONOS ) << 20) | ( VX TYPE IMAGE << 8)) + 0x1,VX IMAGE ATTRIBUTE FORMAT = ((( VX ID KHRONOS ) << 20) | ( VX TYPE IMAGE << 8)) + 0x2,VX IMAGE ATTRIBUTE PLANES = ((( VX ID KHRONOS ) << 20) | ( VX TYPE IMAGE << 8)) + 0x3,VX IMAGE ATTRIBUTE SPACE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE IMAGE << 8)) + 0x4,VX IMAGE ATTRIBUTE RANGE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE IMAGE << 8)) + 0x5,VX IMAGE ATTRIBUTE SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE IMAGE << 8)) + 0x6 }
The image attributes list.
Functions
• vx status vxAccessImagePatch (vx image image, vx rectangle rect, vx uint32 plane index, vx imagepatch -addressing t ∗addr, void ∗∗ptr)
This allows the User to extract a rectangular patch (subset) of an image from a single plane.
• vx status vxCommitImagePatch (vx image image, vx rectangle rect, vx uint32 plane index, vx imagepatch -addressing t ∗addr, void ∗ptr)
This allows the User to commit a rectangular patch (subset) of an image from a single plane.
• vx size vxComputeImagePatchSize (vx image image, vx rectangle rect, vx uint32 plane index)
CHAPTER 3. MODULE DOCUMENTATION 31
This computes the size needs to retrieve an image patch from an image.
• vx image vxCreateImage (vx context context, vx uint32 width, vx uint32 height, vx fourcc color)
Creates an opaque reference to an image buffer.
• vx image vxCreateImageFromHandle (vx context context, vx fourcc color, vx imagepatch addressing taddrs[ ], void ∗ptrs[ ], vx enum type)
Creates a reference to an image object which was externally allocated.
• vx image vxCreateImageFromROI (vx image img, vx rectangle rect)
Creates an image from another image given a rectangle. This second reference refers to the data in the originalimage. Updates to this image will update the parent image. The rectangle must be defined within the pixel space ofthe parent image.
• vx image vxCreateUniformImage (vx context context, vx uint32 width, vx uint32 height, vx fourcc color, void∗value)
Creates an reference to an image object which has a singular, uniform value in all pixels.
• vx image vxCreateVirtualImage (vx context context)
Creates an opaque reference to an image buffer with no direct user access.
• vx image vxCreateVirtualImageWithFormat (vx context context, vx fourcc color)
Creates an opaque reference to an image buffer with no direct user access however allows setting the image format.
• void ∗ vxFormatImagePatchAddress1d (void ∗ptr, vx uint32 index, vx imagepatch addressing t ∗addr)
Used to access a specific indexed pixel in an image patch.
• void ∗ vxFormatImagePatchAddress2d (void ∗ptr, vx uint32 x, vx uint32 y, vx imagepatch addressing t ∗addr)
Used to access a specific pixel at a 2d coordinate in an image patch.
• vx rectangle vxGetValidRegionImage (vx image image)
Retrieves the valid region of the image as a rectangle.
• vx status vxQueryImage (vx image image, vx enum attribute, void ∗ptr, vx size size)
Retrieves various attributes of an image.
• void vxReleaseImage (vx image ∗image)
Releases a reference to an image object. The object may not be garbage collected until its total reference count iszero..
• vx status vxSetImageAttribute (vx image image, vx enum attr, void ∗out, vx size size)
Allows setting attributes on the image.
3.4.1 Detailed Description
The Image Object interface.
3.4.2 Data Structure Documentation
struct vx imagepatch addressing t
The addressing image patch structure is used by the Host only to address pixels in an image patch. The fields ofthe structure are defined as:
• dim - The dimensions of the image in logical pixel units in the x & y direction.
• stride - The physical byte distance from a logical pixel to the next logically adjacent pixel in the positive x or ydirection.
• scale - The relationship of scaling from the primary plane (typically the zero indexed plane) to this plane. Aninteger down-scaling factor of f shall be set to a value equal to scale = unity
f and an integer up-scaling factorof f shall be set to a value of scale = unity× f . unity is defined as VX SCALE UNITY.
• step - The step is the number of logical pixel units to skip in order to arrive at the next physically unique pixel.For example, on a plane which is half-scaled in a dimension, the step in that dimension is 2 to indicate thatevery other pixel in that dimension is an alias. This is useful in situations where iteration over unique pixels isrequired such as in serializing or de-serializing the image patch information.
CHAPTER 3. MODULE DOCUMENTATION 32
See Also
vxAccessImagePatch
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/#include <VX/vx.h>
#define PATCH DIM 16
vx status example imagepatch(vx context context){
vx status status = VX SUCCESS;void *base ptr = NULL;vx uint32 width = 640, height = 480, plane = 0;vx image image = vxCreateImage(context, width, height,FOURCC U8);
vx rectangle rect = vxCreateRectangle(context, 0, 0, PATCH DIM, PATCH DIM);
vx imagepatch addressing t addr;
status = vxAccessImagePatch(image, rect, plane, &addr, &base ptr);if (status == VX SUCCESS){
vx uint32 x,y,i,j;vx uint8 pixel = 0;
/* a couple addressing options */
/* use linear addressing function/macro */for (i = 0; i < addr.dim x*addr.dim y; i++) {
vx uint8 *ptr2 = vxFormatImagePatchAddress1d(base ptr, i, &addr);
pixel = *ptr2;}
/* 2d addressing option */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *ptr2 = vxFormatImagePatchAddress2d(base ptr, x
, y, &addr);pixel = *ptr2;
}}
/* direct addressing by client *//* for subsampled planes, scale will change */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *tmp = (vx uint8 *)base ptr;i = ((addr.stride y*y*addr.scale y)/
VX SCALE UNITY) +((addr.stride x*x*addr.scale x)/
VX SCALE UNITY);pixel = tmp[i];
}}
/* more efficient direct addressing by client. *//* for subsampled planes, scale will change. */for (y = 0; y < addr.dim y; y+=addr.step y) {
j = (addr.stride y*y*addr.scale y)/VX SCALE UNITY;for (x = 0; x < addr.dim x; x+=addr.step x) {
vx uint8 *tmp = (vx uint8 *)base ptr;i = j + (addr.stride x*x*addr.scale x)/
VX SCALE UNITY;pixel = tmp[i];
CHAPTER 3. MODULE DOCUMENTATION 33
}}/* this commits the data back to the image. If rect was 0 or empty, it
* would just decrement the reference (used when reading an image only) */status = vxCommitImagePatch(image, rect, plane, &addr, base ptr);
}else{
/* could be VX ERROR OPTIMIZED AWAY */}vxReleaseImage(&image);return status;
}
Examples:
xyz module.c.
Definition at line 1364 of file vx types.h.Data Fields
vx uint32 dim x Width of patch in X dimension in pixels.vx uint32 dim y Height of patch in Y dimension in pixels.vx uint32 scale x Scale of X dimension. For sub-sampled planes this will be the scaling
factor of the dimension of the plane in relation to the zero plane. UsedVX SCALE UNITY in the numerator.
vx uint32 scale y Scale of Y dimension. For sub-sampled planes this will be the scalingfactor of the dimension of the plane in relation to the zero plane. UsedVX SCALE UNITY in the numerator.
vx uint32 step x Step of X dimension in pixels.vx uint32 step y Step of Y dimension in pixels.
vx int32 stride x Stride in X dimension in bytes.vx int32 stride y Stride in Y dimension in bytes.
3.4.3 Typedef Documentation
typedef vx reference vx image
An opaque reference to an image.
See Also
vxCreateImage
Examples:
xyz module.c.
Definition at line 161 of file vx types.h.
3.4.4 Enumeration Type Documentation
enum vx channel range e
The image channel range list used by the VX IMAGE ATTRIBUTE RANGE attribute of a vx image.
Enumerator
VX CHANNEL RANGE FULL Full range of the unit of the channel.
VX CHANNEL RANGE RESTRICTED Restricted range of the unit of the channel based on the space given.
Definition at line 1105 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 34
enum vx color space e
The image color space list used by the VX IMAGE ATTRIBUTE SPACE attribute of a vx image.
Enumerator
VX COLOR SPACE NONE Used to indicate that no color space is used.
VX COLOR SPACE BT601 525 Used to indicate that the BT.601 coefficients and SMPTE C primaries areused for conversions.
VX COLOR SPACE BT601 625 Used to indicate that the BT.601 coefficients and BTU primaries are used forconversions.
VX COLOR SPACE BT709 Used to indicate that the BT.709 coefficients are used for conversions.
VX COLOR SPACE DEFAULT All images in VX are by default BT.709.
Definition at line 1088 of file vx types.h.
enum vx image attribute e
The image attributes list.
Enumerator
VX IMAGE ATTRIBUTE WIDTH Used to query an image for its height. Use a vx uint32 parameter.
VX IMAGE ATTRIBUTE HEIGHT Used to query an image for its width. Use a vx uint32 parameter.
VX IMAGE ATTRIBUTE FORMAT Used to query an image for its format. Use a vx fourcc parameter.
VX IMAGE ATTRIBUTE PLANES Used to query an image for its number of planes. Use a vx size param-eter.
VX IMAGE ATTRIBUTE SPACE Used to query an image for its color space (see vx color space e).Use a vx enum parameter.
VX IMAGE ATTRIBUTE RANGE Used to query an image for its channel range (see vx channel range-e). Use a vx enum parameter.
VX IMAGE ATTRIBUTE SIZE Used to query an image for its total number of bytes. Use a vx size param-eter.
Definition at line 790 of file vx types.h.
3.4.5 Function Documentation
vx status vxAccessImagePatch ( vx image image, vx rectangle rect, vx uint32 plane index,vx imagepatch addressing t ∗ addr, void ∗∗ ptr )
This allows the User to extract a rectangular patch (subset) of an image from a single plane.Parameters
in image The reference to the image to extract the patch from.in rect The coordinates to get the patch from. Must be 0 <= start < end.in plane index The plane index to get the data from.out addr The addressing information for the image patch will be written into the data
structure.in,out ptr The pointer to a pointer of a location to store the data. If the user passes
in NULL, the function will map or allocate a buffer and return it. If the userpasses in an non-NULL pointer, the function will attempt to copy to the locationprovided by the user.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 35
Return values
VX ERROR OPTIMIZED A-WAY
The image is not present in memory.
VX ERROR INVALID PAR-AMETERS
The start, end, plane index, stride x or stride y pointer was incorrect.
VX ERROR INVALID REF-ERENCE
The image reference was not actually an image reference.
Note
The user may ask for data outside the bounds of the valid region, but such data has an undefined value.
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/#include <VX/vx.h>
#define PATCH DIM 16
vx status example imagepatch(vx context context){
vx status status = VX SUCCESS;void *base ptr = NULL;vx uint32 width = 640, height = 480, plane = 0;vx image image = vxCreateImage(context, width, height,FOURCC U8);
vx rectangle rect = vxCreateRectangle(context, 0, 0, PATCH DIM, PATCH DIM);
vx imagepatch addressing t addr;
status = vxAccessImagePatch(image, rect, plane, &addr, &base ptr);if (status == VX SUCCESS){
vx uint32 x,y,i,j;vx uint8 pixel = 0;
/* a couple addressing options */
/* use linear addressing function/macro */for (i = 0; i < addr.dim x*addr.dim y; i++) {
vx uint8 *ptr2 = vxFormatImagePatchAddress1d(base ptr, i, &addr);
pixel = *ptr2;}
/* 2d addressing option */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *ptr2 = vxFormatImagePatchAddress2d(base ptr, x
, y, &addr);pixel = *ptr2;
}}
/* direct addressing by client *//* for subsampled planes, scale will change */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *tmp = (vx uint8 *)base ptr;i = ((addr.stride y*y*addr.scale y)/
VX SCALE UNITY) +((addr.stride x*x*addr.scale x)/
VX SCALE UNITY);
CHAPTER 3. MODULE DOCUMENTATION 36
pixel = tmp[i];}
}
/* more efficient direct addressing by client. *//* for subsampled planes, scale will change. */for (y = 0; y < addr.dim y; y+=addr.step y) {
j = (addr.stride y*y*addr.scale y)/VX SCALE UNITY;for (x = 0; x < addr.dim x; x+=addr.step x) {
vx uint8 *tmp = (vx uint8 *)base ptr;i = j + (addr.stride x*x*addr.scale x)/
VX SCALE UNITY;pixel = tmp[i];
}}/* this commits the data back to the image. If rect was 0 or empty, it
* would just decrement the reference (used when reading an image only) */status = vxCommitImagePatch(image, rect, plane, &addr, base ptr);
}else{
/* could be VX ERROR OPTIMIZED AWAY */}vxReleaseImage(&image);return status;
}
Examples:
xyz module.c.
Referenced by XYZKernel().
vx status vxCommitImagePatch ( vx image image, vx rectangle rect, vx uint32 plane index,vx imagepatch addressing t ∗ addr, void ∗ ptr )
This allows the User to commit a rectangular patch (subset) of an image from a single plane.Parameters
in image The reference to the image to extract the patch from.in rect The coordinates to set the patch to. Must be 0 <= start <= end. This may be
0 or a rectangle of zero area in order to indicate that the commit should onlydecrement the reference count.
in plane index The plane index to set the data to.in addr The addressing information for the image patch.in ptr The pointer of a location to read the data from. If the user allocated the pointer
they must free it. If the pointer was set by vxAccessImagePatch, the usermay not access the pointer after this call is complete.
Returns
A vx status e enumeration.
Return values
VX ERROR OPTIMIZED A-WAY
The image is not present in memory.
VX ERROR INVALID PAR-AMETERS
The start, end, plane index, stride x or stride y pointer was incorrect.
VX ERROR INVALID REF-ERENCE
The image reference was not actually an image reference.
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
CHAPTER 3. MODULE DOCUMENTATION 37
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/#include <VX/vx.h>
#define PATCH DIM 16
vx status example imagepatch(vx context context){
vx status status = VX SUCCESS;void *base ptr = NULL;vx uint32 width = 640, height = 480, plane = 0;vx image image = vxCreateImage(context, width, height,FOURCC U8);
vx rectangle rect = vxCreateRectangle(context, 0, 0, PATCH DIM, PATCH DIM);
vx imagepatch addressing t addr;
status = vxAccessImagePatch(image, rect, plane, &addr, &base ptr);if (status == VX SUCCESS){
vx uint32 x,y,i,j;vx uint8 pixel = 0;
/* a couple addressing options */
/* use linear addressing function/macro */for (i = 0; i < addr.dim x*addr.dim y; i++) {
vx uint8 *ptr2 = vxFormatImagePatchAddress1d(base ptr, i, &addr);
pixel = *ptr2;}
/* 2d addressing option */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *ptr2 = vxFormatImagePatchAddress2d(base ptr, x
, y, &addr);pixel = *ptr2;
}}
/* direct addressing by client *//* for subsampled planes, scale will change */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *tmp = (vx uint8 *)base ptr;i = ((addr.stride y*y*addr.scale y)/
VX SCALE UNITY) +((addr.stride x*x*addr.scale x)/
VX SCALE UNITY);pixel = tmp[i];
}}
/* more efficient direct addressing by client. *//* for subsampled planes, scale will change. */for (y = 0; y < addr.dim y; y+=addr.step y) {
j = (addr.stride y*y*addr.scale y)/VX SCALE UNITY;for (x = 0; x < addr.dim x; x+=addr.step x) {
vx uint8 *tmp = (vx uint8 *)base ptr;i = j + (addr.stride x*x*addr.scale x)/
VX SCALE UNITY;pixel = tmp[i];
}}/* this commits the data back to the image. If rect was 0 or empty, it
* would just decrement the reference (used when reading an image only) */status = vxCommitImagePatch(image, rect, plane, &addr, base ptr);
}else{
/* could be VX ERROR OPTIMIZED AWAY */}vxReleaseImage(&image);return status;
}
CHAPTER 3. MODULE DOCUMENTATION 38
Note
If the implementation gave the client a pointer from vxAccessImagePatch then implementation specificbehavior may occur. If not, then a copy occurs from the users pointer to the internal data of the object.If the rectangle is intersects bounds of the current valid region, the valid region grows to the union of the tworectangles as long as they occur within the bounds of the original image dimensions.
Examples:
xyz module.c.
Referenced by XYZKernel().
vx size vxComputeImagePatchSize ( vx image image, vx rectangle rect, vx uint32 plane index )
This computes the size needs to retrieve an image patch from an image.Parameters
in image The reference to the image to extract the patch from.in rect The coordinates. Must be 0 <= start < end <= dimension where dimension
is width for x and height for y.in plane index The plane index to get the data from.
Returns
vx size
vx image vxCreateImage ( vx context context, vx uint32 width, vx uint32 height, vx fourcc color )
Creates an opaque reference to an image buffer.Not guaranteed to exist until the vx graph containing it has been verified
Parameters
in context The reference to the implementation context.in width The image width in pixels.in height The image height in pixels.in color The FOURCC (vx fourcc e) code which represents the format of the image
and the color space.
Returns
Returns an image reference or zero when an error is encountered.
See Also
vxAccessImagePatch to obtain direct memory access to the image data.
Precondition
vxCreateContext
Examples:
vx eyetrack.c, and vx tiling main.c.
Referenced by example eyetracking(), example super resolution(), and main().
vx image vxCreateImageFromHandle ( vx context context, vx fourcc color, vx imagepatch addressing taddrs[ ], void ∗ ptrs[ ], vx enum type )
Creates a reference to an image object which was externally allocated.
CHAPTER 3. MODULE DOCUMENTATION 39
Parameters
in context The reference to the implementation context.in color See the vx fourcc e codes. This mandates the number planes needed to
be valid in the addrs and ptrs arrays based on the format given.in addrs[ ] The array of image patch addressing structures which defines the dimension
and stride of the array of pointers.in ptrs[ ] The array of platform defined references to each plane.in type vx import type e. When giving VX IMPORT TYPE HOST the ptrs[] is
assumed to be HOST accessible pointers to memory.
Returns
Returns vx image.
Return values
0 Image could not be created.∗ Valid Image reference.
Precondition
vxCreateContext
Postcondition
vxReleaseImage
vx image vxCreateImageFromROI ( vx image img, vx rectangle rect )
Creates an image from another image given a rectangle. This second reference refers to the data in the originalimage. Updates to this image will update the parent image. The rectangle must be defined within the pixel space ofthe parent image.Parameters
in img The reference to the parent image.in rect The region of interest rectangle. Must contain points within the parent image
pixel space.
Precondition
vxCreateImage
Returns
Returns the reference to the sub-image or zero if the rectangle was invalid.
Examples:
vx tiling main.c.
vx image vxCreateUniformImage ( vx context context, vx uint32 width, vx uint32 height, vx fourcc color,void ∗ value )
Creates an reference to an image object which has a singular, uniform value in all pixels.The value pointer must reflect the specific format of the desired image. For example:
Color Value Ptr
CHAPTER 3. MODULE DOCUMENTATION 40
FOURCC U8 vx uint8 ∗FOURCC S16 vx int16 ∗FOURCC U16 vx uint16 ∗FOURCC S32 vx int32 ∗FOURCC U32 vx uint32 ∗FOURCC RGB vx uint8 pixel[3] in R, G, B orderFOURCC RGBX vx uint8 pixels[4]Any YUV vx uint8 pixel[3] in Y, U, V order
Parameters
in context The reference to the implementation context.in width The image width in pixels.in height The image height in pixels.in color The FOURCC (vx fourcc e) code which represents the format of the image
and the color space.in value The pointer to the pixel value to set all pixels to.
Returns
Returns an image reference or zero when an error is encountered.
See Also
vxAccessImagePatch to obtain direct memory access to the image data.
Note
vxAccessImagePatch and vxCommitImagePatch may be called with a uniform image reference.
Precondition
vxCreateContext
vx image vxCreateVirtualImage ( vx context context )
Creates an opaque reference to an image buffer with no direct user access.Virtual data objects allow users to connect various nodes within a graph via data references within access to
that data but they also permit the implementation to take maximum advantage of possible optimizations. Use thisAPI to create a data reference to link two or more nodes together when the intermediate data is not required to beaccessed by outside entities.Parameters
in context The reference to the implementation context.
Returns
Returns an image reference or zero when an error is encountered.
Precondition
vxCreateContext
Postcondition
vxReleaseImage
Examples:
vx factory corners.c, vx factory edge.c, and vx factory pipeline.c.
Referenced by vxCornersGraphFactory(), vxEdgeGraphFactory(), and vxPipelineGraphFactory().
CHAPTER 3. MODULE DOCUMENTATION 41
vx image vxCreateVirtualImageWithFormat ( vx context context, vx fourcc color )
Creates an opaque reference to an image buffer with no direct user access however allows setting the image format.Virtual data objects allow users to connect various nodes within a graph via data references within access to
that data but they also permit the implementation to take maximum advantage of possible optimizations. Use thisAPI to create a data reference to link two or more nodes together when the intermediate data is not required to beaccessed by outside entities. This API in particular allows the user to define the image format of the data withoutspecifying the exact dimensions.Parameters
in context The reference to the implementation context.in color The FOURCC (vx fourcc e) code which represents the format of the image
and the color space.
Returns
Returns an image reference or zero when an error is encountered.
Precondition
vxCreateContext
Postcondition
vxReleaseImage
Examples:
vx factory pipeline.c.
Referenced by vxPipelineGraphFactory().
void∗ vxFormatImagePatchAddress1d ( void ∗ ptr, vx uint32 index, vx imagepatch addressing t ∗ addr )
Used to access a specific indexed pixel in an image patch.Parameters
in ptr The base pointer of the patch as returned from vxAccessImagePatch.in index The 0 based index of the pixel count in the patch. Indexes increase horizontally
by 1 then wrap around to the next row.in addr The pointer to the addressing mode information returned from vxAccess-
ImagePatch.
Returns
void ∗ Returns the pointer to the specified pixel.
Precondition
vxAccessImagePatch
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
CHAPTER 3. MODULE DOCUMENTATION 42
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/#include <VX/vx.h>
#define PATCH DIM 16
vx status example imagepatch(vx context context){
vx status status = VX SUCCESS;void *base ptr = NULL;vx uint32 width = 640, height = 480, plane = 0;vx image image = vxCreateImage(context, width, height,FOURCC U8);
vx rectangle rect = vxCreateRectangle(context, 0, 0, PATCH DIM, PATCH DIM);
vx imagepatch addressing t addr;
status = vxAccessImagePatch(image, rect, plane, &addr, &base ptr);if (status == VX SUCCESS){
vx uint32 x,y,i,j;vx uint8 pixel = 0;
/* a couple addressing options */
/* use linear addressing function/macro */for (i = 0; i < addr.dim x*addr.dim y; i++) {
vx uint8 *ptr2 = vxFormatImagePatchAddress1d(base ptr, i, &addr);
pixel = *ptr2;}
/* 2d addressing option */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *ptr2 = vxFormatImagePatchAddress2d(base ptr, x
, y, &addr);pixel = *ptr2;
}}
/* direct addressing by client *//* for subsampled planes, scale will change */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *tmp = (vx uint8 *)base ptr;i = ((addr.stride y*y*addr.scale y)/
VX SCALE UNITY) +((addr.stride x*x*addr.scale x)/
VX SCALE UNITY);pixel = tmp[i];
}}
/* more efficient direct addressing by client. *//* for subsampled planes, scale will change. */for (y = 0; y < addr.dim y; y+=addr.step y) {
j = (addr.stride y*y*addr.scale y)/VX SCALE UNITY;for (x = 0; x < addr.dim x; x+=addr.step x) {
vx uint8 *tmp = (vx uint8 *)base ptr;i = j + (addr.stride x*x*addr.scale x)/
VX SCALE UNITY;pixel = tmp[i];
}}/* this commits the data back to the image. If rect was 0 or empty, it
* would just decrement the reference (used when reading an image only) */status = vxCommitImagePatch(image, rect, plane, &addr, base ptr);
}else{
/* could be VX ERROR OPTIMIZED AWAY */}vxReleaseImage(&image);return status;
}
CHAPTER 3. MODULE DOCUMENTATION 43
void∗ vxFormatImagePatchAddress2d ( void ∗ ptr, vx uint32 x, vx uint32 y, vx imagepatch addressing t∗ addr )
Used to access a specific pixel at a 2d coordinate in an image patch.
CHAPTER 3. MODULE DOCUMENTATION 44
Parameters
in ptr The base pointer of the patch as returned from vxAccessImagePatch.in x The x dimension within the patch.in y The y dimension within the patch.in addr The pointer to the addressing mode information returned from vxAccess-
ImagePatch.
Returns
void ∗ Returns the pointer to the specified pixel.
Precondition
vxAccessImagePatch
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/#include <VX/vx.h>
#define PATCH DIM 16
vx status example imagepatch(vx context context){
vx status status = VX SUCCESS;void *base ptr = NULL;vx uint32 width = 640, height = 480, plane = 0;vx image image = vxCreateImage(context, width, height,FOURCC U8);
vx rectangle rect = vxCreateRectangle(context, 0, 0, PATCH DIM, PATCH DIM);
vx imagepatch addressing t addr;
status = vxAccessImagePatch(image, rect, plane, &addr, &base ptr);if (status == VX SUCCESS){
vx uint32 x,y,i,j;vx uint8 pixel = 0;
/* a couple addressing options */
/* use linear addressing function/macro */for (i = 0; i < addr.dim x*addr.dim y; i++) {
vx uint8 *ptr2 = vxFormatImagePatchAddress1d(base ptr, i, &addr);
pixel = *ptr2;}
/* 2d addressing option */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *ptr2 = vxFormatImagePatchAddress2d(base ptr, x
, y, &addr);pixel = *ptr2;
}}
/* direct addressing by client *//* for subsampled planes, scale will change */for (y = 0; y < addr.dim y; y+=addr.step y) {
for (x = 0; x < addr.dim x; x+=addr.step x) {vx uint8 *tmp = (vx uint8 *)base ptr;
CHAPTER 3. MODULE DOCUMENTATION 45
i = ((addr.stride y*y*addr.scale y)/VX SCALE UNITY) +
((addr.stride x*x*addr.scale x)/VX SCALE UNITY);
pixel = tmp[i];}
}
/* more efficient direct addressing by client. *//* for subsampled planes, scale will change. */for (y = 0; y < addr.dim y; y+=addr.step y) {
j = (addr.stride y*y*addr.scale y)/VX SCALE UNITY;for (x = 0; x < addr.dim x; x+=addr.step x) {
vx uint8 *tmp = (vx uint8 *)base ptr;i = j + (addr.stride x*x*addr.scale x)/
VX SCALE UNITY;pixel = tmp[i];
}}/* this commits the data back to the image. If rect was 0 or empty, it
* would just decrement the reference (used when reading an image only) */status = vxCommitImagePatch(image, rect, plane, &addr, base ptr);
}else{
/* could be VX ERROR OPTIMIZED AWAY */}vxReleaseImage(&image);return status;
}
vx rectangle vxGetValidRegionImage ( vx image image )
Retrieves the valid region of the image as a rectangle.After the image is allocated but has not been written to this will return the full rectangle of the image so that
functions do not have to manage a case for uninitialized data. The image will still retain an uninitialized value butonce the image is written to via any means such as vxCommitImagePatch, the valid region will be altered tocontain the maximum bounds of the written area.Parameters
in image The image to retrieve the valid region from.
Returns
vx rectangle
Return values
0 Invalid image.∗ Valid image.
Note
This rectangle can be passed directly to vxAccessImagePatch to get the full valid region of the image.Modifications from vxCommitImagePatch will grow the valid region.
Postcondition
vxReleaseRectangle
Examples:
xyz module.c.
Referenced by XYZKernel().
vx status vxQueryImage ( vx image image, vx enum attribute, void ∗ ptr, vx size size )
Retrieves various attributes of an image.
CHAPTER 3. MODULE DOCUMENTATION 46
Parameters
in image The reference to the image to query.in attribute The attribute to query. Use a vx image attribute e.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No errorsVX ERROR INVALID REF-
ERENCEif the image is not a vx image.
VX ERROR INVALID PAR-AMETERS
if any of the other parameters are incorrect.
VX ERROR NOT SUPPO-RTED
if the attribute is not supported on this implementation.
Precondition
vxCreateImage
Examples:
vx tiling ext.c, and xyz module.c.
Referenced by XYZInputValidator(), and XYZOutputValidator().
void vxReleaseImage ( vx image ∗ image )
Releases a reference to an image object. The object may not be garbage collected until its total reference count iszero..Parameters
in image The pointer to the image to release
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateImage
Examples:
vx factory corners.c, vx factory edge.c, vx factory pipeline.c, and vx tiling main.c.
Referenced by example super resolution(), vxCornersGraphFactory(), vxEdgeGraphFactory(), and vxPipeline-GraphFactory().
vx status vxSetImageAttribute ( vx image image, vx enum attr, void ∗ out, vx size size )
Allows setting attributes on the image.Parameters
CHAPTER 3. MODULE DOCUMENTATION 47
in image The reference to the image to set the attribute on.in attr The attribute to set. Use a vx image attribute e enumeration.in out The pointer to the where the value will be read from.in size The size of the object pointed to by out.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No errorsVX ERROR INVALID REF-
ERENCEif the image is not a vx image.
VX ERROR INVALID PAR-AMETERS
if any of the other parameters are incorrect.
Precondition
vxCreateImage
CHAPTER 3. MODULE DOCUMENTATION 48
3.5 Object: Buffer
The Buffer Object interface.
Typedefs
• typedef vx reference vx buffer
An opaque reference to a buffer.
Enumerations
• enum vx buffer attribute e {VX BUFFER ATTRIBUTE UNITSIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE BUFFER << 8)) + 0x0,VX BUFFER ATTRIBUTE NUMUNITS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE BUFFER << 8)) +0x1,VX BUFFER ATTRIBUTE SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE BUFFER << 8)) + 0x2 }
The buffer attributes list.
Functions
• vx status vxAccessBufferRange (vx buffer buffer, vx size start, vx size end, void ∗∗ptr)
This allows access to a sub-range of the a buffer.
• vx status vxCommitBufferRange (vx buffer buffer, vx size start, vx size end, void ∗ptr)
Commits data back to the buffer object.
• vx size vxComputeBufferRangeSize (vx buffer buffer, vx uint32 start, vx uint32 end)
Computes the byte size of a buffer range.
• vx buffer vxCreateBuffer (vx context context, vx size unitSize, vx size numUnits)
Creates an opaque reference to a buffer in memory.
• vx buffer vxCreateBufferFromHandle (vx context context, vx size unitSize, vx size numUnits, void ∗ptr, vx -enum type)
Creates a buffer object backed by externally allocated memory.
• vx buffer vxCreateVirtualBuffer (vx context context)
Creates an opaque reference to a buffer in memory with no direct user access.
• vx status vxQueryBuffer (vx buffer buffer, vx enum attribute, void ∗ptr, vx size size)
Queries the buffer for some specific information.
• void vxReleaseBuffer (vx buffer ∗buffer)
Releases a reference to a buffer object. The object may not be garbage collected until its total reference count is zero.
3.5.1 Detailed Description
The Buffer Object interface.
3.5.2 Typedef Documentation
typedef vx reference vx buffer
An opaque reference to a buffer.Buffers are typically an array of scalars or defined data structures.
See Also
vxCreateBuffer
Examples:
xyz module.c.
Definition at line 154 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 49
3.5.3 Enumeration Type Documentation
enum vx buffer attribute e
The buffer attributes list.
Enumerator
VX BUFFER ATTRIBUTE UNITSIZE Used to query a buffers unit size. Use a vx size parameter.
VX BUFFER ATTRIBUTE NUMUNITS Used to query a buffers number of units. Use a vx size parameter.
VX BUFFER ATTRIBUTE SIZE Used to query a buffer total bytes size. Use a vx size parameter.
Definition at line 818 of file vx types.h.
3.5.4 Function Documentation
vx status vxAccessBufferRange ( vx buffer buffer, vx size start, vx size end, void ∗∗ ptr )
This allows access to a sub-range of the a buffer.Parameters
in buffer The buffer to access.in start The start index.in end The end index.in ptr The user supplied pointer to a pointer.
Returns
A vx status e enumeration.
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx.h>#include <string.h>
vx status example bufferrange(vx context context){
vx status status = VX SUCCESS;vx size totalsize = 1024, subsize;vx size start = 20, end = 512;vx buffer buffer = vxCreateBuffer(context, sizeof(vx uint8), totalsize);
void *ptr = NULL;
/* how many bytes are in the the buffer range? */subsize = vxComputeBufferRangeSize(buffer, start, end);
/* we could allocate the sub-buffer or leave it up to OpenVX */#if defined(USER COPY OF BUFFER)
/* we want to make our own malloc’d pointer */ptr = malloc(subsize);
#else/* OpenVX will decide how to give access since ptr = NULL. */
#endif
CHAPTER 3. MODULE DOCUMENTATION 50
/* request access to the buffer data */status = vxAccessBufferRange(buffer, start, end, &ptr);
/* initialize to a known value */memset(ptr, 42, subsize);
/* commit the data back to the object */status = vxCommitBufferRange(buffer, start, end, ptr);
return status;}
Examples:
xyz module.c.
Referenced by XYZKernel().
vx status vxCommitBufferRange ( vx buffer buffer, vx size start, vx size end, void ∗ ptr )
Commits data back to the buffer object.This allows a user to commit data to a sub-range of a buffer.
Parameters
in buffer The buffer to access.in start The start index.in end The end index.in ptr The user supplied pointer.
Returns
A vx status e enumeration.
Examples:
xyz module.c.
Referenced by XYZKernel().
vx size vxComputeBufferRangeSize ( vx buffer buffer, vx uint32 start, vx uint32 end )
Computes the byte size of a buffer range.This computes the size of the buffer needed to hold the range defined by the start and end.
Parameters
in buffer The buffer reference.in start The start indexin end The end index
Returns
vx size
vx buffer vxCreateBuffer ( vx context context, vx size unitSize, vx size numUnits )
Creates an opaque reference to a buffer in memory.Parameters
in context The reference to the implementation context.in unitSize The size of the unit in bytes.
CHAPTER 3. MODULE DOCUMENTATION 51
in numUnits The number of units in the buffer.
Returns
Returns a buffer reference.
Return values
0 when an error is encountered.
Precondition
vxCreateContext
Postcondition
vxReleaseBuffer
Examples:
vx factory pipeline.c.
Referenced by vxPipelineGraphFactory().
vx buffer vxCreateBufferFromHandle ( vx context context, vx size unitSize, vx size numUnits, void ∗ ptr,vx enum type )
Creates a buffer object backed by externally allocated memory.Parameters
in context The reference to implementation context.in unitSize The size of the units in bytes.in numUnits The number of units in the buffer.in ptr The handle to the external memory.in type The vx import type e. When using VX IMPORT TYPE HOST the ptr is
assumed to be a pointer to the buffer in HOST memory.
Returns
Returns vx buffer.
Return values
0 Buffer could not be created.∗ Valid buffer object reference.
Precondition
vxCreateContext
Postcondition
vxReleaseBuffer
vx buffer vxCreateVirtualBuffer ( vx context context )
Creates an opaque reference to a buffer in memory with no direct user access.Virtual Buffers are useful when buffer ranges or unit sizes are unknown ahead of time.
CHAPTER 3. MODULE DOCUMENTATION 52
Parameters
in context The reference to the implementation context.
Returns
Returns an buffer reference
Return values
0 when an error is encountered.
Precondition
vxCreateContext
Postcondition
vxReleaseBuffer
vx status vxQueryBuffer ( vx buffer buffer, vx enum attribute, void ∗ ptr, vx size size )
Queries the buffer for some specific information.Parameters
in buffer The reference to the buffer.in attribute The attribute to query. Use a vx buffer attribute e.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No errorsVX ERROR INVALID REF-
ERENCEif the buffer is not a vx buffer.
VX ERROR INVALID PAR-AMETERS
if any of the other parameters are incorrect.
VX ERROR NOT SUPPO-RTED
if the attribute is not a value supported on this implementation.
Precondition
vxCreateBuffer or vxCreateVirtualBuffer
Postcondition
vxReleaseBuffer
Examples:
xyz module.c.
Referenced by XYZInputValidator(), and XYZKernel().
void vxReleaseBuffer ( vx buffer ∗ buffer )
Releases a reference to a buffer object. The object may not be garbage collected until its total reference count iszero.
CHAPTER 3. MODULE DOCUMENTATION 53
Parameters
in buffer The pointer to a buffer to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateBuffer
Examples:
vx factory pipeline.c.
Referenced by vxPipelineGraphFactory().
CHAPTER 3. MODULE DOCUMENTATION 54
3.6 Object: Kernel
The list of supported kernels and the Kernel Object interface.
Macros
• #define VX MAX KERNEL NAME (256)
The maximum string length of a kernel name to be added to OpenVX.
Typedefs
• typedef vx reference vx kernel
An opaque reference to the descriptor of a kernel.
Enumerations
• enum vx kernel attribute e {VX KERNEL ATTRIBUTE NUMPARAMS = ((( 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.
• 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 BAS-E) + 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 BA-SE) + 0x14,VX KERNEL 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 B-
CHAPTER 3. MODULE DOCUMENTATION 55
ASE) + 0x17,VX KERNEL ACCUMULATE SQUARE = VX KERNEL BASE(VX ID KHRONOS, VX LIBRARY KHR BAS-E) + 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 B-ASE) + 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 FAST CORNERS,VX KERNEL OPTICAL FLOW PYR LK,VX KERNEL MAX 1 0 }
The standard list of available vision kernels.
Functions
• vx kernel vxGetKernelByEnum (vx context context, vx enum kernel)
This call uses the vx kernel e to retrieve the kernels.
• vx kernel vxGetKernelByName (vx context context, vx char ∗name)
This allows the user to query a kernel by name once the kernel is loaded from a module.
• vx status 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.
• void vxReleaseKernel (vx kernel ∗kernel)
Release the reference to the kernel. The object may not be garbage collected until its total reference count is zero..
3.6.1 Detailed Description
The list of supported kernels and the Kernel Object interface.
3.6.2 Typedef Documentation
typedef vx reference vx kernel
An opaque reference to the descriptor of a kernel.
See Also
vxGetKernelByNamevxGetKernelByEnum
Definition at line 169 of file vx types.h.
3.6.3 Enumeration Type Documentation
enum vx kernel attribute e
The kernel attributes list.
CHAPTER 3. MODULE DOCUMENTATION 56
Enumerator
VX KERNEL ATTRIBUTE NUMPARAMS Used to query a kernel for the number of parameters the kernelsupports. Use a vx uint32 parameter.
VX KERNEL ATTRIBUTE NAME Used to query the name of the kernel. Not settable. Use a vx char[VX -MAX KERNEL NAME] array.
VX KERNEL ATTRIBUTE ENUM Used to query the enum of the kernel. Not settable. Use a vx enumparameter.
VX KERNEL ATTRIBUTE LOCAL DATA SIZE The local data area allocated with each kernel when it be-comes a node. Use a vx size parameter.
Note
If not set it will default to zero.
VX KERNEL ATTRIBUTE LOCAL DATA PTR The local data pointer allocate with each kernel when it be-comes a node.Use a void pointer parameter. Use a vx size parameter.
Definition at line 724 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 vxSet-ParameterByIndex ∗
• VX TYPE BUFFER for a vx buffer in the size field of vxGetParameterByIndex or vxSet-ParameterByIndex ∗
• or other appropriate types in vx type e.
Note
All kernels in the lower level specification would be reflected here. These names are prone to changingbefore the specification is complete.
Enumerator
VX KERNEL INVALID The invalid kernel is used to for conformance failure in relation to some kernel opera-tion (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 thevx fourcc e code in the images.Parameters
in vx image The input image.out vx image The output image.
See Also
Kernel: Color Convert
VX KERNEL CHANNEL EXTRACT The Generic Channel Extraction Kernel. This kernel can remove individ-ual color channels from an interleaved or semi-planar, planar, sub-sampled planar image. A client couldextract a red channel from an interleaved RGB image or do a Luma extract from a YUV format.
CHAPTER 3. MODULE DOCUMENTATION 57
Parameters
in vx image The input image.in vx enum The channel index. This is not dependant on the input channel order or pack-
ing. See
See Also
vx channel e.
Parameters
out vx image The output image. Must be FOURCC U8 formatted.
See Also
Kernel: Channel Extract
VX KERNEL CHANNEL COMBINE The Generic Channel Combine Kernel. This kernel combine multipleindividual planes into a single multiplanar image of the type specified in the output image.Parameters
in vx image Plane 0, Must be FOURCC U8in vx image Plane 1, Must be FOURCC U8in vx image Plane 2, [optional] Must be FOURCC U8in vx image Plane 3, [optional] Must be FOURCC U8out vx image Output Image. FOURCC RGB, FOURCC NV12, or FOURCC IYUV.
See Also
Kernel: Channel Combine
VX KERNEL SOBEL 3x3 The Sobel 3x3 Filter Kernel.Parameters
in vx image Input Image. Must be FOURCC U8out vx image Output Gradient X image. Must be FOURCC S16.out vx image Output Gradient Y image. Must be FOURCC S16.
See Also
Kernel: Sobel 3x3
VX KERNEL MAGNITUDE The Magnitude Kernel. This kernel produces a magnitude plane from two inputgradients.Parameters
in vx image The input x image in FOURCC S16in vx image The input y image in FOURCC S16out vx image The output magnitude plane in FOURCC U8
See Also
Kernel: Magnitude
VX KERNEL PHASE The Magnitude Kernel. This kernel produces a phase plane from two input gradients.Parameters
in vx image The input x image in FOURCC S16in vx image The input y image in FOURCC S16out vx image The output phase plane in FOURCC U8. 0-255 map to 0 to 2∗PI.
See Also
Kernel: Phase
VX KERNEL SCALE IMAGE The Scale Image Kernel. This kernel provides resizing of an input image to anoutput image. The scaling factor is determined but the relative sizes of the input and output.
CHAPTER 3. MODULE DOCUMENTATION 58
Parameters
in vx image The input image.out vx image The output image. This must not be a virtual image.in vx enum The filtering type. VX FILTER DEFAULT is the default.
See Also
Kernel: Scale Image
VX KERNEL TABLE LOOKUP The Table Lookup kernel.Parameters
in vx image The input image in FOURCC U8.in vx lut The LUT which is of type VX TYPE UINT8.out vx image The output image of type FOURCC U8.
See Also
Kernel: TableLookup
VX KERNEL HISTOGRAM The Histogram Kernel.Parameters
in vx image The input image.out vx distribution The distribution.
See Also
Kernel: Histogram
VX KERNEL EQUALIZE HISTOGRAM The Histogram Equalization Kernel.Parameters
in vx image The grayscale input image in FOURCC U8.out vx image The grayscale output image of type FOURCC U8 with equalized brightness
and contrast.
See Also
Kernel: Equalize Histogram
VX KERNEL ABSDIFF The Absolute Difference Kernel.Parameters
in vx image An input image.in vx image An input image.out vx image The output image.
See Also
Kernel: Absolute Difference
VX KERNEL MEAN STDDEV The Mean and Standard Deviation Kernel.Parameters
in vx image The input image.out vx scalar A VX TYPE FLOAT32 value outputting the mean.out vx scalar A VX TYPE FLOAT32 value outputting the standard deviation.
See Also
Kernel: Mean and Standard Deviation.
VX KERNEL THRESHOLD The Threshold Kernel.
CHAPTER 3. MODULE DOCUMENTATION 59
Parameters
in vx image A FOURCC U8 image.in vx threshold A VX THRESHOLD TYPE BINARYout vx image A FOURCC U8 with either 0 or 255 as values.
See Also
Kernel: Thresholding
VX KERNEL INTEGRAL IMAGE The Integral Image Kernel.Parameters
in vx image A FOURCC U8 image.out vx image A FOURCC U32 image.
See Also
Kernel: Integral Image
VX KERNEL DILATE 3x3 The dilate kernel.Parameters
in vx image The FOURCC U8 input image.out vx image The FOURCC U8 output image.
See Also
Kernel: Dilate Image
VX KERNEL ERODE 3x3 The erode kernel.Parameters
in vx image The FOURCC U8 input image.out vx image The FOURCC U8 output image.
See Also
Kernel: Dilate Image
VX KERNEL MEDIAN 3x3 The median image filter.Parameters
in vx image The FOURCC U8 input image.out vx image The FOURCC U8 output image.
See Also
Kernel: Median Filter
VX KERNEL BOX 3x3 The box filter kernel.Parameters
in vx image The FOURCC U8 input image.out vx image The FOURCC U8 output image.
See Also
Kernel: Box Filter
VX KERNEL GAUSSIAN 3x3 The gaussian filter kernel.Parameters
CHAPTER 3. MODULE DOCUMENTATION 60
in vx image The FOURCC U8 input image.out vx image The FOURCC U8 output image.
See Also
Kernel: Gaussian Filter
VX KERNEL CUSTOM CONVOLUTION The custom convolution kernel.Parameters
in vx image The FOURCC U8 input image.in vx convolution The vx int16 symmetric matrix.out vx image The FOURCC S16 output image.
See Also
Kernel: Custom Convolution
VX KERNEL PYRAMID The image pyramid kernel.Parameters
in vx image The input FOURCC U8 image.out vx pyramid The pyramid object with the defined number of levels.
See Also
Kernel: Image Pyramid
VX KERNEL ACCUMULATE The accumulation kernel.Parameters
in vx image The input FOURCC U8 image.in,out vx image The accumulation image.
See Also
Kernel: Accumulate
VX KERNEL ACCUMULATE WEIGHTED The weigthed accumulation kernel.Parameters
in vx image The input FOURCC U8 image.in vx scalar The alpha value.
in,out vx image The accumulation image.
See Also
Kernel: Accumulate Weighted
VX KERNEL ACCUMULATE SQUARE The squared accumulation kernel.Parameters
in vx image The input FOURCC U8 image.in,out vx image The accumulation image.
See Also
Kernel: Accumulate Squared
VX KERNEL MINMAXLOC The min and max location kernel.Parameters
in vx image The input image.
CHAPTER 3. MODULE DOCUMENTATION 61
out vx scalar The minimum value.out vx scalar The maximum value.out vx coordinates The minimum locationout vx coordinates The maximum location
See Also
Kernel: Min, Max Location
VX KERNEL CONVERTDEPTH The bit-depth conversion kernel.Parameters
in vx image The input image. Formats include FOURCC U8, FOURCC U16.out vx image The output image. Formats include FOURCC U8, FOURCC U16.in vx scalar The enumeration of the vx convert policy e.in vx scalar The vx int32 shift value.
See Also
Kernel: Convert Bit depth
VX KERNEL CANNY EDGE DETECTOR The Canny Edge Detector.Parameters
in vx image The input FOURCC U8 image.in vx threshold The double threshold for hysteresis.out vx image The output image in FOURCC U8 format.
See Also
Kernel: Canny Edge Detector
VX KERNEL AND The Bitwise And Kernel.Parameters
in vx image Input image used as an operand.in vx image Input image used as an operand.out vx image The output image containing the result of the operation.
See Also
Kernel: Bitwise And
VX KERNEL OR The Bitwise Inclusive Or Kernel.Parameters
in vx image Input image used as an operand.in vx image Input image used as an operand.out vx image The output image containing the result of the operation.
See Also
Kernel: Bitwise Inclusive Or
VX KERNEL XOR The Bitwise Exclusive Or Kernel.Parameters
in vx image Input image used as an operand.in vx image Input image used as an operand.out vx image The output image containing the result of the operation.
See Also
Kernel: Bitwise Exclusive Or
VX KERNEL NOT The Bitwise Not Kernel.
CHAPTER 3. MODULE DOCUMENTATION 62
Parameters
in vx image Input image used as the operand.out vx image The output image containing the result of the operation.
See Also
Kernel: Bitwise Not
VX KERNEL MULTIPLY The Pixelwise Multiplication Kernel.Parameters
in vx image Input image used as an operand.in vx image Input image used as an operand.in vx scalar A non-negative VX TYPE FLOAT32 scale multiplied to each product before
overflow handling.in vx enum Overflow policy, an enumeration of the vx convert policy e.out vx image The output image containing the result of the operation.
See Also
Kernel: Pixel-wise Multiplication
VX KERNEL ADD The Addition Kernel.Parameters
in vx image Input image used as an operand.in vx image Input image used as an operand.in vx enum Overflow policy, an enumeration of the vx convert policy e.out vx image The output image containing the result of the operation.
See Also
Kernel: Arithmetic Addition
VX KERNEL SUBTRACT The Subtraction Kernel.Parameters
in vx image Input image used as an operand.in vx image Input image used as an operand.in vx enum Overflow policy, an enumeration of the vx convert policy e.out vx image The output image containing the result of the operation.
See Also
Kernel: Arithmetic Subtraction
VX KERNEL WARP AFFINE The Warp Affine Kernel.Parameters
in vx image The input image.in vx matrix The 2x3 affine matrix.in vx enum The Interpolation type from vx interpolation type e.out vx image The output image.
See Also
Kernel: Warp Affine
VX KERNEL WARP PERSPECTIVE The Warp Perspective Kernel.Parameters
CHAPTER 3. MODULE DOCUMENTATION 63
in vx image The input image.in vx matrix The 3x3 perspective matrix.in vx enum The Interpolation type from vx interpolation type e.out vx image The output image.
See Also
Kernel: Warp Perspective
VX KERNEL HARRIS CORNERS The Harris Corners Kernel.Parameters
in vx image The input image.in vx scalar The sensitivity factor.in vx scalar The minimum threshold which to eliminate Harris Corner scores.in vx scalar The radial Euclidean distance for non-maximum suppression.in vx scalar The VX TYPE FLOAT32 scalar sensitivity threshold k from the Harris--
Stephens equation.in vx scalar The gradient window size to use on the input. The implementation must sup-
port at least 3, 5, and 7.in vx scalar The block window size used to compute the harris corner score. The imple-
mentation must support at least 3, 5, and 7.out vx list The list of output coordinates.
See Also
Kernel: Harris Corners
VX KERNEL FAST CORNERS The FAST Corners Kernel.Parameters
in vx image input The input grayscale image (FOURCC U8).in vx scalar strength thresh Threshold on difference between intensity of the central pixel
and pixels on Bresenhams circle of radius 3 (VX TYPE FLOAT32 scalar)in vx bool nonmax supression If true, non-maximum suppression is applied to detected
corners (keypoints)out vx list corners Output corner list (vx list of vx keypoint)
See Also
Kernel: Fast Corners
VX KERNEL OPTICAL FLOW PYR LK The Optical Flow Pyramid (LK) Kernel.
See Also
Kernel: Optical Flow Pyramid (LK)
Definition at line 58 of file vx kernels.h.
3.6.4 Function Documentation
vx kernel vxGetKernelByEnum ( vx context context, vx enum kernel )
This call uses the vx kernel e to retrieve the kernels.Enum values above the standard set are assumed to apply to loaded modules.
Parameters
in context The reference to the implementation context.in kernel
Returns
Returns a kernel reference or zero if an error occurred.
CHAPTER 3. MODULE DOCUMENTATION 64
Return values
0 The kernel enumeration was not found in the context.
Precondition
vxCreateContextvxLoadKernels (optional)
Postcondition
vxReleaseKernel
See Also
vxGetKernelByName
Examples:
vx factory corners.c, vx factory edge.c, vx factory pipeline.c, and vx helper.c.
Referenced by vxCornersGraphFactory(), vxCreateNodeByStructure(), vxEdgeGraphFactory(), and vxPipeline-GraphFactory().
vx kernel vxGetKernelByName ( vx context context, vx char ∗ name )
This allows the user to query a kernel by name once the kernel is loaded from a module.Parameters
in context The reference to the implementation context.in name The string of the name of the kernel to get.
Returns
Returns a kernel reference or zero if an error occurred.
Return values
0 The kernel name was not found in the context.
See Also
vxLoadKernels
Precondition
vxCreateContextvxLoadKernels (optional)
Postcondition
vxReleaseKernel
Note
User Kernels should follow a ”dotted” heirarchical syntax. For example: ”org.khronos.example.xyz”.
Examples:
vx xyz ext.c.
vx status 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.
CHAPTER 3. MODULE DOCUMENTATION 65
Parameters
in kernel The kernel reference to query.in attribute The attribute to query. Use a vx kernel attribute e.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No errorsVX ERROR INVALID REF-
ERENCEif the kernel is not a vx kernel.
VX ERROR INVALID PAR-AMETERS
if any of the other parameters are incorrect.
VX ERROR NOT SUPPO-RTED
if the attribute value is not supported in this implementation.
Precondition
vxGetKernelByName or vxGetKernelByEnum
Examples:
vx parameters.c.
void vxReleaseKernel ( vx kernel ∗ kernel )
Release the reference to the kernel. The object may not be garbage collected until its total reference count is zero..Parameters
in kernel The pointer to the kernel reference to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxGetKernelByName or vxGetKernelByEnum
Examples:
vx factory corners.c, vx factory pipeline.c, vx helper.c, and vx xyz ext.c.
Referenced by vxCornersGraphFactory(), vxCreateNodeByStructure(), and vxPipelineGraphFactory().
CHAPTER 3. MODULE DOCUMENTATION 66
3.7 Object: Node
The Node Object interface.
Modules
• Node: Border Modes
The border mode behaviors.
Typedefs
• typedef vx reference vx node
An opaque reference to a kernel node.
• typedef vx action(∗ vx nodecomplete f )(vx node node)
A callback to the client once a particular node has completed.
Enumerations
• enum vx node attribute e {VX NODE ATTRIBUTE STATUS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE NODE << 8)) + 0x0,VX NODE ATTRIBUTE PERFORMANCE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE NODE << 8)) +0x1,VX NODE ATTRIBUTE BORDER MODE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE NODE << 8)) +0x2,VX NODE ATTRIBUTE LOCAL DATA SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE NODE << 8)) +0x3,VX NODE ATTRIBUTE LOCAL DATA PTR = ((( VX ID KHRONOS ) << 20) | ( VX TYPE NODE << 8)) +0x4 }
The node attributes list.
Functions
• vx status vxAssignNodeCallback (vx node node, vx nodecomplete f callback)
Assigns a callback to a node. If a callback already exists in this node, this function must return an error and the usermay clear the callback by passing a NULL pointer as the callback.
• vx node vxCreateNode (vx graph graph, vx kernel kernel)
Creates a reference to a node object.
• vx status vxQueryNode (vx node node, vx enum attribute, void ∗ptr, vx size size)
Allows a user to query information out of a node.
• void vxReleaseNode (vx node ∗node)
Releases a reference to a node object. The object may not be garbage collected until its total reference count is zero.
• vx nodecomplete f vxRetrieveNodeCallback (vx node node)
Retrieves the current node callback function pointer set on the node.
• vx status vxSetNodeAttribute (vx node node, vx enum attribute, void ∗ptr, vx size size)
Allows a user to set attribute of a node before Graph Validation.
3.7.1 Detailed Description
The Node Object interface.
CHAPTER 3. MODULE DOCUMENTATION 67
3.7.2 Typedef Documentation
typedef vx reference vx node
An opaque reference to a kernel node.
See Also
vxCreateNode
Definition at line 184 of file vx types.h.
typedef vx action(∗ vx nodecomplete f)(vx node node)
A callback to the client once a particular node has completed.
See Also
vx actionvxAddCallbackToNode
Parameters
in node The node which the callback was attached.
Returns
Returns an action code from vx action e.
Definition at line 410 of file vx types.h.
3.7.3 Enumeration Type Documentation
enum vx node attribute e
The node attributes list.
Enumerator
VX NODE ATTRIBUTE STATUS Used to query the status of node execution. Use a vx status parameter.
VX NODE ATTRIBUTE PERFORMANCE Used to query the performance of the node execution. Use a vx-perf t parameter.
VX NODE ATTRIBUTE BORDER MODE Used to get or set the border mode of the node. Use a vx -border mode t structure.
VX NODE ATTRIBUTE LOCAL DATA SIZE Used to indicate the size of the kernel local memory area. Usea vx size parameter.
VX NODE ATTRIBUTE LOCAL DATA PTR Used to indicate the pointer kernel local memory area. Use avoid ∗ parameter.
Definition at line 752 of file vx types.h.
3.7.4 Function Documentation
vx status vxAssignNodeCallback ( vx node node, vx nodecomplete f callback )
Assigns a callback to a node. If a callback already exists in this node, this function must return an error and the usermay clear the callback by passing a NULL pointer as the callback.
CHAPTER 3. MODULE DOCUMENTATION 68
Parameters
in node The reference to the node.in callback The callback to associate with completion of this specific node
Note
This should be used with extreme caution as it can ruin potential optimizations in the power/performanceefficiency of a graph.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Callback assigned.VX ERROR INVALID REF-
ERENCEThe value passed as node was not a vx node.
Precondition
vxCreateNode
Examples:
vx factory pipeline.c.
Referenced by vxPipelineGraphFactory().
vx node vxCreateNode ( vx graph graph, vx kernel kernel )
Creates a reference to a node object.Parameters
in graph The reference to the graph in which this node will exist.in kernel The kernel reference which will be associated with this new node.
Returns
vx node
Return values
0 The node failed to create.∗ A node was created.
Precondition
vxCreateGraphvxGetKernelByNamevxGetKernelByEnum
Postcondition
vxReleaseNode
Examples:
vx factory corners.c, vx factory edge.c, vx factory pipeline.c, vx helper.c, vx parameters.c, and vx xyz ext.c.
Referenced by vxCornersGraphFactory(), vxCreateNodeByStructure(), vxEdgeGraphFactory(), and vxPipeline-GraphFactory().
vx status vxQueryNode ( vx node node, vx enum attribute, void ∗ ptr, vx size size )
Allows a user to query information out of a node.
CHAPTER 3. MODULE DOCUMENTATION 69
Parameters
in node The reference to the node to query.in attribute Use vx node attribute e value to query for information.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Returns
A vx status e enumeration.
Return values
VX SUCCESS SuccessfulVX ERROR INVALID PAR-
AMETERSThe type or size was incorrect.
Precondition
vxCreateNode
Examples:
vx tiling main.c.
void vxReleaseNode ( vx node ∗ node )
Releases a reference to a node object. The object may not be garbage collected until its total reference count iszero.Parameters
in node The pointer to the reference of the node to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateNode
Examples:
vx factory corners.c, vx factory pipeline.c, vx helper.c, vx parameters.c, vx tiling main.c, and vx xyz ext.c.
Referenced by vxCornersGraphFactory(), vxCreateNodeByStructure(), and vxPipelineGraphFactory().
vx nodecomplete f vxRetrieveNodeCallback ( vx node node )
Retrieves the current node callback function pointer set on the node.Parameters
in node The reference to the vx node object.
Returns
vx nodecomplete f The pointer to the callback function.
Return values
CHAPTER 3. MODULE DOCUMENTATION 70
NULL No callback has been set.∗ The node callback function.
vx status vxSetNodeAttribute ( vx node node, vx enum attribute, void ∗ ptr, vx size size )
Allows a user to set attribute of a node before Graph Validation.Parameters
in node The reference to the node to set.in attribute Use vx node attribute e value to query for information.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Note
Some attributes are inherited from the vx kernel which was used to create the node. Some of these canbe overridden using this API, notable VX NODE ATTRIBUTE LOCAL DATA SIZE, VX NODE ATTRIBUTE -LOCAL DATA PTR.
Returns
A vx status e enumeration.
Return values
VX SUCCESS The attribute was set.VX ERROR INVALID REF-
ERENCEnode was not a vx node.
VX ERROR INVALID PAR-AMETER
size was not correct for the type needed.
Precondition
vxCreateNode
Examples:
vx tiling main.c.
CHAPTER 3. MODULE DOCUMENTATION 71
3.8 Object: Graph
The Graph Object interface.
Typedefs
• typedef vx enum vx action
The formal typedef of the response from the callback.
• typedef vx reference vx graph
An opaque reference to a graph.
Enumerations
• enum vx action e {VX ACTION CONTINUE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM ACTION << 12)) + 0x0,VX ACTION RESTART = ((( VX ID KHRONOS ) << 20) | ( VX ENUM ACTION << 12)) + 0x1,VX ACTION ABANDON = ((( VX ID KHRONOS ) << 20) | ( VX ENUM ACTION << 12)) + 0x2 }
A return code enumeration from a vx nodecomplete f during execution.
• enum vx graph attribute e {VX GRAPH ATTRIBUTE NUMNODES = ((( VX ID KHRONOS ) << 20) | ( VX TYPE GRAPH << 8)) + 0x0,VX GRAPH ATTRIBUTE STATUS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE GRAPH << 8)) + 0x1,VX GRAPH ATTRIBUTE PERFORMANCE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE GRAPH << 8))+ 0x2,VX GRAPH ATTRIBUTE NUMPARAMETERS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE GRAPH <<8)) + 0x3 }
The graph attributes list.
Functions
• vx status vxAddParameterToGraph (vx graph graph, vx parameter parameter)
Add the given parameter from a vx node to the graph.
• vx graph vxCreateGraph (vx context context)
Creates an empty graph.
• vx parameter vxGetGraphParameterByIndex (vx graph graph, vx uint32 index)
Retrieves the parameter object which describes the attributes of the parameter and it’s current value.
• vx bool vxIsGraphVerified (vx graph graph)
Returns a boolean to indicate the state of graph verification.
• vx status vxProcessGraph (vx graph graph)
This function causes the synchronous processing of a graph. If the graph has not been verified, then the imple-mentation will verify the graph immediately. If verification fails this function will return a status identical to whatvxVerifyGraph would return. After the graph verfies successfully then processing will occur. If the graph waspreviously verified via vxVerifyGraph or vxProcessGraph then the graph is processed. This function willblock until the graph is completed.
• vx status vxQueryGraph (vx graph graph, vx enum attribute, void ∗ptr, vx size size)
Allows the user to query the graph.
• void vxReleaseGraph (vx graph ∗graph)
Releases a reference to a graph. The object may not be garbage collected until its total reference count is zero.. Oncethe reference count is zero, all node references in the graph will be automatically released as well. Data referencedby those nodes may not be released as the user may have external references to the data.
• vx status vxScheduleGraph (vx graph graph)
Schedules a graph for future execution.
• vx status vxSetGraphParameterByIndex (vx graph graph, vx uint32 index, vx enum dir, vx reference value)
Sets a reference to the parameter on the graph. The implementation must set this parameter on the originating nodeas well.
• vx status vxVerifyGraph (vx graph graph)
CHAPTER 3. MODULE DOCUMENTATION 72
This call verifies the state of the graph before it is executed. This is useful to catch programmer errors and contracterrors. If not verified, the graph will verify before being processed.
• vx status vxWaitGraph (vx graph graph)
Waits for a specific graph to complete.
3.8.1 Detailed Description
The Graph Object interface.
3.8.2 Typedef Documentation
typedef vx enum vx action
The formal typedef of the response from the callback.
See Also
vx action e
Definition at line 401 of file vx types.h.
typedef vx reference vx graph
An opaque reference to a graph.
See Also
vxCreateGraph
Definition at line 191 of file vx types.h.
3.8.3 Enumeration Type Documentation
enum vx action e
A return code enumeration from a vx nodecomplete f during execution.
See Also
vxAssignNodeCallback
Enumerator
VX ACTION CONTINUE Continue executing the graph with no changes.
VX ACTION RESTART Stop executing the graph at the current point and restart from the beginning.
VX ACTION ABANDON Stop executing the graph.
Definition at line 541 of file vx types.h.
enum vx graph attribute e
The graph attributes list.
Enumerator
VX GRAPH ATTRIBUTE NUMNODES Returns the number of nodes in a graph. Use a vx uint32 param-eter.
VX GRAPH ATTRIBUTE STATUS Returns the overall status of the graph. Use a vx status parameter.
VX GRAPH ATTRIBUTE PERFORMANCE Returns the overall performance of the graph. Use a vx perf-t parameter.
VX GRAPH ATTRIBUTE NUMPARAMETERS Returns the number of explicitly declared parameters on thegraph. Use a vx uint32 parameter.
Definition at line 830 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 73
3.8.4 Function Documentation
vx status vxAddParameterToGraph ( vx graph graph, vx parameter parameter )
Add the given parameter from a vx node to the graph.
CHAPTER 3. MODULE DOCUMENTATION 74
Parameters
in graph The graph reference which contains the node.in parameter The parameter reference to add to the graph from the node.
Returns
Returns a vx status e enumeration.
Return values
VX SUCCESS Parameter added to Graph.VX ERROR INVALID REF-
ERENCEThe parameter was not a valid vx parameter
VX ERROR INVALID PAR-AMETER
The parameter was of a node not in this graph.
Examples:
vx factory edge.c, and vx helper.c.
Referenced by vxAddParameterToGraphByIndex(), and vxEdgeGraphFactory().
vx graph vxCreateGraph ( vx context context )
Creates an empty graph.Parameters
in context The reference to the implementation context.
Returns
Return a graph reference
Return values
0 if an error occurred.
Precondition
vxCreateContext
Postcondition
vxReleaseGraph
Examples:
vx eyetrack.c, vx factory corners.c, vx factory edge.c, vx factory pipeline.c, vx tiling main.c, and vx xyz ext.c.
Referenced by example eyetracking(), example super resolution(), vxCornersGraphFactory(), vxEdgeGraph-Factory(), and vxPipelineGraphFactory().
vx parameter vxGetGraphParameterByIndex ( vx graph graph, vx uint32 index )
Retrieves the parameter object which describes the attributes of the parameter and it’s current value.Parameters
in graph The graph.
CHAPTER 3. MODULE DOCUMENTATION 75
in index The index of the parameter.
Returns
Returns vx parameter reference.
Return values
0 if the index was out of bounds.∗ The parameter reference.
Postcondition
vxReleaseParameter
Referenced by main().
vx bool vxIsGraphVerified ( vx graph graph )
Returns a boolean to indicate the state of graph verification.Parameters
in graph The reference to the graph to check.
Returns
vx bool
Return values
vx true e The graph is verified.vx false e The graph not verified. It must be verified before execution either through vx-
VerifyGraph or automatically through vxProcessGraph, vxSchedule-Graph.
vx status vxProcessGraph ( vx graph graph )
This function causes the synchronous processing of a graph. If the graph has not been verified, then the imple-mentation will verify the graph immediately. If verification fails this function will return a status identical to whatvxVerifyGraph would return. After the graph verfies successfully then processing will occur. If the graph waspreviously verified via vxVerifyGraph or vxProcessGraph then the graph is processed. This function willblock until the graph is completed.Parameters
in graph The graph to execute.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Graph has been processed.VX FAILURE A catastrophic error occurred during processing.
∗ See vxVerifyGraph
Precondition
vxCreateGraph
See Also
vxVerifyGraph
Examples:
vx eyetrack.c, vx tiling main.c, and vx xyz ext.c.
Referenced by example eyetracking(), example super resolution(), and main().
CHAPTER 3. MODULE DOCUMENTATION 76
vx status vxQueryGraph ( vx graph graph, vx enum attribute, void ∗ ptr, vx size size )
Allows the user to query the graph.
CHAPTER 3. MODULE DOCUMENTATION 77
Parameters
in graph The reference to the created graph.in attribute The vx graph attribute e type needed.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Returns
A vx status e enumeration.
Precondition
vxCreateGraph
Referenced by main().
void vxReleaseGraph ( vx graph ∗ graph )
Releases a reference to a graph. The object may not be garbage collected until its total reference count is zero..Once the reference count is zero, all node references in the graph will be automatically released as well. Datareferenced by those nodes may not be released as the user may have external references to the data.Parameters
in graph The pointer to the graph to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateGraph
Examples:
vx eyetrack.c, vx factory edge.c, vx tiling main.c, and vx xyz ext.c.
Referenced by example eyetracking(), example super resolution(), main(), and vxEdgeGraphFactory().
vx status vxScheduleGraph ( vx graph graph )
Schedules a graph for future execution.Parameters
in graph The graph to schedule.
Returns
A vx status e enumeration.
Return values
VX ERROR NO RESOUR-CES
The graph can not be scheduled now.
VX ERROR NOT SUFFICI-ENT
The graph was not verified and has failed forced verification.
CHAPTER 3. MODULE DOCUMENTATION 78
VX SUCCESS The graph has been scheduled.
vx status vxSetGraphParameterByIndex ( vx graph graph, vx uint32 index, vx enum dir, vx referencevalue )
Sets a reference to the parameter on the graph. The implementation must set this parameter on the originatingnode as well.Parameters
in graph The graph reference.in index The parameter index.in dir The vx direction e of the parameter.in value The reference to set to the parameter.
Returns
Returns a vx status e enumeration.
Return values
VX SUCCESS Parameter set to Graph.VX ERROR INVALID REF-
ERENCEThe value was not a valid vx reference
VX ERROR INVALID PAR-AMETER
The parameter index was out of bounds or the dir parameter was incorrect
Referenced by main().
vx status vxVerifyGraph ( vx graph graph )
This call verifies the state of the graph before it is executed. This is useful to catch programmer errors and contracterrors. If not verified, the graph will verify before being processed.
Note
Memory for data objects is not guarenteed to exist before this call. After this call data objects will exist unlessthe implementation optimized them out.
Parameters
in graph The reference to the graph to verify. return Returns a status code for graphswith more than one error, it is undefined which error will be returned. UsevxGetLogEntry to retreive all errors from the graph verification.
Returns
A vx status e enumeration. For more detailed information, consult the vxGetLogEntry API.
Return values
VX SUCCESS No errors.VX ERROR INVALID REF-
ERENCEif graph is not a vx graph.
VX ERROR MULTIPLE W-RITERS
if the graph contains more than one writer to any data object.
VX ERROR INVALID NOD-E
if a node in the graph is invalid, or failed be created.
CHAPTER 3. MODULE DOCUMENTATION 79
VX ERROR INVALID GRA-PH
if the graph contains cycles or some other invalid topology.
VX ERROR INVALID TYPE if any parameter on a node was given the wrong type.VX ERROR INVALID VAL-
UEif any value of any parameter is out of bounds of specification.
VX ERROR INVALID FOR-MAT
if the image format was not compatible.
Precondition
vxCreateGraph
See Also
vxConvertReferencevxProcessGraph
Examples:
vx eyetrack.c, vx tiling main.c, and vx xyz ext.c.
Referenced by example eyetracking(), example super resolution(), and main().
vx status vxWaitGraph ( vx graph graph )
Waits for a specific graph to complete.Parameters
in graph The graph to wait on.
Returns
A vx status e enumeration.
Return values
VX SUCCESS The graph has completed.VX FAILURE The graph has not completed yet
CHAPTER 3. MODULE DOCUMENTATION 80
3.9 Object: Parameter
The Parameter Object interface.
Typedefs
• typedef vx reference vx parameter
An opaque reference to a single parameter.
Enumerations
• enum vx direction e {VX INPUT = ((( VX ID KHRONOS ) << 20) | ( VX ENUM DIRECTION << 12)) + 0x0,VX OUTPUT = ((( VX ID KHRONOS ) << 20) | ( VX ENUM DIRECTION << 12)) + 0x1,VX BIDIRECTIONAL = ((( VX ID KHRONOS ) << 20) | ( VX ENUM DIRECTION << 12)) + 0x2,VX READ ONLY = VX INPUT,VX WRITE ONLY = VX OUTPUT,VX READ AND WRITE = VX BIDIRECTIONAL }
An indication of how a kernel will treat the given parameter.
• enum vx parameter attribute e {VX PARAMETER ATTRIBUTE INDEX = ((( VX ID KHRONOS ) << 20) | ( VX TYPE PARAMETER << 8))+ 0x0,VX PARAMETER ATTRIBUTE DIRECTION = ((( VX ID KHRONOS ) << 20) | ( VX TYPE PARAMETER<< 8)) + 0x1,VX PARAMETER ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE PARAMETER << 8))+ 0x2,VX PARAMETER ATTRIBUTE STATE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE PARAMETER << 8))+ 0x3,VX PARAMETER ATTRIBUTE REF = ((( VX ID KHRONOS ) << 20) | ( VX TYPE PARAMETER << 8)) +0x4 }
The parameter attributes list.
• enum vx parameter state e {VX PARAMETER STATE REQUIRED = ((( VX ID KHRONOS ) << 20) | ( VX ENUM PARAMETER STAT-E << 12)) + 0x0,VX PARAMETER STATE OPTIONAL = ((( VX ID KHRONOS ) << 20) | ( VX ENUM PARAMETER STATE<< 12)) + 0x1 }
The parameter state type.
Functions
• vx parameter vxGetParameterByIndex (vx node node, vx uint32 index)
This is used to extract a single, particular parameter from a kernel node by specifing its attributes.
• vx status vxQueryParameter (vx parameter param, vx enum attribute, void ∗ptr, vx size size)
This allows the client to query a parameter to determine its meta-information.
• void vxReleaseParameter (vx parameter ∗param)
Releases a reference to a parameter object. The object may not be garbage collected until its total reference count iszero.
• vx status vxSetParameterByIndex (vx node node, vx uint32 index, vx enum direction, vx reference value)
Sets the specified parameter data for a kernel on the node.
• vx status vxSetParameterByReference (vx parameter parameter, vx reference value)
Associates a parameter reference and a data reference with a kernel on a node.
3.9.1 Detailed Description
The Parameter Object interface.
CHAPTER 3. MODULE DOCUMENTATION 81
3.9.2 Typedef Documentation
typedef vx reference vx parameter
An opaque reference to a single parameter.
See Also
vxGetParameterByNamevxGetParameterByIndex
Definition at line 177 of file vx types.h.
3.9.3 Enumeration Type Documentation
enum vx direction e
An indication of how a kernel will treat the given parameter.
Enumerator
VX INPUT The parameter is an input only.
VX OUTPUT The parameter is an output only.
VX BIDIRECTIONAL The parameter is both an input and output.
VX READ ONLY A synonym for VX INPUT
VX WRITE ONLY A synonym for VX OUTPUT
VX READ AND WRITE A synonym for VX BIDIRECTIONAL
Definition at line 553 of file vx types.h.
enum vx parameter attribute e
The parameter attributes list.
Enumerator
VX PARAMETER ATTRIBUTE INDEX Used to query a parameter for its index value on the kernel it is asso-ciated with. Use a vx uint32 parameter.
VX PARAMETER ATTRIBUTE DIRECTION Used to query a parameter for its direction value on the kernelit is associated with. Use a vx enum parameter. Used to query a parameter for its size in bytes or if it isa vx image or vx buffer its vx type e will be returned. Use a vx enum parameter.
VX PARAMETER ATTRIBUTE STATE Used to query a parameter for its state. A value in vx parameter-state e will be returned. Use a vx enum parameter. Used to extract the reference contained in the
parameter. Use a vx reference parameter.
Definition at line 774 of file vx types.h.
enum vx parameter state e
The parameter state type.
Enumerator
VX PARAMETER STATE REQUIRED Default. The parameter must be supplied. If not set, during Verify, anerror will be returned.
VX PARAMETER STATE OPTIONAL The parameter may be unspecified. The kernel will take care not todeference optional parameters until is is certain they valid.
Definition at line 1115 of file vx types.h.
3.9.4 Function Documentation
vx parameter vxGetParameterByIndex ( vx node node, vx uint32 index )
This is used to extract a single, particular parameter from a kernel node by specifing its attributes.
CHAPTER 3. MODULE DOCUMENTATION 82
Parameters
in node The node to extract the parameter from.in index The index of the parameter to get a reference to.
Returns
vx parameter
Precondition
vxCreateNode
See Also
vxGetParameterByName
Postcondition
vxReleaseParameter
Examples:
vx factory edge.c, vx factory pipeline.c, vx helper.c, vx parameters.c, vx tiling ext.c, and xyz module.c.
Referenced by example maximacallback(), vxAddParameterToGraphByIndex(), vxEdgeGraphFactory(), vxLink-ParametersByIndex(), XYZInputValidator(), and XYZOutputValidator().
vx status vxQueryParameter ( vx parameter param, vx enum attribute, void ∗ ptr, vx size size )
This allows the client to query a parameter to determine its meta-information.Parameters
in param The reference to the parameter.in attribute The attribute to query. Use a vx parameter attribute e.out ptr The output pointer where the value will be sent.in size The size of the objects pointed to by out.
Returns
A vx status e enumeration.
Precondition
vxGetParameterByIndex
Examples:
vx factory pipeline.c, vx helper.c, vx parameters.c, vx tiling ext.c, and xyz module.c.
Referenced by example maximacallback(), main(), vxLinkParametersByReference(), XYZInputValidator(), andXYZOutputValidator().
void vxReleaseParameter ( vx parameter ∗ param )
Releases a reference to a parameter object. The object may not be garbage collected until its total reference countis zero.Parameters
CHAPTER 3. MODULE DOCUMENTATION 83
in param The pointer to the parameter to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxGetParameterByIndex
Examples:
vx helper.c, vx parameters.c, vx tiling ext.c, and xyz module.c.
Referenced by main(), vxAddParameterToGraphByIndex(), vxLinkParametersByIndex(), XYZInputValidator(),and XYZOutputValidator().
vx status vxSetParameterByIndex ( vx node node, vx uint32 index, vx enum direction, vx referencevalue )
Sets the specified parameter data for a kernel on the node.Parameters
in node The node which contains the kernel.in index The index of the parameter desired.in direction The direction of the kernel parameter.
See Also
vx direction e.
Parameters
in value The reference to the parameter.
Returns
A vx status e enumeration.
Precondition
vxCreateNode
See Also
vxSetParameterByReference
Postcondition
vxReleaseParameter
Examples:
vx factory corners.c, vx factory edge.c, vx factory pipeline.c, vx helper.c, and vx xyz ext.c.
Referenced by vxCornersGraphFactory(), vxCreateNodeByStructure(), vxEdgeGraphFactory(), and vxPipeline-GraphFactory().
vx status vxSetParameterByReference ( vx parameter parameter, vx reference value )
Associates a parameter reference and a data reference with a kernel on a node.
CHAPTER 3. MODULE DOCUMENTATION 84
Parameters
in parameter The reference to the kernel parameter.in value The value to associate with the kernel parameter.
Returns
A vx status e enumeration.
Precondition
vxCreateNode
See Also
vxGetParameterByIndexvxGetParameterByName
Postcondition
vxReleaseParameter
Examples:
vx helper.c.
Referenced by vxLinkParametersByReference().
CHAPTER 3. MODULE DOCUMENTATION 85
3.10 Object: Reference
The Reference Object interface.
Typedefs
• typedef uintptr t vx reference
A generic opaque reference.
Enumerations
• enum vx reference attribute e {VX REF ATTRIBUTE COUNT = ((( VX ID KHRONOS ) << 20) | ( VX TYPE REFERENCE << 8)) + 0x0,VX REF ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE REFERENCE << 8)) + 0x1 }
The reference attributes list.
Functions
• vx status vxQueryReference (vx reference ref, vx enum attribute, void ∗ptr, vx size size)
Used to query any reference type for some basic information (count, type)
3.10.1 Detailed Description
The Reference Object interface.
3.10.2 Typedef Documentation
typedef uintptr t vx reference
A generic opaque reference.A user should not assume that this can be casted directly to anything, however, sub-typed units can be cast
back to this.Definition at line 120 of file vx types.h.
3.10.3 Enumeration Type Documentation
enum vx reference attribute e
The reference attributes list.
Enumerator
VX REF ATTRIBUTE COUNT Returns the reference count of the object. Use a vx uint32 parameter.
VX REF ATTRIBUTE TYPE Returns the vx type e of the reference. Use a vx enum parameter.
Definition at line 679 of file vx types.h.
3.10.4 Function Documentation
vx status vxQueryReference ( vx reference ref, vx enum attribute, void ∗ ptr, vx size size )
Used to query any reference type for some basic information (count, type)Parameters
in ref The reference to query.
CHAPTER 3. MODULE DOCUMENTATION 86
in attribute The value to query for. Use vx reference attribute e.out ptr The location to store the value.in size The size of the location pointed to by ptr.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 87
3.11 Object: Pyramid
The Image Pyramid Object Interface.
Macros
• #define VX SCALE PYRAMID DOUBLE (2.0f)
Used to indicate a double scale pyramid.
• #define VX SCALE PYRAMID HALF (0.5f)
Used to indicate a half-scale pyramid.
• #define VX SCALE PYRAMID ORB ((vx float32)0.8408964f)
Used to indicate a ORB scaled pyramid whose scaling factor is 14√2
.
Typedefs
• typedef vx reference vx pyramid
The Image Pyramid object. A set of scaled images.
Enumerations
• enum vx pyramid attribute e {VX PYRAMID ATTRIBUTE LEVELS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE PYRAMID << 8)) + 0x0,VX PYRAMID ATTRIBUTE SCALE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE PYRAMID << 8)) + 0x1}
The pyramid object attributes.
Functions
• vx pyramid vxCreatePyramid (vx context c, vx size levels, vx float32 scale, vx uint32 width, vx uint32 height,vx fourcc format)
Creates a reference to a pyramid object of the supplied number of levels.
• vx image vxGetPyramidLevel (vx pyramid pyr, vx uint32 index)
Retrieves a level of the pyramid as a vx image, which can be used elsewhere in OpenVX.
• vx status vxQueryPyramid (vx pyramid pyr, vx enum attribute, void ∗ptr, vx size size)
Queries an attribute from an image pyramid.
• void vxReleasePyramid (vx pyramid ∗pyr)
Releases a reference to a pyramid object. The object may not be garbage collected until its total reference count iszero.
3.11.1 Detailed Description
The Image Pyramid Object Interface. A Pyramid object in OpenVX represents a collection of related images.Typically, these images are created by either downscaling or upscaling a base image, contained in level zero of thepyramid. Successive levels of the pyramid increase or decrease in size by a factor given by the VX PYRAMID A-TTRIBUTE SCALE attribute. For instance, in a pyramid with 3 levels and VX SCALE PYRAMID HALF, the levelone image will be one-half the width and one-half the height of the level zero image and the level two image will beone-quarter the width and one quarter the height of the level zero image. When downscaling or upscaling results ina non-integral number of pixels at any level, fractional pixels are always rounded up to the nearest integer. (e.g., a 3level image pyramid beginning with level zero having a width of 9 and a scaling of VX SCALE PYRAMID HALF willresult in the level one image with a width of 5 = ceil(9∗0.5) and a level two image with a width of 3 = ceil(5∗0.5).Position (rN ,cN) at level N corresponds to position (rN−1/scale,cN−1/scale) at level N-1.
CHAPTER 3. MODULE DOCUMENTATION 88
3.11.2 Enumeration Type Documentation
enum vx pyramid attribute e
The pyramid object attributes.
Enumerator
VX PYRAMID ATTRIBUTE LEVELS The number of levels of the pyramid. Use a vx size parameter.
VX PYRAMID ATTRIBUTE SCALE The scale factor between each level of the pyramid. Use a vx float32parameter.
Definition at line 977 of file vx types.h.
3.11.3 Function Documentation
vx pyramid vxCreatePyramid ( vx context c, vx size levels, vx float32 scale, vx uint32 width, vx uint32height, vx fourcc format )
Creates a reference to a pyramid object of the supplied number of levels.Parameters
in c The overall context.in levels The number of levels desired.in scale Used to indicate the scale between pyramid levels.in width The width of the 0th level image in pixels.in height The height of the 0th level image in pixels.in format The format of all images in the pyramid.
Returns
vx pyramid
Return values
0 No pyramid was created.∗ A pyramid reference.
Referenced by example super resolution().
vx image vxGetPyramidLevel ( vx pyramid pyr, vx uint32 index )
Retrieves a level of the pyramid as a vx image, which can be used elsewhere in OpenVX.Parameters
in pyr The pyramid object.in index The index of the level, such that index is less than levels.
Returns
vx image
Return values
0 Indicates that the index or the object was invalid.
vx status vxQueryPyramid ( vx pyramid pyr, vx enum attribute, void ∗ ptr, vx size size )
Queries an attribute from an image pyramid.
CHAPTER 3. MODULE DOCUMENTATION 89
Parameters
in pyr The pyramid to query.in attribute The attribute to query for. Use a vx pyramid attribute e enumeration.out ptr The pointer to the location to store the value.in size The size of the location pointed to by ptr.
Returns
A vx status e enumeration.
void vxReleasePyramid ( vx pyramid ∗ pyr )
Releases a reference to a pyramid object. The object may not be garbage collected until its total reference count iszero.Parameters
in pyr The pointer to the pyramid to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreatePyramid
Referenced by example super resolution().
CHAPTER 3. MODULE DOCUMENTATION 90
3.12 Object: Scalar
The Scalar Object interface.
Typedefs
• typedef vx reference vx scalar
An opaque reference to a scalar.
Enumerations
• enum vx scalar attribute e { VX SCALAR ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYP-E SCALAR << 8)) + 0x0 }
The scalar attributes list.
Functions
• vx status vxQueryScalar (vx scalar scalar, vx enum attribute, void ∗ptr, vx size size)
Queries attributes from a scalar.
3.12.1 Detailed Description
The Scalar Object interface.
3.12.2 Typedef Documentation
typedef vx reference vx scalar
An opaque reference to a scalar.A scalar can be up to 64 bits wide.
See Also
vxCreateScalar
Examples:
xyz module.c.
Definition at line 146 of file vx types.h.
3.12.3 Enumeration Type Documentation
enum vx scalar attribute e
The scalar attributes list.
Enumerator
VX SCALAR ATTRIBUTE TYPE Used to query the type of atomic is contained in the scalar. Use a vx enumparameter.
Definition at line 810 of file vx types.h.
3.12.4 Function Documentation
vx status vxQueryScalar ( vx scalar scalar, vx enum attribute, void ∗ ptr, vx size size )
Queries attributes from a scalar.
CHAPTER 3. MODULE DOCUMENTATION 91
Parameters
in scalar The scalar object.in attribute The enumeration to query. Use a vx rectangle attribute e enumer-
ation.in ptr The address of the variable to hold the attribute.in size The byte size that ptr points to.
Returns
A vx status e enumeration.
Examples:
vx tiling ext.c, and xyz module.c.
Referenced by XYZInputValidator().
CHAPTER 3. MODULE DOCUMENTATION 92
3.13 Object: Delay
The Delay Object interface.
Typedefs
• typedef vx reference vx delay
The delay object. This is like a ring buffer of objects which is maintained by the OpenVX implementation.
Enumerations
• enum vx delay attribute e {VX DELAY ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DELAY << 8)) + 0x0,VX DELAY ATTRIBUTE COUNT = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DELAY << 8)) + 0x1 }
The delay attribute list.
Functions
• vx status vxAgeDelay (vx delay delay)
Ages the internal delay ring by one. This means that once this API is called the reference from index 0 will go to index-1 and so forth until −count + 1 is reached. This last object will become 0. Once the delay has been aged, it willupdate the reference in any associated nodes.
• vx status vxAssociateDelayWithNode (vx delay delay, vx int32 delay index, vx node node, vx uint32 param-index, vx enum param direction)
Associates a delay index with a particular node’s parameter.
• vx delay vxCreateBufferDelay (vx context context, vx size unitSize, vx size numUnits, vx size count)• vx delay vxCreateImageDelay (vx context context, vx uint32 width, vx uint32 height, vx fourcc format, vx size
count)
Creates a reference to a delay object of vx image types.
• vx status vxDissociateDelayFromNode (vx delay delay, vx int32 delay index, vx node node, vx uint32 param-index)
Dissociates a delay index from a particular node parameter.
• vx image vxGetBufferFromDelay (vx delay delay, vx int32 index)
Retrieves a buffer from an buffer delay object.
• vx image vxGetImageFromDelay (vx delay delay, vx int32 index)
Retrieves an image from an image delay object.
• vx status vxQueryDelay (vx delay delay, vx enum attribute, void ∗ptr, vx size size)
Queries a vx delay object attribute.
• void vxReleaseDelay (vx delay ∗delay)
Releases a reference to a delay object. The object may not be garbage collected until its total reference count iszero..
3.13.1 Detailed Description
The Delay Object interface.
3.13.2 Typedef Documentation
typedef vx reference vx delay
The delay object. This is like a ring buffer of objects which is maintained by the OpenVX implementation.
See Also
vxCreateImageDelayvxCreateBufferDelay
Definition at line 207 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 93
3.13.3 Enumeration Type Documentation
enum vx delay attribute e
The delay attribute list.
Enumerator
VX DELAY ATTRIBUTE TYPE The type of reference contained in the delay. Use a vx enum parameter.
VX DELAY ATTRIBUTE COUNT The number of items in the delay. Use a vx uint32 parameter.
Definition at line 1189 of file vx types.h.
3.13.4 Function Documentation
vx status vxAgeDelay ( vx delay delay )
Ages the internal delay ring by one. This means that once this API is called the reference from index 0 will go toindex -1 and so forth until −count +1 is reached. This last object will become 0. Once the delay has been aged, itwill update the reference in any associated nodes.Parameters
in delay
Returns
A vx status e enumeration.
Return values
VX SUCCESS Delay was aged.VX ERROR INVALID REF-
ERENCEThe value passed as delay was not a vx delay.
Precondition
vxCreateImageDelayvxCreateBufferDelayvxAssociateDelayWithNode
vx status vxAssociateDelayWithNode ( vx delay delay, vx int32 delay index, vx node node, vx uint32param index, vx enum param direction )
Associates a delay index with a particular node’s parameter.Parameters
in delay The reference to the delay object.in delay index The index of the object in the delay object. This is in the range of [−count +
1,0].in node The reference to the node.in param index The index of the parameter on the node. This is in the range of
[0,numParams−1].in param direction The directionality of the parameter. See vx direction e.
Returns
A vx status e enumeration.
Precondition
vxCreateImageDelay or vxCreateBufferDelay
CHAPTER 3. MODULE DOCUMENTATION 94
Postcondition
vxAgeDelay
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx.h>
void example delaygraph(vx context context){
vx status status = VX SUCCESS;vx delay delay = vxCreateImageDelay(context, 320, 240,FOURCC UYVY, 4);
vx image rgb = vxCreateImage(context, 320, 240,FOURCC RGB);
vx graph graph = vxCreateGraph(context);vx node convert = vxColorConvertNode(graph,vxGetImageFromDelay(delay, 0),rgb);
vxAssociateDelayWithNode(delay, 0, convert, 0,VX INPUT);
status = vxVerifyGraph(graph);if (status == VX SUCCESS){
do {/* capture or read image into vxGetImageFromDelay(delay, 0); */status = vxProcessGraph(graph);/* 0 becomes -1, -1 becomes -2, etc. convert is updated with new 0 */vxAgeDelay(delay);
} while (1);}
}
vx delay vxCreateBufferDelay ( vx context context, vx size unitSize, vx size numUnits, vx size count )
Creates a reference to a delay object of vx buffer types.Parameters
in context The reference to the system context.in unitSize The number of bytes per unit.in numUnits The number of units in the buffer.in count The number of buffers in the delay ring.
Returns
vx delay
Postcondition
vxReleaseDelay
vx delay vxCreateImageDelay ( vx context context, vx uint32 width, vx uint32 height, vx fourcc format,vx size count )
Creates a reference to a delay object of vx image types.
CHAPTER 3. MODULE DOCUMENTATION 95
Parameters
in context The reference to the system context.in width The width in pixels.in height The height in pixels.in format The FOURCC code of the image.in count The number of images in the delay ring.
Returns
vx delay
Postcondition
vxReleaseDelay
vx status vxDissociateDelayFromNode ( vx delay delay, vx int32 delay index, vx node node, vx uint32param index )
Dissociates a delay index from a particular node parameter.Parameters
in delay The reference to the delay object.in delay index The relative index of the object in the delay.in node The reference to the node.in param index The index to the parameter on the node.
Returns
A vx status e enumeration.
Precondition
vxAssociateDelayWithNode
vx image vxGetBufferFromDelay ( vx delay delay, vx int32 index )
Retrieves a buffer from an buffer delay object.Parameters
in delay The reference to the delay object.in index An index into the delay from which to extract the reference to the image.
Returns
vx buffer
Note
The delay index is in the range [−count +1,0]. 0 is always the ”current” object.
Precondition
vxCreateBufferDelay
Note
A reference from a delay object should not be given to its associated release API. Use the vxRelease-Delay only.
vx image vxGetImageFromDelay ( vx delay delay, vx int32 index )
Retrieves an image from an image delay object.
CHAPTER 3. MODULE DOCUMENTATION 96
Parameters
in delay The reference to the delay object.in index An index into the delay from which to extract the reference to the image.
Returns
vx image
Note
The delay index is in the range [−count +1,0]. 0 is always the ”current” object.
Precondition
vxCreateImageDelay
Note
A reference from a delay object should not be given to its associated release API. Use the vxRelease-Delay only.
vx status vxQueryDelay ( vx delay delay, vx enum attribute, void ∗ ptr, vx size size )
Queries a vx delay object attribute.Parameters
in delay The coordinates object to set.in attribute The attribute to query. Use a vx delay attribute e enumeration.out ptr The pointer to the location to set the queried value to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
void vxReleaseDelay ( vx delay ∗ delay )
Releases a reference to a delay object. The object may not be garbage collected until its total reference count iszero..Parameters
in delay The pointer to the delay to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateImageDelay vxCreateBufferDelay
CHAPTER 3. MODULE DOCUMENTATION 97
3.14 Object: Target
The Target Object interface.
Data Structures
• struct vx target kernel t
The target to kernel correlation table entry definition. More...
Macros
• #define VX MAX IMPLEMENTATION NAME (64)
Defines the maximum number of characters in a implementation string.• #define VX MAX TARGET NAME (64)
Defines the maximum number of characters in a target string.
Typedefs
• typedef vx reference vx target
An abstract handle to a target.
Enumerations
• enum vx target attribute e {VX TARGET ATTRIBUTE INDEX = ((( VX ID KHRONOS ) << 20) | ( VX TYPE TARGET << 8)) + 0x0,VX TARGET ATTRIBUTE NAME = ((( VX ID KHRONOS ) << 20) | ( VX TYPE TARGET << 8)) + 0x1,VX TARGET ATTRIBUTE NUMKERNELS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE TARGET << 8))+ 0x2,VX TARGET ATTRIBUTE KERNELTABLE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE TARGET << 8))+ 0x3 }
The target attributes list.
Functions
• vx status vxAssignNode (vx node node, vx target target)
Used to assign target affinity to a node.• vx target vxGetTargetByIndex (vx context context, vx uint32 index)
Used to retrieve a target reference by the index of the target.• vx target vxGetTargetByName (vx context context, const vx char ∗name)
Used to get a reference to named target when the name is known beforehand.• vx status vxQueryTarget (vx target target, vx enum attribute, void ∗ptr, size t len)
Used to query the target about it’s properties.• void vxReleaseTarget (vx target ∗target)
Releases a reference to a target object. The object may not be garbage collected until its total reference count iszero.
3.14.1 Detailed Description
The Target Object interface. In OpenVX a Target is any configuration of devices or hardware which can execute atleast one vx kernel.
3.14.2 Data Structure Documentation
struct vx target kernel t
The target to kernel correlation table entry definition.Definition at line 1400 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 98
Data Fields
vx enum enumeration The kernel enumeration value from vx kernel e (or an extensionthereof)
vx char name[VX MAX -KERNEL NAME]
The kernel name in dotted hierarchical format. e.g. ”org.khronos.-openvx.invalid”.
3.14.3 Enumeration Type Documentation
enum vx target attribute e
The target attributes list.
Enumerator
VX TARGET ATTRIBUTE INDEX Returns the index of the given target. Use a vx uint32 parameter.
VX TARGET ATTRIBUTE NAME Returns the name of the given target in the format ”vendor.vendor string”.Use a vx char[VX MAX KERNEL NAME] array.
VX TARGET ATTRIBUTE NUMKERNELS Returns the number of kernels that the target is capable of pro-cessing. This is then used to allocate a table which is then filled. Use a vx uint32 parameter.
VX TARGET ATTRIBUTE KERNELTABLE Returns the table of all the kernels that a given target can exe-cute. Use a vx target kernel t array.
Precondition
You must call vxQueryTarget with VX TARGET ATTRIBUTE NUMKERNELS to compute thenecessary size of the array.
Definition at line 844 of file vx types.h.
3.14.4 Function Documentation
vx status vxAssignNode ( vx node node, vx target target )
Used to assign target affinity to a node.Parameters
in node The node reference to assign affinity to.in target The reference to the target.
Precondition
vxGetTargetByName or vxGetTargetByIndex
Returns
A vx status e enumeration.
vx target vxGetTargetByIndex ( vx context context, vx uint32 index )
Used to retrieve a target reference by the index of the target.Parameters
in context The reference to the overall context.in index The index of the target to get a reference to.
Returns
vx target
CHAPTER 3. MODULE DOCUMENTATION 99
Return values
0 Invalid index.∗ A target reference.
Note
Use vxQueryContext with VX CONTEXT ATTRIBUTE NUMTARGETS to retrieve the upper limit of tar-gets.
Examples:
vx helper.c.
vx target vxGetTargetByName ( vx context context, const vx char ∗ name )
Used to get a reference to named target when the name is known beforehand.Parameters
in context The reference to the overall context.in name The target name which is of the format ”<vendor>.<vendor string>”
Returns
vx target
Return values
0 Invalid index.∗ A target reference.
vx status vxQueryTarget ( vx target target, vx enum attribute, void ∗ ptr, size t len )
Used to query the target about it’s properties.Parameters
in target The reference to the target.in attribute The vx target attribute e value to query for.out ptr The pointer to the location to store the value.in len The length of the area pointed to by ptr.
Returns
A vx status e enumeration.
Precondition
vxGetTargetByName or vxGetTargetByIndex
Examples:
vx helper.c.
void vxReleaseTarget ( vx target ∗ target )
Releases a reference to a target object. The object may not be garbage collected until its total reference count iszero.
CHAPTER 3. MODULE DOCUMENTATION 100
Parameters
in target The pointer to the target to release.
Returns
A vx status e enumeration.
Note
After returning from this function the reference will be zeroed.
Examples:
vx helper.c.
CHAPTER 3. MODULE DOCUMENTATION 101
3.15 Framework: Log
The debug logging interface.
Macros
• #define VX MAX LOG MESSAGE LEN (1024)
The maximum length of a message buffer to copy from the log.
Functions
• void vxAddLogEntry (vx reference ref, vx status status, const char ∗message,...)
Adds a line to the log.
• vx status vxGetLogEntry (vx reference ref, char message[VX MAX LOG MESSAGE LEN])
Returns the previous entry of the log. When called consecutively it will return the entire log. The log will be clearedby reading it.
3.15.1 Detailed Description
The debug logging interface.
3.15.2 Function Documentation
void vxAddLogEntry ( vx reference ref, vx status status, const char ∗ message, ... )
Adds a line to the log.Parameters
in ref The reference to add the log entry against. Some valid value must be provided.in status The status code. VX SUCCESS status entries will be ignored and not added.in message The human readable message to add to the log.in ... a list of variable arguments to the message.
Note
Messages may not exceed VX MAX LOG MESSAGE LEN bytes and will be truncated in the log if they exceedthis limit.
Examples:
vx helper.c.
Referenced by vxCreateNodeByStructure(), and vxSetAffineRotationMatrix().
vx status vxGetLogEntry ( vx reference ref, char message[VX MAX LOG MESSAGE LEN] )
Returns the previous entry of the log. When called consecutively it will return the entire log. The log will be clearedby reading it.Parameters
in ref The reference to filter the log entries against. If the context is given, the nextentry will be returned.
out message A predefined location to store a copy of the log’s message value. This mustpoint to at least VX MAX LOG MESSAGE LEN bytes of characters.
Returns
Returns the status of the log entry from vx status e.
CHAPTER 3. MODULE DOCUMENTATION 102
Note
The API returns errors oldest to newest order. When VX SUCCESS is returned, the log reading is complete.
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx.h>
void vxClearLog(vx graph graph){
char message[VX MAX LOG MESSAGE LEN];vx status status = VX SUCCESS;do {
status = vxGetLogEntry(graph, message);} while (status != VX SUCCESS);
}
Examples:
vx helper.c.
Referenced by vxClearLog().
CHAPTER 3. MODULE DOCUMENTATION 103
3.16 Object: Rectangle
The Rectangle Object interface.
Typedefs
• typedef vx reference vx rectangle
The rectangle object. This is an opaque set of 2 image coordinates.
Enumerations
• enum vx rectangle attribute e {VX RECTANGLE ATTRIBUTE START X = ((( VX ID KHRONOS ) << 20) | ( VX TYPE RECTANGLE <<8)) + 0x0,VX RECTANGLE ATTRIBUTE START Y = ((( VX ID KHRONOS ) << 20) | ( VX TYPE RECTANGLE <<8)) + 0x1,VX RECTANGLE ATTRIBUTE END X = ((( VX ID KHRONOS ) << 20) | ( VX TYPE RECTANGLE << 8))+ 0x2,VX RECTANGLE ATTRIBUTE END Y = ((( VX ID KHRONOS ) << 20) | ( VX TYPE RECTANGLE << 8))+ 0x3 }
The rectangle attribute list.
Functions
• vx status vxAccessRectangleCoordinates (vx rectangle rectangle, vx uint32 ∗psx, vx uint32 ∗psy, vx uint32∗pex, vx uint32 ∗pey)
Retrieves the start and end, x and y coordinates from the rectangle.
• vx status vxCommitRectangleCoordinates (vx rectangle rectangle, vx uint32 sx, vx uint32 sy, vx uint32 ex,vx uint32 ey)
Retrieves the start and end, x and y coordinates from the rectangle.
• vx rectangle vxCreateRectangle (vx context context, vx uint32 sx, vx uint32 sy, vx uint32 ex, vx uint32 ey)
Creates a reference to a rectangle object.
• vx status vxQueryRectangle (vx rectangle rect, vx enum attribute, void ∗ptr, vx size size)
Queries attributes from a rectangle.
• void vxReleaseRectangle (vx rectangle ∗rect)
Release a reference to a rectangle object. The object may not be garbage collected until its total reference count iszero.
• vx status vxSetRectangleAttribute (vx rectangle rect, vx enum attribute, void ∗ptr, vx size size)
Set an attributes on a rectangle.
3.16.1 Detailed Description
The Rectangle Object interface.
3.16.2 Enumeration Type Documentation
enum vx rectangle attribute e
The rectangle attribute list.
Enumerator
VX RECTANGLE ATTRIBUTE START X Indicates start x value (inclusive). Use a vx uint32 parameter.
VX RECTANGLE ATTRIBUTE START Y Indicates start y value (inclusive). Use a vx uint32 parameter.
VX RECTANGLE ATTRIBUTE END X Indicates end x value (exclusive). Use a vx uint32 parameter.
VX RECTANGLE ATTRIBUTE END Y Indicates end y value (exclusive). Use a vx uint32 parameter.
Definition at line 867 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 104
3.16.3 Function Documentation
vx status vxAccessRectangleCoordinates ( vx rectangle rectangle, vx uint32 ∗ psx, vx uint32 ∗ psy,vx uint32 ∗ pex, vx uint32 ∗ pey )
Retrieves the start and end, x and y coordinates from the rectangle.
CHAPTER 3. MODULE DOCUMENTATION 105
Parameters
in rectangle The rectangle to query.out psx The pointer to the start x coordinate.out psy The pointer to the start y coordinate.out pex The pointer to the end x coordinate.out pey The pointer to the end y coordinate.
Returns
A vx status e enumeration.
Examples:
vx helper.c.
Referenced by vxAlterRectangle().
vx status vxCommitRectangleCoordinates ( vx rectangle rectangle, vx uint32 sx, vx uint32 sy, vx uint32ex, vx uint32 ey )
Retrieves the start and end, x and y coordinates from the rectangle.Parameters
in rectangle The rectangle to query.out sx The start x coordinate. Must be sx <= ex.out sy The start y coordinate. Must be sy <= ey.out ex The end x coordinate. Must be sx <= ex.out ey The end y coordinate. Must be sy <= ey.
Returns
A vx status e enumeration.
Examples:
vx helper.c.
Referenced by vxAlterRectangle().
vx rectangle vxCreateRectangle ( vx context context, vx uint32 sx, vx uint32 sy, vx uint32 ex, vx uint32ey )
Creates a reference to a rectangle object.Parameters
in context The context reference.in sx The start x coordinate.in sy The start y coordinate.in ex The end x coordinate.in ey The end y coordinate.
Returns
vx rectangle
Examples:
vx tiling main.c.
vx status vxQueryRectangle ( vx rectangle rect, vx enum attribute, void ∗ ptr, vx size size )
Queries attributes from a rectangle.
CHAPTER 3. MODULE DOCUMENTATION 106
Parameters
in rect The rectangle object.in attribute The enumeration to query. Use a vx rectangle attribute e enumer-
ation.in ptr The address of the variable to hold the attribute.in size The byte size that ptr points to.
Returns
A vx status e enumeration.
void vxReleaseRectangle ( vx rectangle ∗ rect )
Release a reference to a rectangle object. The object may not be garbage collected until its total reference count iszero.Parameters
in rect The pointer to the rectangle to release.
Note
After returning from this function the reference will be zeroed.
Examples:
vx tiling main.c, and xyz module.c.
Referenced by XYZKernel().
vx status vxSetRectangleAttribute ( vx rectangle rect, vx enum attribute, void ∗ ptr, vx size size )
Set an attributes on a rectangle.Parameters
in rect The rectangle object.in attribute The enumeration to set. Use a vx rectangle attribute e enumera-
tion.in ptr The address of the variable to read the attribute.in size The byte size that ptr points to.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 107
3.17 Object: Coordinates
The Image Pixel Coordinates Object interface.
Typedefs
• typedef vx reference vx coordinates
The Coordinates Object. A set of pixel space coordinates.
Enumerations
• enum vx coordinates attribute e {VX COORDINATES ATTRIBUTE DIMENSIONS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE COORDIN-ATES << 8)) + 0x0,VX COORDINATES ATTRIBUTE SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE COORDINATES <<8)) + 0x1 }
The coordinates attributes.
Functions
• vx status vxAccessCoordinates (vx coordinates coord, vx int32 ∗array)
Gets the coordinate data (copy)
• vx status vxCommitCoordinates (vx coordinates coord, vx int32 ∗array)
Sets the coordinate data (copy)
• vx coordinates vxCreateCoordinates (vx context c, vx size dims)
Creates a reference to a coordinates object with unintialized values of the specified dimensions.
• vx status vxQueryCoordinates (vx coordinates coord, vx enum attribute, void ∗ptr, vx size size)
Queries an attribute on the coordinates object.
• void vxReleaseCoordinates (vx coordinates ∗coord)
Releases a reference to a coordinates object. The object may not be garbage collected until its total reference countis zero..
• vx status vxSetCoordinatesAttributes (vx coordinates coord, vx enum attr, void ∗ptr, vx size size)
Sets attributes on the coordinates object.
3.17.1 Detailed Description
The Image Pixel Coordinates Object interface.
3.17.2 Enumeration Type Documentation
enum vx coordinates attribute e
The coordinates attributes.
Enumerator
VX COORDINATES ATTRIBUTE DIMENSIONS The dimension of the coordinate matrix. Coordinate are D-IMSx1. Use a vx size parameter.
VX COORDINATES ATTRIBUTE SIZE The total size of the coordinate matrix. Use a vx size parameter.
Definition at line 949 of file vx types.h.
3.17.3 Function Documentation
vx status vxAccessCoordinates ( vx coordinates coord, vx int32 ∗ array )
Gets the coordinate data (copy)
CHAPTER 3. MODULE DOCUMENTATION 108
Parameters
in coord The reference to the coordinates.out array The array to place the coordinates.
See Also
vxQueryCoordinates and VX COORDINATES ATTRIBUTE DIMENSIONS to get the needed number of el-ements of the array.
Returns
A vx status e enumeration.
vx status vxCommitCoordinates ( vx coordinates coord, vx int32 ∗ array )
Sets the coordinate data (copy)Parameters
in coord The reference to the coordinates.out array The array to read the coordinates.
See Also
vxQueryCoordinates and VX COORDINATES ATTRIBUTE DIMENSIONS to get the needed number of el-ements of the array.
Returns
A vx status e enumeration.
vx coordinates vxCreateCoordinates ( vx context c, vx size dims )
Creates a reference to a coordinates object with unintialized values of the specified dimensions.Parameters
in c The reference to the overall context.in dims The number of dimensions of the coordinate.
Returns
vx coordinates
vx status vxQueryCoordinates ( vx coordinates coord, vx enum attribute, void ∗ ptr, vx size size )
Queries an attribute on the coordinates object.Parameters
in coord The coordinates object to set.in attribute The attribute to query. Use a vx coordinates attribute e enumera-
tion.out ptr The pointer to the location to set the queried value to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
void vxReleaseCoordinates ( vx coordinates ∗ coord )
Releases a reference to a coordinates object. The object may not be garbage collected until its total reference countis zero..
CHAPTER 3. MODULE DOCUMENTATION 109
Parameters
in coord The pointer to the coordinates to release.
Note
After returning from this function the reference will be zeroed.
vx status vxSetCoordinatesAttributes ( vx coordinates coord, vx enum attr, void ∗ ptr, vx size size )
Sets attributes on the coordinates object.Parameters
in coord The coordinates object to set.in attr The attribute to modify. Use a vx coordinates attribute e enumer-
ation.in ptr The pointer to the value to set the attribute to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 110
3.18 Object: Convolution
The Image Convolution Object interface.
Typedefs
• typedef vx reference vx convolution
The Convolution Object. A user defined convolution kernel of MxM elements.
Enumerations
• enum vx convolution attribute e {VX CONVOLUTION ATTRIBUTE ROWS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONVOLUTION<< 8)) + 0x0,VX CONVOLUTION ATTRIBUTE COLUMNS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONVOLUTI-ON << 8)) + 0x1,VX CONVOLUTION ATTRIBUTE SCALE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONVOLUTION<< 8)) + 0x2,VX CONVOLUTION ATTRIBUTE SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE CONVOLUTION <<8)) + 0x3 }
The convolution attributes.
Functions
• vx status vxAccessConvolutionCoefficients (vx convolution conv, vx int16 ∗array)
Gets the convolution data (copy)
• vx status vxCommitConvolutionCoefficients (vx convolution conv, vx int16 ∗array)
Sets the convolution data (copy)
• vx convolution vxCreateConvolution (vx context context, vx size columns, vx size rows)
Creates a reference to a convolution matrix object.
• vx status vxQueryConvolution (vx convolution conv, vx enum attribute, void ∗ptr, vx size size)
Queries an attribute on the convolution matrix object.
• void vxReleaseConvolution (vx convolution ∗conv)
Releases the reference to a convolution matrix. The object may not be garbage collected until its total reference countis zero..
• vx status vxSetConvolutionAttribute (vx convolution conv, vx enum attr, void ∗ptr, vx size size)
Sets attributes on the convolution object.
3.18.1 Detailed Description
The Image Convolution Object interface.
3.18.2 Enumeration Type Documentation
enum vx convolution attribute e
The convolution attributes.
Enumerator
VX CONVOLUTION ATTRIBUTE ROWS The number of rows of the convolution matrix. Use a vx sizeparameter.
VX CONVOLUTION ATTRIBUTE COLUMNS The number of columns of the convolution matrix. Use a vx-size parameter.
VX CONVOLUTION ATTRIBUTE SCALE The scale of the convolution matrix. Use a vx uint32 parame-ter.
CHAPTER 3. MODULE DOCUMENTATION 111
Note
For 1.0, only powers of 2 are supported up to 2∧31.
VX CONVOLUTION ATTRIBUTE SIZE The total size of the convolution matrix in bytes. Use a vx sizeparameter.
Definition at line 959 of file vx types.h.
3.18.3 Function Documentation
vx status vxAccessConvolutionCoefficients ( vx convolution conv, vx int16 ∗ array )
Gets the convolution data (copy)Parameters
in conv The reference to the convolution.out array The array to place the convolution.
See Also
vxQueryConvolution and VX CONVOLUTION ATTRIBUTE SIZE to get the needed number of bytes of thearray.
Returns
A vx status e enumeration.
vx status vxCommitConvolutionCoefficients ( vx convolution conv, vx int16 ∗ array )
Sets the convolution data (copy)Parameters
in conv The reference to the convolution.out array The array to read the convolution.
See Also
vxQueryConvolution and VX CONVOLUTION ATTRIBUTE SIZE to get the needed number of bytes of thearray.
Returns
A vx status e enumeration.
vx convolution vxCreateConvolution ( vx context context, vx size columns, vx size rows )
Creates a reference to a convolution matrix object.Parameters
in context The reference to the overall context.in columns The columns dimension of the convolution. Must be odd and greater than or
equal to 3 and less than the value returned from VX CONTEXT ATTRIBUTE-CONVOLUTION MAXIMUM DIMENSION.
CHAPTER 3. MODULE DOCUMENTATION 112
in rows The rows dimension of the convolution. Must be odd and greater than or equalto 3 and less than the value returned from VX CONTEXT ATTRIBUTE CON-VOLUTION MAXIMUM DIMENSION.
Returns
vx convolution
vx status vxQueryConvolution ( vx convolution conv, vx enum attribute, void ∗ ptr, vx size size )
Queries an attribute on the convolution matrix object.Parameters
in conv The convolution matrix object to set.in attribute The attribute to query. Use a vx convolution attribute e enumera-
tion.out ptr The pointer to the location to set the queried value to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
void vxReleaseConvolution ( vx convolution ∗ conv )
Releases the reference to a convolution matrix. The object may not be garbage collected until its total referencecount is zero..Parameters
in conv The pointer to the convolution matrix to release.
Note
After returning from this function the reference will be zeroed.
vx status vxSetConvolutionAttribute ( vx convolution conv, vx enum attr, void ∗ ptr, vx size size )
Sets attributes on the convolution object.Parameters
in conv The coordinates object to set.in attr The attribute to modify. Use a vx convolution attribute e enumer-
ation.in ptr The pointer to the value to set the attribute to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 113
3.19 Object: Distribution
The Distribution Object Interface.
Typedefs
• typedef vx reference vx distribution
The Distribution object. This has a user defined number of bins over a user defined range (within a uint32 t range)
Enumerations
• enum vx distribution attribute e {VX DISTRIBUTION ATTRIBUTE DIMENSIONS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DISTRIBUT-ION << 8)) + 0x0,VX DISTRIBUTION ATTRIBUTE OFFSET = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DISTRIBUTION<< 8)) + 0x1,VX DISTRIBUTION ATTRIBUTE RANGE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DISTRIBUTION<< 8)) + 0x2,VX DISTRIBUTION ATTRIBUTE BINS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DISTRIBUTION <<8)) + 0x3,VX DISTRIBUTION ATTRIBUTE WINDOW = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DISTRIBUTION<< 8)) + 0x4,VX DISTRIBUTION ATTRIBUTE SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE DISTRIBUTION <<8)) + 0x5 }
The distribution attribute list.
Functions
• vx status vxAccessDistribution (vx distribution distribution, void ∗∗ptr)
Gets direct access to a Distribution in memory.
• vx status vxCommitDistribution (vx distribution distribution, void ∗ptr)
Sets the Distribution back to the memory. The memory is the array must be a vx uint32 array of a value at least asbig as the value returned via VX DISTRIBUTION ATTRIBUTE RANGE.
• vx distribution vxCreateDistribution (vx context context, vx size numBins, vx size offset, vx size range)
Creates a reference to a 1D Distribution with a start offset, valid range, and number of equally weighted bins.
• vx status vxQueryDistribution (vx distribution distribution, vx enum attribute, void ∗ptr, vx size size)
Queries a Distribution object.
• void vxReleaseDistribution (vx distribution ∗distribution)
Releases a reference to a distribution object. The object may not be garbage collected until its total reference countis zero..
3.19.1 Detailed Description
The Distribution Object Interface.
3.19.2 Enumeration Type Documentation
enum vx distribution attribute e
The distribution attribute list.
Enumerator
VX DISTRIBUTION ATTRIBUTE DIMENSIONS Indicates the number of dimensions in the distribution. Usea vx size parameter.
VX DISTRIBUTION ATTRIBUTE OFFSET Indicates the start of the values to use (inclusive). Use a vx -uint32 parameter.
CHAPTER 3. MODULE DOCUMENTATION 114
VX DISTRIBUTION ATTRIBUTE RANGE Indicates end value to use as the range (exclusive). Use a vx -uint32 parameter.
VX DISTRIBUTION ATTRIBUTE BINS Indicates the number of bins. Use a vx uint32 parameter.
VX DISTRIBUTION ATTRIBUTE WINDOW Indicates the range of a bin. Use a vx uint32 parameter.
VX DISTRIBUTION ATTRIBUTE SIZE The total size of the distribution in bytes. Use a vx size parameter.
Definition at line 893 of file vx types.h.
3.19.3 Function Documentation
vx status vxAccessDistribution ( vx distribution distribution, void ∗∗ ptr )
Gets direct access to a Distribution in memory.Parameters
in distribution The reference to the distribution to access.in,out ptr The address of the location to store the pointer to the Distribution memory.
If the pointer is not NULL, the Distribution will be copied to that address. Ifthe pointer is NULL, the pointer will be mapped to the Distribution memory.In either case, vxCommitDistribution must be called after Distributionaccess is complete.
Returns
A vx status e enumeration.
Precondition
vxCreateDistribution
Postcondition
vxCommitDistribution
vx status vxCommitDistribution ( vx distribution distribution, void ∗ ptr )
Sets the Distribution back to the memory. The memory is the array must be a vx uint32 array of a value at least asbig as the value returned via VX DISTRIBUTION ATTRIBUTE RANGE.Parameters
in distribution The Distribution to modify.in ptr The pointer returned from (or not modified by) vxAccessLUT.
Returns
A vx status e enumeration.
Precondition
vxAccessDistribution.
vx distribution vxCreateDistribution ( vx context context, vx size numBins, vx size offset, vx size range)
Creates a reference to a 1D Distribution with a start offset, valid range, and number of equally weighted bins.
CHAPTER 3. MODULE DOCUMENTATION 115
Parameters
in context The reference to the overall context.in numBins The number of bins in the distribution.in offset The offset into the range value.in range The total range of the values.
Returns
vx distribution
vx status vxQueryDistribution ( vx distribution distribution, vx enum attribute, void ∗ ptr, vx size size )
Queries a Distribution object.Parameters
in distribution The reference to the distribution to query.in attribute The attribute to query. Use a vx distribution attribute e enumer-
ation.out ptr The pointer to store the attributein size The size of the area which pointer references.
Returns
A vx status e enumeration.
Precondition
vxCreateDistribution
void vxReleaseDistribution ( vx distribution ∗ distribution )
Releases a reference to a distribution object. The object may not be garbage collected until its total reference countis zero..Parameters
in distribution The reference to the distribution to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateDistribution
CHAPTER 3. MODULE DOCUMENTATION 116
3.20 Object: Matrix
The Matrix Object Interface.
Typedefs
• typedef vx reference vx matrix
The Matrix Object. An MxN matrix of some unit type.
Enumerations
• enum vx matrix attribute e {VX MATRIX ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE MATRIX << 8)) + 0x0,VX MATRIX ATTRIBUTE ROWS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE MATRIX << 8)) + 0x1,VX MATRIX ATTRIBUTE COLUMNS = ((( VX ID KHRONOS ) << 20) | ( VX TYPE MATRIX << 8)) + 0x2,VX MATRIX ATTRIBUTE SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE MATRIX << 8)) + 0x3 }
The matrix attributes.
Functions
• vx status vxAccessMatrix (vx matrix mat, void ∗array)
Gets the matrix data (copy)
• vx status vxCommitMatrix (vx matrix mat, void ∗array)
Sets the matrix data (copy)
• vx matrix vxCreateMatrix (vx context c, vx enum type, vx size columns, vx size rows)
Creates a reference to a matrix object.
• vx status vxQueryMatrix (vx matrix mat, vx enum attribute, void ∗ptr, vx size size)
Queries an attribute on the matrix object.
• void vxReleaseMatrix (vx matrix ∗mat)
Releases a reference to a matrix object. The object may not be garbage collected until its total reference count iszero.
3.20.1 Detailed Description
The Matrix Object Interface.
3.20.2 Enumeration Type Documentation
enum vx matrix attribute e
The matrix attributes.
Enumerator
VX MATRIX ATTRIBUTE TYPE The value type of the matrix. Use a vx enum parameter.
VX MATRIX ATTRIBUTE ROWS The M dimension of the matrix. Use a vx size parameter.
VX MATRIX ATTRIBUTE COLUMNS The N dimension of the matrix. Use a vx size parameter.
VX MATRIX ATTRIBUTE SIZE The total size of the matrix in bytes. Use a vx size parameter.
Definition at line 935 of file vx types.h.
3.20.3 Function Documentation
vx status vxAccessMatrix ( vx matrix mat, void ∗ array )
Gets the matrix data (copy)
CHAPTER 3. MODULE DOCUMENTATION 117
Parameters
in mat The reference to the matrix.out array The array to place the matrix.
See Also
vxQueryMatrix and VX MATRIX ATTRIBUTE COLUMNS and VX MATRIX ATTRIBUTE ROWS to get theneeded number of elements of the array.
Returns
A vx status e enumeration.
Examples:
vx helper.c.
Referenced by vxSetAffineRotationMatrix().
vx status vxCommitMatrix ( vx matrix mat, void ∗ array )
Sets the matrix data (copy)Parameters
in mat The reference to the matrix.out array The array to read the matrix.
See Also
vxQueryMatrix and VX MATRIX ATTRIBUTE COLUMNS and VX MATRIX ATTRIBUTE ROWS to get theneeded number of elements of the array.’
Returns
A vx status e enumeration.
Examples:
vx helper.c.
Referenced by vxSetAffineRotationMatrix().
vx matrix vxCreateMatrix ( vx context c, vx enum type, vx size columns, vx size rows )
Creates a reference to a matrix object.Parameters
in c The reference to the overall context.in type The unit format of the matrix. VX TYPE INT32 or VX TYPE FLOAT32.in columns The first dimensionality.in rows The second dimensionality.
Returns
vx matrix
Referenced by example super resolution().
vx status vxQueryMatrix ( vx matrix mat, vx enum attribute, void ∗ ptr, vx size size )
Queries an attribute on the matrix object.
CHAPTER 3. MODULE DOCUMENTATION 118
Parameters
in mat The matrix object to set.in attribute The attribute to query. Use a vx matrix attribute e enumeration.out ptr The pointer to the location to set the queried value to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
Examples:
vx helper.c.
Referenced by vxSetAffineRotationMatrix().
void vxReleaseMatrix ( vx matrix ∗ mat )
Releases a reference to a matrix object. The object may not be garbage collected until its total reference count iszero.Parameters
in mat The matrix reference to release.
Note
After returning from this function the reference will be zeroed.
Referenced by example super resolution().
CHAPTER 3. MODULE DOCUMENTATION 119
3.21 Object: Threshold
The Threshold Object Interface.
Typedefs
• typedef vx reference vx threshold
The Threshold Object. A thresholding object contains the types and limit values of the thresholding required.
Enumerations
• enum vx threshold attribute e {VX THRESHOLD ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE THRESHOLD << 8))+ 0x0,VX THRESHOLD ATTRIBUTE VALUE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE THRESHOLD << 8))+ 0x1,VX THRESHOLD ATTRIBUTE LOWER = ((( VX ID KHRONOS ) << 20) | ( VX TYPE THRESHOLD <<8)) + 0x2,VX THRESHOLD ATTRIBUTE UPPER = ((( VX ID KHRONOS ) << 20) | ( VX TYPE THRESHOLD << 8))+ 0x3 }
The threshold attributes.
• enum vx threshold type e {VX THRESHOLD TYPE BINARY = ((( VX ID KHRONOS ) << 20) | ( VX ENUM THRESHOLD TYPE <<12)) + 0x0,VX THRESHOLD TYPE RANGE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM THRESHOLD TYPE <<12)) + 0x1 }
The Threshold types.
Functions
• vx threshold vxCreateThreshold (vx context c, vx enum type)
Creates a reference to a threshold object of a given type.
• vx status vxQueryThreshold (vx threshold thresh, vx enum attribute, void ∗ptr, vx size size)
Queries an attribute on the threshold object.
• void vxReleaseThreshold (vx threshold ∗thresh)
Releases a reference to a threshold object. The object may not be garbage collected until its total reference count iszero.
• vx status vxSetThresholdAttribute (vx threshold thresh, vx enum attribute, void ∗ptr, vx size size)
Sets attributes on the threshold object.
3.21.1 Detailed Description
The Threshold Object Interface.
3.21.2 Enumeration Type Documentation
enum vx threshold attribute e
The threshold attributes.
Enumerator
VX THRESHOLD ATTRIBUTE TYPE The value type of the threshold. Use a vx enum parameter. Willcontain a vx threshold type e.
VX THRESHOLD ATTRIBUTE VALUE The value of the single threshold for functions that use that. Use avx uint8 parameter.
VX THRESHOLD ATTRIBUTE LOWER The value of the lower threshold for functions that use that. Use avx uint8 parameter.
CHAPTER 3. MODULE DOCUMENTATION 120
VX THRESHOLD ATTRIBUTE UPPER The value of the higher threshold for functions that use that. Use avx uint8 parameter.
Definition at line 921 of file vx types.h.
enum vx threshold type e
The Threshold types.
Enumerator
VX THRESHOLD TYPE BINARY A threshold with only 1 value.
VX THRESHOLD TYPE RANGE A threshold with 2 values (upper/lower). Used with canny edge detection.
Definition at line 911 of file vx types.h.
3.21.3 Function Documentation
vx threshold vxCreateThreshold ( vx context c, vx enum type )
Creates a reference to a threshold object of a given type.Parameters
in c The reference to the overall context.in type The type of threshold to create.
Returns
vx threshold
Examples:
vx factory pipeline.c.
Referenced by vxPipelineGraphFactory().
vx status vxQueryThreshold ( vx threshold thresh, vx enum attribute, void ∗ ptr, vx size size )
Queries an attribute on the threshold object.Parameters
in thresh The threshold object to set.in attribute The attribute to query. Use a vx threshold attribute e enumeration.out ptr The pointer to the location to set the queried value to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
void vxReleaseThreshold ( vx threshold ∗ thresh )
Releases a reference to a threshold object. The object may not be garbage collected until its total reference countis zero.Parameters
in thresh The pointer to the threshold to release.
Note
After returning from this function the reference will be zeroed.
Examples:
vx factory pipeline.c.
Referenced by vxPipelineGraphFactory().
CHAPTER 3. MODULE DOCUMENTATION 121
vx status vxSetThresholdAttribute ( vx threshold thresh, vx enum attribute, void ∗ ptr, vx size size )
Sets attributes on the threshold object.
CHAPTER 3. MODULE DOCUMENTATION 122
Parameters
in thresh The threshold object to set.in attribute The attribute to modify. Use a vx threshold attribute e enumeration.in ptr The pointer to the value to set the attribute to.in size The size of the data pointed to by ptr.
Returns
A vx status e enumeration.
Examples:
vx factory pipeline.c.
Referenced by vxPipelineGraphFactory().
CHAPTER 3. MODULE DOCUMENTATION 123
3.22 Object: Keypoint
The Keypoint Object Interface.
Data Structures
• struct vx keypoint t
The keypoint data structure which is shared with the users. More...
Typedefs
• typedef vx reference vx keypoint
The keypoint Object. An keypoint from a detector fed into a tracker or flow prediction.
Functions
• vx status vxAccessKeypoint (vx keypoint kp, vx keypoint t ∗∗ptr)
Gives the user access to the keypoint data.
• vx status vxCommitKeypoint (vx keypoint kp, vx keypoint t ∗ptr)
Commits a keypoint’s data back to the object.
• vx keypoint vxCreateKeypoint (vx context c)
Creates a reference to a keypoint object.
• void vxReleaseKeypoint (vx keypoint ∗kp)
Releases a reference to a keypoint object. The object may not be garbage collected until its total reference count iszero.
3.22.1 Detailed Description
The Keypoint Object Interface. Keypoints are frequently the output of corner detectors and the inputs of trackers.
3.22.2 Data Structure Documentation
struct vx keypoint t
The keypoint data structure which is shared with the users.Use vxAccessKeypoint to access this data.
Examples:
vx helper.c.
Definition at line 1445 of file vx types.h.Data Fields
vx float32 error An tracking method specific error.vx float32 orientation Unused field reserved for future use.vx float32 scale Unused field reserved for future use.vx float32 strength The strength of the keypoint.
vx int32 tracking status A zero indicates a lost point.vx int32 x The x coordinate.vx int32 y The y coordinate.
3.22.3 Function Documentation
vx status vxAccessKeypoint ( vx keypoint kp, vx keypoint t ∗∗ ptr )
Gives the user access to the keypoint data.
CHAPTER 3. MODULE DOCUMENTATION 124
Parameters
in kp The reference to the keypoint.out ptr The pointer to the location to store the pointer to a vx keypoint t structure. If
NULL is passed, the reference count is still incremented. If the value that ptrpoints to is NULL, the implementation will set ptr so that the user can accessthe data. If the value that ptr points to is not NULL the the implementation willcopy the data to the supplied location.
Note
This will cause the reference count to increment.
Postcondition
vxCommitKeypoint must be called after access.
Returns
Returns a vx status e enumeration.
Return values
VX SUCCESS User was given access to the keypoint.VX ERROR INVALID REF-
ERENCEThe kp parameter was not a vx keypoint.
Examples:
vx helper.c.
vx status vxCommitKeypoint ( vx keypoint kp, vx keypoint t ∗ ptr )
Commits a keypoint’s data back to the object.Parameters
in kp The reference to the keypoint object.in ptr The pointer to the vx keypoint t data. If NULL is supplied, the reference
count is still decremented.
Precondition
vxAccessKeypoint must have been called before calling this function.
Returns
Returns a vx status e enumeration.
Return values
VX SUCCESS User data was committed to the keypoint.VX ERROR INVALID REF-
ERENCEThe kp parameter was not a vx keypoint.
Examples:
vx helper.c.
vx keypoint vxCreateKeypoint ( vx context c )
Creates a reference to a keypoint object.
CHAPTER 3. MODULE DOCUMENTATION 125
Parameters
in c The reference to the overall context.
Postcondition
vxReleaseKeypoint
Returns
Returns a vx keypoint reference or zero.
void vxReleaseKeypoint ( vx keypoint ∗ kp )
Releases a reference to a keypoint object. The object may not be garbage collected until its total reference count iszero.Parameters
in kp The pointer to the keypoint to release.
Note
After returning from this function the reference will be zeroed.
CHAPTER 3. MODULE DOCUMENTATION 126
3.23 Object: LUT
The Look-Up Table Interface.
Typedefs
• typedef vx reference vx lut
The Look-Up Table (LUT) Object.
Enumerations
• enum vx lut attribute e {VX LUT ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE LUT << 8)) + 0x0,VX LUT ATTRIBUTE COUNT = ((( VX ID KHRONOS ) << 20) | ( VX TYPE LUT << 8)) + 0x1,VX LUT ATTRIBUTE SIZE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE LUT << 8)) + 0x2 }
The LUT attribute list.
Functions
• vx status vxAccessLUT (vx lut lut, void ∗∗ptr)
Gets direct access to the LUT table data.
• vx status vxCommitLUT (vx lut lut, void ∗ptr)
Commits the Lookup Table.
• vx lut vxCreateLUT (vx context context, vx enum type, vx size count)
Creates LUT object of a given type.
• vx status vxQueryLUT (vx lut lut, vx enum attribute, void ∗ptr, vx size size)
Queries attributes from a LUT.
• void vxReleaseLUT (vx lut ∗lut)
Release a reference to a LUT object. The object may not be garbage collected until its total reference count is zero..
3.23.1 Detailed Description
The Look-Up Table Interface. A lookup table is an array that simplifies runtime computation by replacing computationwith a simpler array indexing operation.
3.23.2 Enumeration Type Documentation
enum vx lut attribute e
The LUT attribute list.
Enumerator
VX LUT ATTRIBUTE TYPE Indicates the value type of the LUT. Use a vx enum.
VX LUT ATTRIBUTE COUNT Indicates the number of elements in the LUT. Use a vx size.
VX LUT ATTRIBUTE SIZE The total size of the LUT in bytes. Uses a vx size.
Definition at line 881 of file vx types.h.
3.23.3 Function Documentation
vx status vxAccessLUT ( vx lut lut, void ∗∗ ptr )
Gets direct access to the LUT table data.There are several variants of call methodology:
• If ptr is NULL (which means the current data of the LUT is not desired), the LUT reference count is incre-mented.
CHAPTER 3. MODULE DOCUMENTATION 127
• If ptr is not NULL but (∗ptr) is NULL, (∗ptr) will contain the address of the LUT data when the function returnsand the reference count will be incremented. Whether the (∗ptr) address is mapped or allocated is undefined.(∗ptr) must be returned to vxCommitLUT.
• If ptr is not NULL and (∗ptr) is not NULL, the user is signalling the implementation to copy the LUT datainto the location specified by (∗ptr). Users must use vxQueryLUT with VX LUT ATTRIBUTE SIZE todetermine how much memory to allocate for the LUT data.
In any case, vxCommitLUT must be called after LUT access is complete.Parameters
in lut The LUT to get the data from.in,out ptr The address of the location to store the pointer to the LUT memory.
Returns
A vx status e enumeration.
Postcondition
vxCommitLUT
vx status vxCommitLUT ( vx lut lut, void ∗ ptr )
Commits the Lookup Table.Commits the data back to the LUT object and decrements the reference count. There are several variants of
call methodology:
• If a user should allocated their own memory for the LUT data copy, the user is obligated to free this memory.
• If ptr is not NULL and the (∗ptr) for vxAccessLUT was NULL, it is undefined whether the implementationwill unmap or copy and free the memory.
Parameters
in lut The LUT to modify.in ptr The pointer used with vxAccessLUT. This may not be NULL.
Returns
A vx status e enumeration.
Precondition
vxAccessLUT.
vx lut vxCreateLUT ( vx context context, vx enum type, vx size count )
Creates LUT object of a given type.Parameters
in context The reference to the context.in type The type of LUT.in count The number of entries desired.
Note
For OpenVX 1.0 count must be equal to 256 and the type can only be VX TYPE UINT8.
Returns
vx lut
Postcondition
vxReleaseLUT
CHAPTER 3. MODULE DOCUMENTATION 128
vx status vxQueryLUT ( vx lut lut, vx enum attribute, void ∗ ptr, vx size size )
Queries attributes from a LUT.
CHAPTER 3. MODULE DOCUMENTATION 129
Parameters
in lut The LUT to query.in attribute The attribute to query. Use a vx lut attribute e enumeration.out ptr The address of the variable to hold the attribute.in size The byte size that ptr points to.
Returns
A vx status e enumeration.
void vxReleaseLUT ( vx lut ∗ lut )
Release a reference to a LUT object. The object may not be garbage collected until its total reference count is zero..Parameters
in lut The pointer to the LUT to release.
Note
After returning from this function the reference will be zeroed.
Precondition
vxCreateLUT
CHAPTER 3. MODULE DOCUMENTATION 130
3.24 Object: List
The List Object Interface.
Typedefs
• typedef vx reference vx iterator
An iterator for Lists.
• typedef vx reference vx list
The List Object. A List can contain an arbitrary number of data objects.
Enumerations
• enum vx list attribute e {VX LIST ATTRIBUTE TYPE = ((( VX ID KHRONOS ) << 20) | ( VX TYPE LIST << 8)) + 0x0,VX LIST ATTRIBUTE LENGTH = ((( VX ID KHRONOS ) << 20) | ( VX TYPE LIST << 8)) + 0x1 }
The list object attributes.
• enum vx list iterator e {VX LIST FRONT = ((( VX ID KHRONOS ) << 20) | ( VX ENUM LIST ITERATORS << 12)) + 0x0,VX LIST BACK = ((( VX ID KHRONOS ) << 20) | ( VX ENUM LIST ITERATORS << 12)) + 0x1,VX LIST FIRST = ((( VX ID KHRONOS ) << 20) | ( VX ENUM LIST ITERATORS << 12)) + 0x2,VX LIST LAST = ((( VX ID KHRONOS ) << 20) | ( VX ENUM LIST ITERATORS << 12)) + 0x3,VX LIST NEXT = ((( VX ID KHRONOS ) << 20) | ( VX ENUM LIST ITERATORS << 12)) + 0x4,VX LIST PREVIOUS = ((( VX ID KHRONOS ) << 20) | ( VX ENUM LIST ITERATORS << 12)) + 0x5 }
The list iterator names.
Functions
• vx status vxAddListItem (vx list list, vx reference ref)
Adds an item to the list, incrementing the reference count of the item.
• vx list vxCreateList (vx context context, vx enum type, vx size initial)
Creates a reference to a list object, capable of holding many references.
• vx status vxEmptyList (vx list list)
Removes all items from the list.
• vx reference vxGetListItem (vx list list, vx iterator ∗it, vx enum iter)
Retrieves an item from the list from named positions, but does not remove it.
• vx status vxQueryList (vx list list, vx enum attribute, void ∗ptr, vx size size)
Queries attributes from a list.
• void vxReleaseList (vx list ∗list)
Releases a reference of a list object. The object may not be garbage collected until its total reference count is zero.Once zero, all entries in the list and the list itself are released.
3.24.1 Detailed Description
The List Object Interface. A list is a generic, iterable storage structure for other data objects. For OpenVX 1.0vx list should only a constructed with VX TYPE COORDINATES or VX TYPE RECTANGLE or VX TYPE KE-YPOINT. This is an example ”for” loop over a list in the ”forwards” direction
vx reference r = 0;for (r = vxGetListItem(list, VX LIST FRONT);
r != 0;r = vxGetListItem(list, VX LIST NEXT))
{// cast the "r" to another vx <type> and do something
}
This is an example ”for” loop over a list in the ”backwards” direction
CHAPTER 3. MODULE DOCUMENTATION 131
vx reference r = 0;for (r = vxGetListItem(list, VX LIST BACK);
r != 0;r = vxGetListItem(list, VX LIST PREVIOUS))
{// cast the "r" to another vx <type> and do something
}
3.24.2 Enumeration Type Documentation
enum vx list attribute e
The list object attributes.
Enumerator
VX LIST ATTRIBUTE TYPE The type with which the list was created. Use a vx enum parameter.
VX LIST ATTRIBUTE LENGTH The number of active items in the list. Use a vx size parameter.
Definition at line 987 of file vx types.h.
enum vx list iterator e
The list iterator names.
Enumerator
VX LIST FRONT The logically first item in the list. Resets the VX LIST NEXT, and VX LIST PREVIOUS
VX LIST BACK The logically last item in the list. Resets the VX LIST NEXT and VX LIST PREVIOUS
VX LIST FIRST The logically first item in the list.
VX LIST LAST The logically last item in the list.
VX LIST NEXT The logically next item in the list. Updates VX LIST NEXT and VX LIST PREVIOUS.
VX LIST PREVIOUS The logically previous item in the list. Updates VX LIST NEXT and VX LIST PREV-IOUS.
Definition at line 1145 of file vx types.h.
3.24.3 Function Documentation
vx status vxAddListItem ( vx list list, vx reference ref )
Adds an item to the list, incrementing the reference count of the item.
Note
No ordering of list is defined. Once added the list may become unsorted.
Parameters
in list The list object.in ref The reference to add to the list.
Returns
A vx status e enumeration.
Return values
VX FAILURE the list is full.
CHAPTER 3. MODULE DOCUMENTATION 132
VX ERROR INVALID TYPE The supplied object was not of the type created for this list.
vx list vxCreateList ( vx context context, vx enum type, vx size initial )
Creates a reference to a list object, capable of holding many references.Parameters
in context The reference to the overall context.in type The type of references to hold.in initial The number of initial references to hold.
Returns
vx list
Return values
0 No list was created.∗ A list was created.
Referenced by example super resolution().
vx status vxEmptyList ( vx list list )
Removes all items from the list.Parameters
in list The list to empty.
Returns
A vx status e enumeration.
Return values
VX SUCCESS The list is empty.VX ERROR INVALID REF-
ERENCEThe list was not a vx list.
vx reference vxGetListItem ( vx list list, vx iterator ∗ it, vx enum iter )
Retrieves an item from the list from named positions, but does not remove it.Parameters
in list The list to access.in,out it The pointer to the iterator object. This object is internally ”reset” when VX L-
IST FRONT or VX LIST BACK are used and only updated when VX LIS-T NEXT or VX LIST PREVIOUS are used. VX LIST FIRST and VX LI-ST LAST do not modify the iterator.
in iter The vx list iterator e enumeration.
Note
The specification makes no guarantees about the thread-safety of this function. If VX LIST FRONT or V-X LIST BACK has not been called, then VX LIST NEXT will map to VX LIST FIRST for one call andVX LIST PREVIOUS will map to VX LIST LAST for one call.
Returns
vx reference
CHAPTER 3. MODULE DOCUMENTATION 133
Return values
0 The list is empty or the enumeration fell off the list.
vx status vxQueryList ( vx list list, vx enum attribute, void ∗ ptr, vx size size )
Queries attributes from a list.Parameters
in list The list object.in attribute The enumeration to query. Use a vx list attribute e enumeration.out ptr The address of the variable to hold the attribute.in size The byte size that ptr points to.
Returns
A vx status e enumeration.
void vxReleaseList ( vx list ∗ list )
Releases a reference of a list object. The object may not be garbage collected until its total reference count is zero.Once zero, all entries in the list and the list itself are released.Parameters
in list The pointer to the list to release.
Note
After returning from this function the reference will be zeroed.
CHAPTER 3. MODULE DOCUMENTATION 134
3.25 Object: Remap
The Remap Object Interface.
Typedefs
• typedef vx reference vx remap
The remap table Object. A remap table contains per pixel mapping of output pixels to input pixels.
Enumerations
• enum vx remap attribute e {VX REMAP ATTRIBUTE SOURCE WIDTH = ((( VX ID KHRONOS ) << 20) | ( VX TYPE REMAP << 8))+ 0x0,VX REMAP ATTRIBUTE SOURCE HEIGHT = ((( VX ID KHRONOS ) << 20) | ( VX TYPE REMAP << 8))+ 0x1,VX REMAP ATTRIBUTE DESTINATION WIDTH = ((( VX ID KHRONOS ) << 20) | ( VX TYPE REMAP<< 8)) + 0x2,VX REMAP ATTRIBUTE DESTINATION HEIGHT = ((( VX ID KHRONOS ) << 20) | ( VX TYPE REMAP<< 8)) + 0x3 }
The remap object attributes.
Functions
• vx remap vxCreateRemap (vx context context, vx uint32 src width, vx uint32 src height, vx uint32 dst width,vx uint32 dst height)
Creates a remap table object.
• vx status vxGetRemapPoint (vx remap table, vx uint32 dst x, vx uint32 dst y, vx float32 ∗src x, vx float32∗src y)
Retrieves the source pixel point from a destination pixel.
• vx status vxQueryRemap (vx remap r, vx enum attribute, void ∗ptr, vx size size)
Queries attributes from a Remap table.
• void vxReleaseRemap (vx remap ∗table)
Release a reference to a remap table object. The object may not be garbage collected until its total reference countis zero.
• vx status vxSetRemapPoint (vx remap table, vx uint32 dst x, vx uint32 dst y, vx float32 src x, vx float32 src-y)
Assigns a destination pixel mapping to the source pixel.
3.25.1 Detailed Description
The Remap Object Interface.
3.25.2 Enumeration Type Documentation
enum vx remap attribute e
The remap object attributes.
Enumerator
VX REMAP ATTRIBUTE SOURCE WIDTH The source width. Use a vx uint32 parameter.
VX REMAP ATTRIBUTE SOURCE HEIGHT The source height. Use a vx uint32 parameter.
VX REMAP ATTRIBUTE DESTINATION WIDTH The destination width. Use a vx uint32 parameter.
VX REMAP ATTRIBUTE DESTINATION HEIGHT The destination height. Use a vx uint32 parameter.
Definition at line 997 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 135
3.25.3 Function Documentation
vx remap vxCreateRemap ( vx context context, vx uint32 src width, vx uint32 src height, vx uint32dst width, vx uint32 dst height )
Creates a remap table object.
CHAPTER 3. MODULE DOCUMENTATION 136
Parameters
in context The reference to the overall context.in src width Width of the source image in pixel.in src height Height of the source image in pixels.in dst width Width of the destination image in pixels.in dst height Height of the destination image in pixels.
Returns
Returns vx remap
Return values
0 Object could not be created.∗ Object was created.
vx status vxGetRemapPoint ( vx remap table, vx uint32 dst x, vx uint32 dst y, vx float32 ∗ src x,vx float32 ∗ src y )
Retrieves the source pixel point from a destination pixel.Parameters
in table The remap table reference.in dst x The destination x coordinate.in dst y The destination y coordinate.out src x The pointer to the location to store the source x coordinate in float representa-
tion to allow interpolation.out src y The pointer to the location to store the source y coordinate in float representa-
tion to allow interpolation.
Returns
Returns a vx status e enumeration.
vx status vxQueryRemap ( vx remap r, vx enum attribute, void ∗ ptr, vx size size )
Queries attributes from a Remap table.Parameters
in r The remap to query.in attribute The attribute to query. Use a vx remap attribute e enumeration.out ptr The address of the variable to hold the attribute.in size The byte size that ptr points to.
Returns
A vx status e enumeration.
void vxReleaseRemap ( vx remap ∗ table )
Release a reference to a remap table object. The object may not be garbage collected until its total reference countis zero.Parameters
CHAPTER 3. MODULE DOCUMENTATION 137
in table The pointer to the remap table to release.
Note
After returning from this function the reference will be zeroed.
vx status vxSetRemapPoint ( vx remap table, vx uint32 dst x, vx uint32 dst y, vx float32 src x,vx float32 src y )
Assigns a destination pixel mapping to the source pixel.Parameters
in table The remap table reference.in dst x The destination x coordinate.in dst y The destination y coordinate.in src x The source x coordinate in float representation to allow interpolation.in src y The source y coordinate in float representation to allow interpolation.
Returns
Returns a vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 138
3.26 Framework: Hint
The Hints Interface.
Enumerations
• enum vx hint e { VX HINT SERIALIZE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM HINT << 12)) + 0x0}
These enumerations are given to the vxHint API to enable/disable platform optimizations and/or features. Hints areoptional and usually will be vendor specific.
Functions
• vx status vxHint (vx context context, vx reference reference, vx enum hint)
A generic API to give platform specific hints to the implementation.
3.26.1 Detailed Description
The Hints Interface. Hints are messages given to the OpenVX implementation which are optional.
3.26.2 Enumeration Type Documentation
enum vx hint e
These enumerations are given to the vxHint API to enable/disable platform optimizations and/or features. Hints areoptional and usually will be vendor specific.
See Also
vxHint
Enumerator
VX HINT SERIALIZE This indicates to the implementation that the user wants to disable any parallelizationtechniques. Implementations may not be parallelized, so this is a hint only.
Definition at line 575 of file vx types.h.
3.26.3 Function Documentation
vx status vxHint ( vx context context, vx reference reference, vx enum hint )
A generic API to give platform specific hints to the implementation.Parameters
in context The reference to the implementation context.in reference The reference to the object to hint at. This could be vx context, vx -
graph, vx node, vx image, vx buffer, or any other reference.in hint A vx hint e ”hint” to give the OpenVX context. This is a platform specific
optimization or implementation mechanism.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No error.
CHAPTER 3. MODULE DOCUMENTATION 139
VX ERROR INVALID REF-ERENCE
if context or reference are invalid.
VX ERROR NOT SUPPO-RTED
if the hint is not supported.
Precondition
vxCreateContext
CHAPTER 3. MODULE DOCUMENTATION 140
3.27 Framework: Directive
The Directives Interface.
Enumerations
• enum vx directive e {VX DIRECTIVE DISABLE LOGGING = ((( VX ID KHRONOS ) << 20) | ( VX ENUM DIRECTIVE << 12))+ 0x0,VX DIRECTIVE ENABLE LOGGING = ((( VX ID KHRONOS ) << 20) | ( VX ENUM DIRECTIVE << 12)) +0x1 }
These enumerations are given to the vxDirective API to enable/disable platform optimizations and/or features. Direc-tives are not optional and usually will be vendor specific, by defining a vendor range of directives and starting theirenumeration from there.
Functions
• vx status vxDirective (vx context context, vx reference reference, vx enum directive)
A generic API to give platform specific directives to the implementations.
3.27.1 Detailed Description
The Directives Interface. Directives are messages given the OpenVX implementation which are non-optional.
3.27.2 Enumeration Type Documentation
enum vx directive e
These enumerations are given to the vxDirective API to enable/disable platform optimizations and/or features. Di-rectives are not optional and usually will be vendor specific, by defining a vendor range of directives and startingtheir enumeration from there.
See Also
vxDirective
Enumerator
VX DIRECTIVE DISABLE LOGGING Disables recording information for graph debugging.
VX DIRECTIVE ENABLE LOGGING Enables recording information for graph debugging.
Definition at line 590 of file vx types.h.
3.27.3 Function Documentation
vx status vxDirective ( vx context context, vx reference reference, vx enum directive )
A generic API to give platform specific directives to the implementations.Parameters
in context The reference to the implementation context.in reference The reference to the object to set the directive on. This could be vx -
context, vx graph, vx node, vx image, vx buffer, or any otherreference.
CHAPTER 3. MODULE DOCUMENTATION 141
in directive The directive to set.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No error.VX ERROR INVALID REF-
ERENCEif context or reference are invalid.
VX ERROR NOT SUPPO-RTED
if the directive is not supported.
Precondition
vxCreateContext
CHAPTER 3. MODULE DOCUMENTATION 142
3.28 Framework: Users Supplied Nodes
User Extensions are a method to extend OpenVX with User defined kernels which can be loaded by OpenVX andincluded as nodes in the graph or immediate functions.
Data Structures
• struct vx meta format t
This structure is used to extract meta data from a validation function. If the data object between nodes is virtual, thiswill allow the framework to automatically create the data object, if needed. More...
Typedefs
• typedef vx status(∗ vx kernel deinitialize f )(vx node node, vx reference ∗parameters, vx uint32 num)
The pointer to the kernel deinitializer. If the host code requires a call to deinitialize data during a node garbagecollection, this function will be called, if not NULL.
• typedef vx status(∗ vx kernel f )(vx node node, vx reference ∗parameters, vx uint32 num)
The pointer to the Host side kernel.
• typedef vx status(∗ vx kernel initialize f )(vx node node, vx reference ∗parameters, vx uint32 num)
The pointer to the kernel initializer. If the host code requires a call to initialize data once all the parameters have beenvalidated, this function will be called, if not NULL.
• typedef vx status(∗ vx kernel input validate f )(vx node node, vx uint32 index)
The user defined kernel node input parameter validation function.
• typedef vx status(∗ vx kernel output validate f )(vx node node, vx uint32 index, vx meta format t ∗ptr)
The user defined kernel node output parameter validation function. The function only needs to fill in the meta datastructure.
• typedef vx status(∗ vx publish kernels f )(vx context context)
The entry point into modules loaded by vxLoadKernels.
Functions
• vx kernel vxAddKernel (vx context context, vx char name[VX MAX KERNEL NAME], vx enum enumeration,vx kernel f func ptr, vx uint32 numParams, vx kernel input validate f input, vx kernel output validate f output,vx kernel initialize f init, vx kernel deinitialize f deinit)
This API allows users to add custom kernels to the known kernel database in OpenVX at runtime. This would primarilybe used by the module function vxPublishKernels.
• vx status vxAddParameterToKernel (vx kernel kernel, vx uint32 index, vx enum dir, vx enum type, vx enumstate)
This API allows users to set the signatures of the custom kernel.
• vx status vxFinalizeKernel (vx kernel kernel)
This API is called after all parameters have been added to the kernel and the kernel is ”ready” to be used.
• vx status vxLoadKernels (vx context context, vx char ∗module)
Loads one or more kernels into the OpenVX context. This is the interface by which OpenVX is extensible. Once theset of kernels is loaded new kernels and their parameters can be queried.
• vx status vxRemoveKernel (vx kernel kernel)
Removes a non-finalized vx kernel from the vx context. Once a vx kernel has been finalized it can not be removed.
• vx status vxSetKernelAttribute (vx kernel kernel, vx enum attribute, void ∗ptr, vx size size)
The interface to set kernel attributes.
3.28.1 Detailed Description
User Extensions are a method to extend OpenVX with User defined kernels which can be loaded by OpenVX andincluded as nodes in the graph or immediate functions. User Extensions can be loaded and executed on HLOS/CPUcompatible platforms. This specification does not mandate what constitutes compatible platforms.
CHAPTER 3. MODULE DOCUMENTATION 143
3.28.2 Data Structure Documentation
struct vx meta format t
This structure is used to extract meta data from a validation function. If the data object between nodes is virtual,this will allow the framework to automatically create the data object, if needed.
Examples:
vx tiling ext.c, and xyz module.c.
Definition at line 1241 of file vx types.h.Data Fields
struct dim dimvx enum type The vx type e or vx fourcc e code
3.28.3 Typedef Documentation
typedef vx status(∗ vx kernel deinitialize f)(vx node node, vx reference ∗parameters, vx uint32 num)
The pointer to the kernel deinitializer. If the host code requires a call to deinitialize data during a node garbagecollection, this function will be called, if not NULL.Parameters
in node The handle to the node which contains this kernel.in parameters The array of parameter references.in num The number of parameters.
Definition at line 1233 of file vx types.h.
typedef vx status(∗ vx kernel f)(vx node node, vx reference ∗parameters, vx uint32 num)
The pointer to the Host side kernel.Parameters
in node The handle to the node which contains this kernel.in parameters The array of parameter references.in num The number of parameters.
Definition at line 1211 of file vx types.h.
typedef vx status(∗ vx kernel initialize f)(vx node node, vx reference ∗parameters, vx uint32 num)
The pointer to the kernel initializer. If the host code requires a call to initialize data once all the parameters havebeen validated, this function will be called, if not NULL.Parameters
in node The handle to the node which contains this kernel.in parameters The array of parameter references.in num The number of parameters.
Definition at line 1222 of file vx types.h.
typedef vx status(∗ vx kernel input validate f)(vx node node, vx uint32 index)
The user defined kernel node input parameter validation function.
Note
This function will be called once for each VX INPUT or VI BIDIRECTIONAL parameter index.
CHAPTER 3. MODULE DOCUMENTATION 144
Parameters
in node The handle to the node which is being validated.in index The index of the parameter being validated.
Returns
Returns an error code describing the validation status on this parameter.
Return values
VX ERROR INVALID FOR-MAT
The parameter format was incorrect.
VX ERROR INVALID VAL-UE
The value of the parameter was incorrect.
VX ERROR INVALID DIM-ENSION
The dimensionality of the parameter was incorrect.
VX ERROR INVALID PAR-AMETERS
The index was out of bounds.
Examples:
vx tiling ext.c.
Definition at line 1291 of file vx types.h.
typedef vx status(∗ vx kernel output validate f)(vx node node, vx uint32 index, vx meta format t ∗ptr)
The user defined kernel node output parameter validation function. The function only needs to fill in the meta datastructure.
Note
This function will be called once for each VX OUTPUT parameter index.
Parameters
in node The handle to the node which is being validated.in index The index of the parameter being validated.in ptr A pointer to a preallocated structure that the system holds. The validation
function will fill in the correct type, format and dimensionality for the system touse either create memory or check against existing memory.
Returns
Returns an error code describing the validation status on this parameter.
Return values
VX ERROR INVALID PAR-AMETERS
The index was out of bounds.
Examples:
vx tiling ext.c.
Definition at line 1307 of file vx types.h.
typedef vx status(∗ vx publish kernels f)(vx context context)
The entry point into modules loaded by vxLoadKernels.
CHAPTER 3. MODULE DOCUMENTATION 145
Parameters
in context The handle to the implementation context.
Note
The symbol exported from the user module must be ”vxPublishKernels” in extern ”C” format.
Definition at line 1202 of file vx types.h.
3.28.4 Function Documentation
vx kernel vxAddKernel ( vx context context, vx char name[VX MAX KERNEL NAME], vx enumenumeration, vx kernel f func ptr, vx uint32 numParams, vx kernel input validate f input,vx kernel output validate f output, vx kernel initialize f init, vx kernel deinitialize f deinit )
This API allows users to add custom kernels to the known kernel database in OpenVX at runtime. This wouldprimarily be used by the module function vxPublishKernels.Parameters
in context The reference to the implementation context.in name The string which is to be used to match the kernel.in enumeration The enumerated value of the kernel to be used by clients.in func ptr The process-local function pointer to be invokedin numParams The number of parameters for this kernel.in input The pointer to a function which will validate the input parameters to this kernel.in output The pointer to a function which will validate the output parameters to this ker-
nel.in init The kernel initialization function.in deinit The kernel de-initialization function.
Returns
vx kernel
Return values
0 Indicates that an error occurred when adding the kernel.∗ Kernel added to OpenVX.
Precondition
vxCreateContext vxLoadKernels
Examples:
xyz module.c.
Referenced by vxPublishKernels().
vx status vxAddParameterToKernel ( vx kernel kernel, vx uint32 index, vx enum dir, vx enum type,vx enum state )
This API allows users to set the signatures of the custom kernel.Parameters
in kernel The reference to the kernel added with vxAddKernel.in index The index of the parameter to add.
CHAPTER 3. MODULE DOCUMENTATION 146
in dir The direction of the parameter. This must be a value from vx direction e.in type The type of parameter. This must be a value from vx type e.in state The state of the parameter (Required or not). This must be a value from vx -
parameter state e.
Returns
A vx status e enumerated value.
Return values
VX SUCCESS Parameter set on kernel.VX ERROR INVALID REF-
ERENCEThe value passed as kernel was not a vx kernel.
Precondition
vxAddKernel
Examples:
vx tiling ext.c, and xyz module.c.
Referenced by vxPublishKernels().
vx status vxFinalizeKernel ( vx kernel kernel )
This API is called after all parameters have been added to the kernel and the kernel is ”ready” to be used.Parameters
in kernel The reference to the loaded kernel from vxAddKernel.
Returns
A vx status e enumeration. If an error occurs, the kernel will not be available for usage by the clients ofOpenVX. Typically this is due to a mismatch between the number of parameter requested and given.
Precondition
vxAddKernel vxAddParameterToKernel
Examples:
vx tiling ext.c, and xyz module.c.
Referenced by vxPublishKernels().
vx status vxLoadKernels ( vx context context, vx char ∗ module )
Loads one or more kernels into the OpenVX context. This is the interface by which OpenVX is extensible. Once theset of kernels is loaded new kernels and their parameters can be queried.
Note
When all references to loaded kernels are released, the module may be automatically unloaded.
Parameters
in context The reference to the implementation context.
CHAPTER 3. MODULE DOCUMENTATION 147
in module The short name of the module to load. On systems where there are specificnaming conventions for modules, the name passed should ignore such con-ventions. For example: ”libxyz.so” should be passed as just ”xyz” and theimplementation will ”do the right thing” that the platform requires.
Note
This API will use the system pre-defined paths for modules.
Returns
A vx status e enumeration.
Return values
VX SUCCESS No errorsVX ERROR INVALID REF-
ERENCEif the context is not a vx context.
VX ERROR INVALID PAR-AMETERS
if any of the other parameters are incorrect.
Precondition
vxCreateContext
See Also
vxGetKernelByName
Examples:
vx factory pipeline.c, vx tiling main.c, and vx xyz ext.c.
Referenced by example super resolution(), and vxPipelineGraphFactory().
vx status vxRemoveKernel ( vx kernel kernel )
Removes a non-finalized vx kernel from the vx context. Once a vx kernel has been finalized it can not beremoved.Parameters
in kernel The reference to the kernel to be removed. Returned from vxAddKernel.
Note
Any kernel enumerated in the base standard can not be removed. Only kernels added through vxAdd-Kernel can be removed.
Returns
A vx status e enumeration.
Return values
VX ERROR INVALID REF-ERENCE
if an invalid kernel was passed in.
VX ERROR INVALID PAR-AMETER
if a base kernel was passed in.
Examples:
vx tiling ext.c, and xyz module.c.
Referenced by vxPublishKernels().
vx status vxSetKernelAttribute ( vx kernel kernel, vx enum attribute, void ∗ ptr, vx size size )
The interface to set kernel attributes.
CHAPTER 3. MODULE DOCUMENTATION 148
Parameters
in kernel The reference to the kernel.in attribute The enumeration of the attributes. See vx kernel attribute e.
in,out ptr The pointer to the location to read or write the attribute.in size The size of the data area indicated by ptr.
Note
After a kernel has been passed to vxFinalizeKernel, no attributes can be altered.
Returns
A vx status e enumeration.
Examples:
vx tiling ext.c, and xyz module.c.
Referenced by vxPublishKernels().
CHAPTER 3. MODULE DOCUMENTATION 149
3.29 Framework: Performance Measurement
The Performance measurement and reporting interfaces.
Data Structures
• struct vx perf t
The performance measurement structure. More...
3.29.1 Detailed Description
The Performance measurement and reporting interfaces. In OpenVX, both vx graph objects and vx -node objects track performance information. A user can query either object type using their respective vx-Query<Object> function with their attribute enumeration VX <OBJECT> ATTRIBUTE PERFORMANCEalong with a vx perf t structure to obtain the performance information.
3.29.2 Data Structure Documentation
struct vx perf t
The performance measurement structure.Definition at line 1383 of file vx types.h.
Data Fields
vx uint64 avg Used to hold the average of the durations.vx uint64 beg Used to hold the first measurement in a set.vx uint64 end Used to hold the last measurement in a set.vx uint64 num Used to hold the number of measurements.vx uint64 sum Used to hold the summation of durations.vx uint64 tmp Used to hold the last measurement.
CHAPTER 3. MODULE DOCUMENTATION 150
3.30 OpenVX Helper
The helper is an non-standardized set of convenience constructs for OpenVX.
Data Structures
• struct vx kernel description t
Contains everything needed to abstractly describe a kernel. This is used to declare kernels at compile time. More...
• struct vx param description t
Contains everything needed to abstractly describe a parameter to a kernel. This is used to declare kernel parametersat compile time. More...
• struct vx parameter item t
A structure used to simplify construction of nodes at run-time. The order of declaration indicates the index. More...
Macros
• #define dimof(x) (sizeof(x)/sizeof(x[0]))
A helper macro to determine the number of elements in an array.
• #define VX TAU 6.28318530717958647692
A definition for TAU, or 2∗PI.
Functions
• vx status vxAddParameterToGraphByIndex (vx graph g, vx node n, vx uint32 index)
Adds a parameter to a graph by indicating the source node, and the index of the parameter on the node.
• vx status vxAlterRectangle (vx rectangle rect, vx int32 dsx, vx int32 dsy, vx int32 dex, vx int32 dey)
[Helper] This function changes the points of a rectangle by some delta value per coordinate.
• void vxClearLog (vx graph graph)
A method to clear out the log for a particular graph.
• vx node vxCreateNodeByStructure (vx graph graph, vx enum kernelenum, vx parameter item t ∗params, vx-uint32 num)
A method to construct a node via arbitrary parameters and an enum.
• vx target vxFindTarget (vx context context, vx char name[VX MAX TARGET NAME])
A method to retrieve a specific target.
• vx status vxLinkParametersByIndex (vx node node a, vx enum index a, vx node node b, vx enum index b)
This is used to connect one parameter to another parameter by explicity indexing when the handles to the data objectsare lost.
• vx status vxLinkParametersByReference (vx parameter a, vx parameter b)
This is used to connect one node parameter to another node parameter when the original handles to the data objectsare already lost. The context determines if a buffer is necessary or can be optimized out.
• vx status vxSetAffineRotationMatrix (vx matrix matrix, vx float32 angle, vx float32 scale, vx float32 center x,vx float32 center y)
This helper is used to easily set the affine matrix to a rotation and scale.
3.30.1 Detailed Description
The helper is an non-standardized set of convenience constructs for OpenVX. These functions use only the OpenV-X API in order to implement their functionality. As such structures, objects, defines, typedefs and functions definedherein are not part of the OpenVX standard, and are included as EXAMPLE code only.
3.30.2 Data Structure Documentation
struct vx kernel description t
Contains everything needed to abstractly describe a kernel. This is used to declare kernels at compile time.Definition at line 76 of file vx helper.h.
CHAPTER 3. MODULE DOCUMENTATION 151
Data Fields
vx kernel -deinitialize f
deinitialize The deinitialization function.
vx enum enumeration The vx kernel e enum.vx kernel f function The pointer to the function to execute the kernel.vx kernel -
initialize finitialize The initialization function.
vx kernel input -validate f
input validate The input validator.
vx char name[VX MAX -KERNEL NAME]
The name that kernel will be used with vxGetKernelByName.
vx uint32 numParams The number of paraemeters in the array.vx kernel output-
validate foutput validate The output validator.
vx param -description t
∗
parameters The pointer to the array of parameter descriptors.
struct vx param description t
Contains everything needed to abstractly describe a parameter to a kernel. This is used to declare kernel parame-ters at compile time.
Examples:
vx tiling ext.c.
Definition at line 66 of file vx helper.h.Data Fields
vx enum direction From vx direction e.vx enum state From vx parameter state e.vx enum type From vx type e.
struct vx parameter item t
A structure used to simplify construction of nodes at run-time. The order of declaration indicates the index.
Examples:
vx helper.c, and vx tiling main.c.
Definition at line 55 of file vx helper.h.Data Fields
vx enum direction From vx direction e.vx reference reference Any vx reference derived object. No primitive data type variables may be
placed here.
3.30.3 Function Documentation
vx status vxAddParameterToGraphByIndex ( vx graph g, vx node n, vx uint32 index )
Adds a parameter to a graph by indicating the source node, and the index of the parameter on the node.Parameters
CHAPTER 3. MODULE DOCUMENTATION 152
in g The graph handle.in n The node handle.in index The index of the parameter on the node.
Returns
Returns a vx status e enumeration.
Examples:
vx factory corners.c, vx factory pipeline.c, and vx helper.c.
Definition at line 249 of file vx helper.c.References vxAddParameterToGraph(), vxGetParameterByIndex(), and vxReleaseParameter().Referenced by vxCornersGraphFactory(), and vxPipelineGraphFactory().
vx status vxAlterRectangle ( vx rectangle rect, vx int32 dsx, vx int32 dsy, vx int32 dex, vx int32 dey )
[Helper] This function changes the points of a rectangle by some delta value per coordinate.Parameters
in rect The rectangle to modify.in dsx The start x delta.in dsy The start y delta.in dex The end x delta.in dey The end y delta.
Returns
vx status
Return values
VX SUCCESS Modified rectangle.VX ERROR INVALID REF-
ERENCENot a valid rectangle.
Examples:
vx helper.c.
Definition at line 231 of file vx helper.c.References VX ERROR INVALID REFERENCE, VX SUCCESS, vxAccessRectangleCoordinates(), and vx-
CommitRectangleCoordinates().
void vxClearLog ( vx graph graph )
A method to clear out the log for a particular graph.Parameters
in graph The graph handle.
Examples:
vx helper.c.
Definition at line 26 of file vx clearlog.c.References VX MAX LOG MESSAGE LEN, VX SUCCESS, and vxGetLogEntry().
vx node vxCreateNodeByStructure ( vx graph graph, vx enum kernelenum, vx parameter item t ∗params, vx uint32 num )
A method to construct a node via arbitrary parameters and an enum.
CHAPTER 3. MODULE DOCUMENTATION 153
Parameters
in graph The handle to desired graph to add the node to.in kernelenum The vx kernel e enum value used to create a node.in params The array of parameter information.in num The number of elements in params.
Returns
vx node
Return values
0 Indicates a failure.
Examples:
vx helper.c, and vx tiling main.c.
Definition at line 57 of file vx helper.c.References VX ERROR INVALID PARAMETERS, VX ERROR NO MEMORY, VX ERROR NOT SUPPORT-
ED, VX SUCCESS, vxAddLogEntry(), vxCreateNode(), vxGetContext(), vxGetKernelByEnum(), vxReleaseKernel(),vxReleaseNode(), and vxSetParameterByIndex().
vx target vxFindTarget ( vx context context, vx char name[VX MAX TARGET NAME] )
A method to retrieve a specific target.Parameters
in context The handle to the overall context.in name The platform specific name of the target.
Returns
Returns a vx target reference.
Return values
0 Target not present.∗ Target reference.
Examples:
vx helper.c.
vx status vxLinkParametersByIndex ( vx node node a, vx enum index a, vx node node b, vx enumindex b )
This is used to connect one parameter to another parameter by explicity indexing when the handles to the dataobjects are lost.Parameters
in node a The source node to link from.in index a The index of the vx parameter to link from.in node b The sink node to link to.in index b The index of the vx parameter to link to.
Returns
Returns a status code.
CHAPTER 3. MODULE DOCUMENTATION 154
Precondition
vxCreateNode
Examples:
vx helper.c.
Definition at line 112 of file vx helper.c.References vxGetParameterByIndex(), vxLinkParametersByReference(), and vxReleaseParameter().
vx status vxLinkParametersByReference ( vx parameter a, vx parameter b )
This is used to connect one node parameter to another node parameter when the original handles to the dataobjects are already lost. The context determines if a buffer is necessary or can be optimized out.Parameters
in a The output parameterin b The input parameter
Returns
Returns a status code.
Precondition
vxGetParameterByIndex
Examples:
vx helper.c.
Definition at line 121 of file vx helper.c.References VX BIDIRECTIONAL, VX ERROR INVALID LINK, VX INPUT, VX OUTPUT, VX PARAMETER A-
TTRIBUTE DIRECTION, VX SUCCESS, vxQueryParameter(), and vxSetParameterByReference().Referenced by vxLinkParametersByIndex().
vx status vxSetAffineRotationMatrix ( vx matrix matrix, vx float32 angle, vx float32 scale, vx float32center x, vx float32 center y )
This helper is used to easily set the affine matrix to a rotation and scale.Parameters
in matrix The handle to the matrix.in angle The rotation angle in degrees.in scale The scaling value. Values less than one are enlarging.in center x The center pixel in the x direction.in center y The center pixel in the y direction.
Returns
Returns a vx status e enumeration.
Examples:
vx helper.c.
Definition at line 166 of file vx helper.c.References VX FAILURE, VX MATRIX ATTRIBUTE COLUMNS, VX MATRIX ATTRIBUTE ROWS, VX MAT-
RIX ATTRIBUTE TYPE, VX SUCCESS, VX TAU, VX TYPE FLOAT32, vxAccessMatrix(), vxAddLogEntry(), vx-CommitMatrix(), and vxQueryMatrix().
CHAPTER 3. MODULE DOCUMENTATION 155
3.31 OpenVX Kernels
The kernels supported in OpenVX.
Modules
• Kernel: Absolute Difference
Computes the absolute difference between two images.
• Kernel: Accumulate
Accumulates an input image into output image.
• Kernel: Accumulate Squared
Accumulates a squared value from an input image to an output image.
• Kernel: Accumulate Weighted
Accumulates a weighted value from an input image to an output image.
• Kernel: Arithmetic Addition
Performs addition between two images.
• Kernel: Arithmetic Subtraction
Performs subtraction between two images.
• Kernel: Bitwise And
Performs bitwise ”and” between two FOURCC U8 images.
• Kernel: Bitwise Exclusive Or
Performs bitwise ”exclusive or” between two FOURCC U8 images.
• Kernel: Bitwise Inclusive Or
Performs bitwise ”inclusive or” between two FOURCC U8 images.
• Kernel: Bitwise Not
Performs bitwise ”not” on a FOURCC U8 input image.
• Kernel: Box Filter
Compute a Box filter over a window of the input image.
• Kernel: Canny Edge Detector
Canny Edge detection kernel.
• Kernel: Channel Combine
The Channel Combine Kernel.
• Kernel: Channel Extract
The Channel Extraction Kernel.
• Kernel: Color Convert
The Color Conversion Kernel.
• Kernel: Convert Bit depth
Converts image bit depth.
• Kernel: Custom Convolution
Convolves the input with the user supplied convolution matrix.
• Kernel: Dilate Image
Dilation ”grows” the white space in a FOURCC U8 ”bool” image.
• Kernel: Equalize Histogram
Equalizes the histogram of a grayscale image.
• Kernel: Erode Image
Erosion ”shrinks” the white space in a FOURCC U8 ”bool” image.
• Kernel: Fast Corners
Computes the corners in an image using FAST algorithm.
• Kernel: Gaussian Filter
Computes a Gaussian filter over a window of the input image.
• Kernel: Harris Corners
CHAPTER 3. MODULE DOCUMENTATION 156
Computes the Harris Corners of an image.
• Kernel: Histogram
Generates a distribution from an image.
• Kernel: Image Pyramid
Computes a Gaussian and/or Laplacian filter over each step or level of the pyramid then scales it.
• Kernel: Integral Image
Computes the integral image of the input.
• Kernel: Magnitude
The Gradient Magnitude Computation Kernel.
• Kernel: Mean and Standard Deviation.
Computes the mean pixel value and the standard deviation of the pixels in the input image (which has a dimensionwidth and height).
• Kernel: Median Filter
Compute a median pixel value over a window of the input image.
• Kernel: Min, Max Location
Finds the minimum and maximum values in an image and a location for each.
• Kernel: Optical Flow Pyramid (LK)
Computes the optical flow using the Lucas-Kanade method between two pyramid images.
• Kernel: Phase
The Gradient Phase Computation Kernel.
• Kernel: Pixel-wise Multiplication
Performs element-wise multiplication between two images and a scalar value.
• Kernel: Remap
Maps output pixels in an image from input pixels in an image.
• Kernel: Scale Image
The Image Resizing Kernel.
• Kernel: Sobel 3x3
The Sobel Image Filter Kernel.
• Kernel: TableLookup
The Table Lookup Image Kernel.
• Kernel: Thresholding
Thresholds an input image and produces an output boolean image.
• Kernel: Warp Affine
Performs an affine transform on an image.
• Kernel: Warp Perspective
Performs a perspective transform on an image.
3.31.1 Detailed Description
The kernels supported in OpenVX.
CHAPTER 3. MODULE DOCUMENTATION 157
3.32 Kernel: Color Convert
The Color Conversion Kernel.
Functions
• vx node vxColorConvertNode (vx graph graph, vx image input, vx image output)
[Graph] Creates a color conversion node.
• vx status vxuColorConvert (vx image input, vx image output)
[Immediate] Invokes an immediate Color Conversion.
3.32.1 Detailed Description
The Color Conversion Kernel. This kernel converts an image of a designated vx fourcc e format to anothervx fourcc e format for those combinations listed in this table, where the columns are output types and rows areinput types; the API version first supporting the conversion is listed:
I/O RGB RGBX NV12 NV21 UYVY YUYV IYUV YUV4RGB 1.0 1.0 1.0 1.0RGBX 1.0 1.0 1.0 1.0NV12 1.0 1.0 1.0 1.0NV21 1.0 1.0 1.0 1.0UYVY 1.0 1.0 1.0 1.0YUYV 1.0 1.0 1.0 1.0IYUV 1.0 1.0 1.0 1.0YUV4
The vx fourcc e encoding, held in the VX IMAGE ATTRIBUTE FORMAT attribute, describes the data lay-out. The interpretation of the colors is determined by the VX IMAGE ATTRIBUTE SPACE (see vx color -space e) and VX IMAGE ATTRIBUTE RANGE (see vx channel range e) attributes of the image.
3.32.2 Function Documentation
vx node vxColorConvertNode ( vx graph graph, vx image input, vx image output )
[Graph] Creates a color conversion node.Parameters
in graph The reference to the graph.in input The input image to convert from.out output The output image to convert into.
See Also
VX KERNEL COLOR CONVERT
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuColorConvert ( vx image input, vx image output )
[Immediate] Invokes an immediate Color Conversion.
CHAPTER 3. MODULE DOCUMENTATION 158
Parameters
in input The input image.out output The output image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 159
3.33 Kernel: Channel Extract
The Channel Extraction Kernel.
Functions
• vx node vxChannelExtractNode (vx graph graph, vx image input, vx enum channel, vx image output)
[Graph] Creates a channel extract node.
• vx status vxuChannelExtract (vx image input, vx enum channel, vx image output)
[Immediate] Invokes an immediate Channel Extract.
3.33.1 Detailed Description
The Channel Extraction Kernel. This kernel removes a single FOURCC U8 channel (plane) from a multi-planar orinterleaved image format from vx fourcc e.
3.33.2 Function Documentation
vx node vxChannelExtractNode ( vx graph graph, vx image input, vx enum channel, vx image output )
[Graph] Creates a channel extract node.Parameters
in graph The reference to the graph.in input The input image. Must be one of the defined vx fourcc e multi-planar formats.in channel The vx channel e channel to extract.out output The output image. Must be FOURCC U8.
See Also
VX KERNEL CHANNEL EXTRACT
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
vx status vxuChannelExtract ( vx image input, vx enum channel, vx image output )
[Immediate] Invokes an immediate Channel Extract.Parameters
in input The input image. Must be one of the defined vx fourcc e multiplanar formats.in channel The vx channel e channel to extract.out output The output image. Must be FOURCC U8.
Returns
A vx status e enumeration.
Return values
CHAPTER 3. MODULE DOCUMENTATION 160
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 161
3.34 Kernel: Channel Combine
The Channel Combine Kernel.
Functions
• vx node vxChannelCombineNode (vx graph graph, vx image plane0, vx image plane1, vx image plane2,vx image plane3, vx image output)
[Graph] Creates a channel combine node.
• vx status vxuChannelCombine (vx image plane0, vx image plane1, vx image plane2, vx image plane3, vx -image output)
[Immediate] Invokes an immediate Channel Combine.
3.34.1 Detailed Description
The Channel Combine Kernel. This kernel takes multiple FOURCC U8 planes to recombine them into a multi-planaror interleaved format from vx fourcc e.
3.34.2 Function Documentation
vx node vxChannelCombineNode ( vx graph graph, vx image plane0, vx image plane1, vx image plane2,vx image plane3, vx image output )
[Graph] Creates a channel combine node.Parameters
in graph The graph reference.in plane0 The plane which will form channel 0. Must be FOURCC U8.in plane1 The plane which will form channel 1. Must be FOURCC U8.in plane2 [optional] The plane which will form channel 2. Must be FOURCC U8.in plane3 [optional] The plane which will form channel 3. Must be FOURCC U8.out output The output image.
See Also
VX KERNEL CHANNEL COMBINE
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
vx status vxuChannelCombine ( vx image plane0, vx image plane1, vx image plane2, vx image plane3,vx image output )
[Immediate] Invokes an immediate Channel Combine.Parameters
in plane0 The plane which will form channel 0. Must be FOURCC U8.in plane1 The plane which will form channel 1. Must be FOURCC U8.
CHAPTER 3. MODULE DOCUMENTATION 162
in plane2 [optional] The plane which will form channel 2. Must be FOURCC U8.in plane3 [optional] The plane which will form channel 3. Must be FOURCC U8.out output The output image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 163
3.35 Kernel: Sobel 3x3
The Sobel Image Filter Kernel.
Functions
• vx node vxSobel3x3Node (vx graph graph, vx image input, vx image output x, vx image output y)
[Graph] Create a Sobel3x3 node.
• vx status vxuSobel3x3 (vx image input, vx image output x, vx image output y)
[Immediate] Invokes an immediate Sobel 3x3.
3.35.1 Detailed Description
The Sobel Image Filter Kernel. This kernel produces two output planes (one can be omitted) in the x and y plane.The Sobel Operators Gx,Gy are defined as:
Gx =
∣∣∣∣∣∣−1 0 +1−2 0 +2−1 0 +1
∣∣∣∣∣∣ ,Gy =
∣∣∣∣∣∣−1 −2 −10 0 0+1 +2 +1
∣∣∣∣∣∣3.35.2 Function Documentation
vx node vxSobel3x3Node ( vx graph graph, vx image input, vx image output x, vx image output y )
[Graph] Create a Sobel3x3 node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out output x [optional] The output gradient in the x direction in FOURCC S16.out output y [optional] The output gradient in the y direction in FOURCC S16.
See Also
VX KERNEL SOBEL 3x3
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuSobel3x3 ( vx image input, vx image output x, vx image output y )
[Immediate] Invokes an immediate Sobel 3x3.Parameters
in input The input image in FOURCC U8 format.out output x [optional] The output gradient in the x direction in FOURCC S16.out output y [optional] The output gradient in the y direction in FOURCC S16.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 164
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 165
3.36 Kernel: Magnitude
The Gradient Magnitude Computation Kernel.
Functions
• vx node vxMagnitudeNode (vx graph graph, vx image grad x, vx image grad y, vx image mag)
[Graph] Create a Magnitude node.
• vx status vxuMagnitude (vx image grad x, vx image grad y, vx image output)
[Immediate] Invokes an immediate Magnitude.
3.36.1 Detailed Description
The Gradient Magnitude Computation Kernel. This kernel takes two gradients in FOURCC S16 format and com-putes the FOURCC U8 normalized magnitude. Magnitude is computed as:
mag(x,y) =√
gradx(x,y)2 +grady(x,y)2
3.36.2 Function Documentation
vx node vxMagnitudeNode ( vx graph graph, vx image grad x, vx image grad y, vx image mag )
[Graph] Create a Magnitude node.Parameters
in graph The reference to the graph.in grad x The input x image. This should be in FOURCC S16 format.in grad y The input y image. This should be in FOURCC S16 format.out mag The magnitude image. This will be in FOURCC U8 format.
See Also
VX KERNEL MAGNITUDE
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuMagnitude ( vx image grad x, vx image grad y, vx image output )
[Immediate] Invokes an immediate Magnitude.Parameters
in grad x The input x image. This should be in FOURCC S16 format.in grad y The input y image. This should be in FOURCC S16 format.out output The magnitude image. This will be in FOURCC U8 format.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 166
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 167
3.37 Kernel: Phase
The Gradient Phase Computation Kernel.
Functions
• vx node vxPhaseNode (vx graph graph, vx image grad x, vx image grad y, vx image orientation)
[Graph] Create a Magnitude node.
• vx status vxuPhase (vx image grad x, vx image grad y, vx image output)
[Immediate] Invokes an immediate Phase.
3.37.1 Detailed Description
The Gradient Phase Computation Kernel. This kernel takes two gradients in FOURCC S16 format and computesthe angles for each pixel and store this in a FOURCC U8 image.
φ = tan−1 grady(x,y)gradx(x,y)
Where φ is then translated to 0≤ φ ≤ τ . Each φ value is then mapped to the range 0 to 255 inclusive.
3.37.2 Function Documentation
vx node vxPhaseNode ( vx graph graph, vx image grad x, vx image grad y, vx image orientation )
[Graph] Create a Magnitude node.Parameters
in graph The reference to the graph.in grad x The input x image. This should be in FOURCC S16 format.in grad y The input y image. This should be in FOURCC S16 format.out orientation The phase image. This will be in FOURCC U8 format.
See Also
VX KERNEL PHASE
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuPhase ( vx image grad x, vx image grad y, vx image output )
[Immediate] Invokes an immediate Phase.Parameters
in grad x The input x image. This should be in FOURCC S16 format.in grad y The input y image. This should be in FOURCC S16 format.out output The phase image. This will be in FOURCC U8 format.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 168
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 169
3.38 Kernel: Scale Image
The Image Resizing Kernel.
Functions
• vx node vxScaleImageNode (vx graph graph, vx image src, vx image dst, vx enum type)
[Graph] Create a Scale Image Node.
• vx status vxuHalfScaleGaussian3x3 (vx image input, vx image output)
[Immediate] Performs a Gaussian Blur (3x3) on an image then half-scales it.
• vx status vxuScaleImage (vx image src, vx image dst, vx enum type)
[Immediate] Scales an input image to an output image.
3.38.1 Detailed Description
The Image Resizing Kernel. This kernel resizes an image from the source to the destination dimensions. The onlyformat supported is FOURCC U8. The supported interpolation types are currently:
• VX INTERPOLATION TYPE NEAREST NEIGHBOR
• VX INTERPOLATION TYPE AREA
• VX INTERPOLATION TYPE BILINEAR
The sample positions used to determine output pixel values are generated by scaling the outside edges of thesource image pixels to the outside edges of the destination image pixels. As described in the documentation forvx interpolation type e, samples are taken at pixel centers. This means that, unless the scale is 1:1, thesample position for the top left destination pixel typically does not fall exactly on the top left source pixel, but will begenerated by interpolation.
3.38.2 Function Documentation
vx node vxScaleImageNode ( vx graph graph, vx image src, vx image dst, vx enum type )
[Graph] Create a Scale Image Node.Parameters
in graph The reference to the graph.in src The source image.out dst The destination image.in type The interpolation type to use.
See Also
vx interpolation type e.
Note
The destination image must have a defined size and format.
Returns
vx node
Return values
CHAPTER 3. MODULE DOCUMENTATION 170
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
vx status vxuHalfScaleGaussian3x3 ( vx image input, vx image output )
[Immediate] Performs a Gaussian Blur (3x3) on an image then half-scales it.The output image size is determined by:
Wout put =Winput +1
2Hout put =
Hinput +12
Parameters
in input The input FOURCC U8 image.out output The output FOURCC U8 image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
vx status vxuScaleImage ( vx image src, vx image dst, vx enum type )
[Immediate] Scales an input image to an output image.Parameters
in src The source image.out dst The destintation image.in type The interpolation type.
See Also
vx interpolation type e.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 171
3.39 Kernel: TableLookup
The Table Lookup Image Kernel.
Functions
• vx node vxTableLookupNode (vx graph graph, vx image input, vx lut lut, vx image output)
[Graph] Creates a Table Lookup node.
• vx status vxuTableLookup (vx image input, vx lut lut, vx image output)
[Immediate] Processes the image through the LUT.
3.39.1 Detailed Description
The Table Lookup Image Kernel. This kernel uses each pixel in an image to index into a LUT and put the indexedLUT value into the output image. The format supported is FOURCC U8 or FOURCC U16
3.39.2 Function Documentation
vx node vxTableLookupNode ( vx graph graph, vx image input, vx lut lut, vx image output )
[Graph] Creates a Table Lookup node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8.in lut The LUT which is of type VX TYPE UINT8.out output The output image of type FOURCC U8.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuTableLookup ( vx image input, vx lut lut, vx image output )
[Immediate] Processes the image through the LUT.Parameters
in input The input image in FOURCC U8.in lut The LUT which is of type VX TYPE UINT8, or VX TYPE UINT16.out output The output image of type FOURCC U8.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 172
3.40 Kernel: Histogram
Generates a distribution from an image.
Functions
• vx node vxHistogramNode (vx graph graph, vx image input, vx distribution distribution)
[Graph] Creates a Histogram node.
• vx status vxuHistogram (vx image input, vx distribution distribution)
[Immediate] Generates a distribution from an image.
3.40.1 Detailed Description
Generates a distribution from an image. This kernel counts the number of occurrences of each pixel value withinthe window size of a pre-calculated number of bins.
3.40.2 Function Documentation
vx node vxHistogramNode ( vx graph graph, vx image input, vx distribution distribution )
[Graph] Creates a Histogram node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8.out distribution The output distribution.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuHistogram ( vx image input, vx distribution distribution )
[Immediate] Generates a distribution from an image.Parameters
in input The input image in FOURCC U8.out distribution The output distribution.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 173
3.41 Kernel: Equalize Histogram
Equalizes the histogram of a grayscale image.
Functions
• vx node vxEqualizeHistNode (vx graph graph, vx image input, vx image output)
[Graph] Creates a Histogram Equalization node.
• vx status vxuEqualizeHist (vx image input, vx image output)
[Immediate] Equalizes the Histogram of a grayscale image.
3.41.1 Detailed Description
Equalizes the histogram of a grayscale image. This kernel modifies the values of a grayscale image so that it willautomatically have a standardized brightness and contrast, using Histogram Equalization.
3.41.2 Function Documentation
vx node vxEqualizeHistNode ( vx graph graph, vx image input, vx image output )
[Graph] Creates a Histogram Equalization node.Parameters
in graph The reference to the graph.in input The grayscale input image in FOURCC U8.out output The grayscale output image of type FOURCC U8 with equalized brightness
and contrast.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuEqualizeHist ( vx image input, vx image output )
[Immediate] Equalizes the Histogram of a grayscale image.Parameters
in input The grayscale input image in FOURCC U8.out output The grayscale output image of type FOURCC U8 with equalized brightness
and contrast.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 174
3.42 Kernel: Absolute Difference
Computes the absolute difference between two images.
Functions
• vx node vxAbsDiffNode (vx graph graph, vx image in1, vx image in2, vx image out)
[Graph] Creates an AbsDiff node.
• vx status vxuAbsDiff (vx image in1, vx image in2, vx image out)
[Immediate] Computes the absolute difference between two images.
3.42.1 Detailed Description
Computes the absolute difference between two images. Absolute Difference is computed by:
out(x,y) = |in1(x,y)− in2(x,y)|
3.42.2 Function Documentation
vx node vxAbsDiffNode ( vx graph graph, vx image in1, vx image in2, vx image out )
[Graph] Creates an AbsDiff node.Parameters
in graph The reference to the graph.in in1 An input imagein in2 An input imageout out The output image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuAbsDiff ( vx image in1, vx image in2, vx image out )
[Immediate] Computes the absolute difference between two images.Parameters
in in1 An input imagein in2 An input imageout out The output image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 175
3.43 Kernel: Mean and Standard Deviation.
Computes the mean pixel value and the standard deviation of the pixels in the input image (which has a dimensionwidth and height).
Functions
• vx node vxMeanStdDevNode (vx graph graph, vx image input, vx scalar mean, vx scalar stddev)
[Graph] Creates a mean value and standard deviation node.
• vx status vxuMeanStdDev (vx image input, vx float32 ∗mean, vx float32 ∗stddev)
[Immediate] Computes the mean value and standard deviation.
3.43.1 Detailed Description
Computes the mean pixel value and the standard deviation of the pixels in the input image (which has a dimensionwidth and height). The mean value is computed as
µ =
(∑
hy=0 ∑
wx=0 src(x,y)
)(width×height)
The standard deviation is computed as
σ =
√√√√(∑hy=0 ∑
wx=0(µ− src(x,y))2
)(width×height)
3.43.2 Function Documentation
vx node vxMeanStdDevNode ( vx graph graph, vx image input, vx scalar mean, vx scalar stddev )
[Graph] Creates a mean value and standard deviation node.Parameters
in graph The reference to the graph.in input The input image.out mean The VX TYPE FLOAT32 average pixel value.out stddev The VX TYPE FLOAT32 standard deviation of the pixel values.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuMeanStdDev ( vx image input, vx float32 ∗ mean, vx float32 ∗ stddev )
[Immediate] Computes the mean value and standard deviation.Parameters
in input The input image.out mean The average pixel value.out stddev The standard deviation of the pixel values.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 176
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 177
3.44 Kernel: Thresholding
Thresholds an input image and produces an output boolean image.
Functions
• vx node vxThresholdNode (vx graph graph, vx image input, vx threshold thresh, vx image output)
[Graph] Creates a Threshold node.
• vx status vxuThreshold (vx image input, vx threshold thresh, vx image output)
[Immediate] Threshold’s an input image and produces a FOURCC U8 boolean image.
3.44.1 Detailed Description
Thresholds an input image and produces an output boolean image. In VX THRESHOLD TYPE BINARY, the outputis determined by
dst(x,y) =
{255 if src(x,y)> threshold0 otherwise
In VX THRESHOLD TYPE RANGE, the output is determined by:
dst(x,y) =
0 if src(x,y)> upper0 if src(x,y)< lower255 otherwise
3.44.2 Function Documentation
vx node vxThresholdNode ( vx graph graph, vx image input, vx threshold thresh, vx image output )
[Graph] Creates a Threshold node.Parameters
in graph The reference to the graph.in input The input image. FOURCC U8 is supported.in thresh The thresholding object which defines the parameters of the operation.out output The output boolean image. Values are either 0 or 255.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuThreshold ( vx image input, vx threshold thresh, vx image output )
[Immediate] Threshold’s an input image and produces a FOURCC U8 boolean image.Parameters
in input The input image. FOURCC U8 is supported.in thresh The thresholding object which defines the parameters of the operation.out output The output boolean image. Values are either 0 or 255.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 178
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 179
3.45 Kernel: Integral Image
Computes the integral image of the input.
Functions
• vx node vxIntegralImageNode (vx graph graph, vx image input, vx image output)
[Graph] Creates an Integral Image Node.
• vx status vxuIntegralImage (vx image input, vx image output)
[Immediate] Computes the integral image of the input.
3.45.1 Detailed Description
Computes the integral image of the input. Each output pixel is the sum of all pixels above and to the left of itself.
dst(x,y) = sum(x,y) = src(x,y)+ sum(x−1,y)+ sum(x,y−1)− sum(x−1,y−1)
3.45.2 Function Documentation
vx node vxIntegralImageNode ( vx graph graph, vx image input, vx image output )
[Graph] Creates an Integral Image Node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out output The output image in FOURCC U32 format.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuIntegralImage ( vx image input, vx image output )
[Immediate] Computes the integral image of the input.Parameters
in input The input image in FOURCC U8 format.out output The output image in FOURCC U32 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 180
3.46 Kernel: Erode Image
Erosion ”shrinks” the white space in a FOURCC U8 ”bool” image.
Functions
• vx node vxErode3x3Node (vx graph graph, vx image input, vx image output)
[Graph] Creates an Erosion Image Node.
• vx status vxuErode3x3 (vx image input, vx image output)
[Immediate] Erodes an image by a 3x3 window.
3.46.1 Detailed Description
Erosion ”shrinks” the white space in a FOURCC U8 ”bool” image. This kernel uses a 3x3 box around the outputpixel used to determine value.
dst(x,y) = minx−1≤ x′ ≤ x+1y−1≤ y′ ≤ y+1
src(x′,y′)
3.46.2 Function Documentation
vx node vxErode3x3Node ( vx graph graph, vx image input, vx image output )
[Graph] Creates an Erosion Image Node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuErode3x3 ( vx image input, vx image output )
[Immediate] Erodes an image by a 3x3 window.Parameters
in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 181
3.47 Kernel: Dilate Image
Dilation ”grows” the white space in a FOURCC U8 ”bool” image.
Functions
• vx node vxDilate3x3Node (vx graph graph, vx image input, vx image output)
[Graph] Creates an Dilation Image Node.
• vx status vxuDilate3x3 (vx image input, vx image output)
[Immediate] Dilates an image by a 3x3 window.
3.47.1 Detailed Description
Dilation ”grows” the white space in a FOURCC U8 ”bool” image. This kernel uses a 3x3 box around the output pixelused to determine value.
dst(x,y) = maxx−1≤ x′ ≤ x+1y−1≤ y′ ≤ y+1
src(x′,y′)
3.47.2 Function Documentation
vx node vxDilate3x3Node ( vx graph graph, vx image input, vx image output )
[Graph] Creates an Dilation Image Node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuDilate3x3 ( vx image input, vx image output )
[Immediate] Dilates an image by a 3x3 window.Parameters
in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 182
3.48 Kernel: Median Filter
Compute a median pixel value over a window of the input image.
Functions
• vx node vxMedian3x3Node (vx graph graph, vx image input, vx image output)
[Graph] Creates a Median Image Node.
• vx status vxuMedian3x3 (vx image input, vx image output)
[Immediate] Computes a median filter on the image by a 3x3 window.
3.48.1 Detailed Description
Compute a median pixel value over a window of the input image. The median is the middle value over an oddnumbered sorted range of values.
3.48.2 Function Documentation
vx node vxMedian3x3Node ( vx graph graph, vx image input, vx image output )
[Graph] Creates a Median Image Node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuMedian3x3 ( vx image input, vx image output )
[Immediate] Computes a median filter on the image by a 3x3 window.Parameters
in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 183
3.49 Kernel: Box Filter
Compute a Box filter over a window of the input image.
Functions
• vx node vxBox3x3Node (vx graph graph, vx image input, vx image output)
[Graph] Creates a Box Filter Node.
• vx status vxuBox3x3 (vx image input, vx image output)
[Immediate] Computes a box filter on the image by a 3x3 window.
3.49.1 Detailed Description
Compute a Box filter over a window of the input image. This filter uses the follow convolution matrix:
Kbox =
∣∣∣∣∣∣1 1 11 1 11 1 1
∣∣∣∣∣∣× 19
3.49.2 Function Documentation
vx node vxBox3x3Node ( vx graph graph, vx image input, vx image output )
[Graph] Creates a Box Filter Node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuBox3x3 ( vx image input, vx image output )
[Immediate] Computes a box filter on the image by a 3x3 window.Parameters
in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 184
3.50 Kernel: Gaussian Filter
Computes a Gaussian filter over a window of the input image.
Functions
• vx node vxGaussian3x3Node (vx graph graph, vx image input, vx image output)
[Graph] Creates a Gaussian Filter Node.
• vx status vxuGaussian3x3 (vx image input, vx image output)
[Immediate] Computes a gaussian filter on the image by a 3x3 window.
3.50.1 Detailed Description
Computes a Gaussian filter over a window of the input image. This filter uses the follow convolution matrix:
Kgaussian =
∣∣∣∣∣∣1 2 12 4 21 2 1
∣∣∣∣∣∣× 116
3.50.2 Function Documentation
vx node vxGaussian3x3Node ( vx graph graph, vx image input, vx image output )
[Graph] Creates a Gaussian Filter Node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
vx status vxuGaussian3x3 ( vx image input, vx image output )
[Immediate] Computes a gaussian filter on the image by a 3x3 window.Parameters
in input The input image in FOURCC U8 format.out output The output image in FOURCC U8 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 185
3.51 Kernel: Custom Convolution
Convolves the input with the user supplied convolution matrix.
Functions
• vx node vxConvolveNode (vx graph graph, vx image input, vx convolution conv, vx image output)
[Graph] Creates a custom convolution node.
• vx status vxuConvolve (vx image input, vx convolution matrix, vx image output)
[Immediate] Computes a convolution on the input image with the supplied matrix.
3.51.1 Detailed Description
Convolves the input with the user supplied convolution matrix. The user can supply a vx int16 typed convolutionmatrix Cm,n. Outputs will be in the FOURCC S16 format unless a FOURCC U8 image is explicitly provided. If valueswould have been out of range of U8, the values are clamped to 0 or 255.
k0 =m2+1 (3.1)
l0 =n2+1 (3.2)
sum =k=m,l=n
∑k=0,l=0
input(x+ k− k0,y+ l− l0)∗Ck,l (3.3)
This translates into the ”C” declaration:
// A horizontal Scharr gradient operatorvx int16 gx[3][3] = {
{ 3, 0, -3},{ 10, 0,-10},{ 3, 0, -3},
};vx convolution scharr x = vxCreateConvolution(context, 3, 3);vxSetConvolutionCoefficients(scharr x, gx);
For FOURCC U8 output, an additional step is taken:
out put(x,y) =
0 if sum < 0255 if sum/scale > 255sum/scale otherwise
For FOURCC S16 output, the summation is simply set to the output
out put(x,y) = sum/scale
3.51.2 Function Documentation
vx node vxConvolveNode ( vx graph graph, vx image input, vx convolution conv, vx image output )
[Graph] Creates a custom convolution node.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.in conv The vx int16 convolution matrix.out output The output image in FOURCC S16 format.
Returns
vx node
CHAPTER 3. MODULE DOCUMENTATION 186
Return values
0 Node could not be created.∗ Node Handle
vx status vxuConvolve ( vx image input, vx convolution matrix, vx image output )
[Immediate] Computes a convolution on the input image with the supplied matrix.Parameters
in input The input image in FOURCC U8 format.in matrix The convolution matrix.out output The output image in FOURCC S16 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 187
3.52 Kernel: Image Pyramid
Computes a Gaussian and/or Laplacian filter over each step or level of the pyramid then scales it.
Functions
• vx node vxPyramidNode (vx graph graph, vx image input, vx pyramid gaussian, vx pyramid laplacian)
[Graph] Creates a pyramid node for both a gaussian pyramid and/or a laplacian pyramid.
• vx status vxuPyramid (vx image input, vx pyramid gaussian, vx pyramid laplacian)
[Immediate] Computes a gaussian and/or laplacian pyramid.
3.52.1 Detailed Description
Computes a Gaussian and/or Laplacian filter over each step or level of the pyramid then scales it. This uses theKernel: Gaussian Filter on the gaussian pyramid. Level 0 is always equivalent to the input image. The pyramidsmust be configured with one of the following level scaling:
• VX SCALE PYRAMID DOUBLE
• VX SCALE PYRAMID HALF
• VX SCALE PYRAMID ORB
3.52.2 Function Documentation
vx node vxPyramidNode ( vx graph graph, vx image input, vx pyramid gaussian, vx pyramid laplacian )
[Graph] Creates a pyramid node for both a gaussian pyramid and/or a laplacian pyramid.This function creates the gaussian and laplacian pyramids from the input image using the particular 5x5 Gaus-
sian Kernel:
G = 1/256∗
∣∣∣∣∣∣∣∣∣∣1 4 6 4 14 16 24 16 46 24 36 24 64 16 24 16 41 4 6 4 1
∣∣∣∣∣∣∣∣∣∣Note that both gaussian and laplacian are optional. However, if both are specified, they must have the same scaleand images sizes. If both are specified, the number of levels can be different.Parameters
in graph The reference to the graph.in input The input image in FOURCC U8 format.out gaussian [optional] The gaussian pyramid to construct. Level zero of gaussian is the
same as the input image. If scale < 1, then Level N of gaussian is created byfiltering level N-1 with the Gaussian Kernel G and then downsampling using V-X INTERPOLATION TYPE BILINEAR. If scale > 1, then Level N of gaussianis created by upsampling level N-1 and filtering with the Gaussian Kernel G.
out laplacian [optional] The laplacian pyramid to construct. Level N of laplacian is createdby upsampling level N+1 of gaussian, filtering with the Gaussian Kernel G andsubtracting the result from level N of gaussian. Level N of gaussian can bereconstructed by upsampling level N+1 of gaussian, filtering with the GaussianKernel G and adding Level N of laplacian.
Object: Pyramid
Returns
vx node
CHAPTER 3. MODULE DOCUMENTATION 188
Return values
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
vx status vxuPyramid ( vx image input, vx pyramid gaussian, vx pyramid laplacian )
[Immediate] Computes a gaussian and/or laplacian pyramid.Parameters
in input The input image in FOURCC U8.out gaussian [optional] The gaussian pyramid to construct. Level zero of gaussian is the
same as the input image. If scale < 1, then Level N of gaussian is created byfiltering level N-1 with the Gaussian Kernel G and then downsampling using V-X INTERPOLATION TYPE BILINEAR. If scale > 1, then Level N of gaussianis created by upsampling level N-1 and filtering with the Gaussian Kernel G.
out laplacian [optional] The laplacian pyramid to construct. Level N of laplacian is createdby upsampling level N+1 of gaussian, filtering with the Gaussian Kernel G andsubtracting the result from level N of gaussian. Level N of gaussian can bereconstructed by upsampling level N+1 of gaussian, filtering with the GaussianKernel G and adding Level N of laplacian.
•
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 189
3.53 Kernel: Accumulate
Accumulates an input image into output image.
Functions
• vx node vxAccumulateImageNode (vx graph graph, vx image input, vx image accum)
[Graph] Creates an accumulate node.
• vx status vxuAccumulateImage (vx image input, vx image accum)
[Immediate] Creates an accumulate node.
3.53.1 Detailed Description
Accumulates an input image into output image. Accumulation is computed by:
accum(x,y) = accum(x,y)+ input(x,y)
3.53.2 Function Documentation
vx node vxAccumulateImageNode ( vx graph graph, vx image input, vx image accum )
[Graph] Creates an accumulate node.Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.
in,out accum The accumulation image in FOURCC U16.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuAccumulateImage ( vx image input, vx image accum )
[Immediate] Creates an accumulate node.Parameters
in input The input FOURCC U8 image.in,out accum The accumulation image in FOURCC U16.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 190
3.54 Kernel: Accumulate Weighted
Accumulates a weighted value from an input image to an output image.
Functions
• vx node vxAccumulateWeightedImageNode (vx graph graph, vx image input, vx scalar alpha, vx image ac-cum)
[Graph] Creates a weighted accumulate node.
• vx status vxuAccumulateWeightedImage (vx image input, vx float32 alpha, vx image accum)
[Immediate] Creates a weighted accumulate node.
3.54.1 Detailed Description
Accumulates a weighted value from an input image to an output image. Weighted accumulation is computed by:
accum(x,y) = (1−α)∗accum(x,y)+α ∗ input(x,y)
Where 0≤ α ≤ 1
3.54.2 Function Documentation
vx node vxAccumulateWeightedImageNode ( vx graph graph, vx image input, vx scalar alpha, vx imageaccum )
[Graph] Creates a weighted accumulate node.Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.in alpha The alpha value. Must be a VX TYPE FLOAT32.
in,out accum The accumulation image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
vx status vxuAccumulateWeightedImage ( vx image input, vx float32 alpha, vx image accum )
[Immediate] Creates a weighted accumulate node.Parameters
in input The input FOURCC U8 image.in alpha The alpha value. Must be between 0 and 1 exclusive.
in,out accum The accumulation image.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 191
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 192
3.55 Kernel: Accumulate Squared
Accumulates a squared value from an input image to an output image.
Functions
• vx node vxAccumulateSquareImageNode (vx graph graph, vx image input, vx image accum)
[Graph] Creates an accumulate square node.
• vx status vxuAccumulateSquareImage (vx image input, vx image accum)
[Immediate] Creates an accumulate square node.
3.55.1 Detailed Description
Accumulates a squared value from an input image to an output image. Accumulate squares is computed by:
accum(x,y) = accum(x,y)+ scale∗ input(x,y)2
Where 0≤ scale
3.55.2 Function Documentation
vx node vxAccumulateSquareImageNode ( vx graph graph, vx image input, vx image accum )
[Graph] Creates an accumulate square node.Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.
in,out accum The accumulation image in FOURCC U16.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuAccumulateSquareImage ( vx image input, vx image accum )
[Immediate] Creates an accumulate square node.Parameters
in input The input FOURCC U8 image.in,out accum The accumulation image in FOURCC U16.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 193
3.56 Kernel: Min, Max Location
Finds the minimum and maximum values in an image and a location for each.
Functions
• vx node vxMinMaxLocNode (vx graph graph, vx image input, vx scalar minVal, vx scalar maxVal, vx -coordinates minLoc, vx coordinates maxLoc)
[Graph] Creates a min,max,loc node.
• vx status vxuMinMaxLoc (vx image input, vx scalar minVal, vx scalar maxVal, vx coordinates minLoc, vx -coordinates maxLoc)
[Immediate] Computes the minimum and maximum values of the image.
3.56.1 Detailed Description
Finds the minimum and maximum values in an image and a location for each. The locations are not guaranteed tobe found in any particular scanning method.
minVal = min0≤ x′ ≤ width0≤ y′ ≤ height
src(x′,y′)
maxVal = max0≤ x′ ≤ width0≤ y′ ≤ height
src(x′,y′)
3.56.2 Function Documentation
vx node vxMinMaxLocNode ( vx graph graph, vx image input, vx scalar minVal, vx scalar maxVal,vx coordinates minLoc, vx coordinates maxLoc )
[Graph] Creates a min,max,loc node.Parameters
in graph The reference to create the graph.in input The input image in FOURCC U8, FOURCC U16, FOURCC S16, FOURCC -
U32, or FOURCC S32 format.out minVal The minimum value in the image.out maxVal The maximum value in the image.out minLoc The location of the first minimum value.out maxLoc The locaiton of the first maximum value.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuMinMaxLoc ( vx image input, vx scalar minVal, vx scalar maxVal, vx coordinates minLoc,vx coordinates maxLoc )
[Immediate] Computes the minimum and maximum values of the image.
CHAPTER 3. MODULE DOCUMENTATION 194
Parameters
in input The input image in FOURCC U8, FOURCC U16, FOURCC S16, FOURCC -U32, or FOURCC S32 format.
out minVal The minimum value in the image.out maxVal The maximum value in the image.out minLoc The location of the first minimum value.out maxLoc The locaiton of the first maximum value.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 195
3.57 Kernel: Bitwise And
Performs bitwise ”and” between two FOURCC U8 images.
Functions
• vx node vxAndNode (vx graph graph, vx image in1, vx image in2, vx image out)
[Graph] Creates a bitwise-and node.
• vx status vxuAnd (vx image in1, vx image in2, vx image out)
[Immediate] Computes the bitwise and between two images.
3.57.1 Detailed Description
Performs bitwise ”and” between two FOURCC U8 images. Bitwise ”and” is computed by, for each bit in each pixelin the input images:
out(x,y) = in1(x,y)∧ in2(x,y)
Or expressed as ”C” code:
out(x,y) = in 1(x,y) & in 2(x,y)
3.57.2 Function Documentation
vx node vxAndNode ( vx graph graph, vx image in1, vx image in2, vx image out )
[Graph] Creates a bitwise-and node.Parameters
in graph The reference to the graph.in in1 A FOURCC U8 input imagein in2 A FOURCC U8 input imageout out The FOURCC U8 output image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuAnd ( vx image in1, vx image in2, vx image out )
[Immediate] Computes the bitwise and between two images.Parameters
in in1 A FOURCC U8 input imagein in2 A FOURCC U8 input imageout out The FOURCC U8 output image.
Returns
A vx status e enumeration.
Return values
CHAPTER 3. MODULE DOCUMENTATION 196
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 197
3.58 Kernel: Bitwise Inclusive Or
Performs bitwise ”inclusive or” between two FOURCC U8 images.
Functions
• vx node vxOrNode (vx graph graph, vx image in1, vx image in2, vx image out)
[Graph] Creates a bitwise inclusive-or node.
• vx status vxuOr (vx image in1, vx image in2, vx image out)
[Immediate] Computes the bitwise inclusive-or between two images.
3.58.1 Detailed Description
Performs bitwise ”inclusive or” between two FOURCC U8 images. Bitwise ”inclusive or” is computed by, for each bitin each pixel in the input images:
out(x,y) = in1(x,y)∨ in2(x,y)
Or expressed as ”C” code:
out(x,y) = in 1(x,y) | in 2(x,y)
3.58.2 Function Documentation
vx node vxOrNode ( vx graph graph, vx image in1, vx image in2, vx image out )
[Graph] Creates a bitwise inclusive-or node.Parameters
in graph The reference to the graph.in in1 A FOURCC U8 input imagein in2 A FOURCC U8 input imageout out The FOURCC U8 output image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuOr ( vx image in1, vx image in2, vx image out )
[Immediate] Computes the bitwise inclusive-or between two images.Parameters
in in1 A FOURCC U8 input imagein in2 A FOURCC U8 input imageout out The FOURCC U8 output image.
Returns
A vx status e enumeration.
Return values
CHAPTER 3. MODULE DOCUMENTATION 198
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 199
3.59 Kernel: Bitwise Exclusive Or
Performs bitwise ”exclusive or” between two FOURCC U8 images.
Functions
• vx status vxuXor (vx image in1, vx image in2, vx image out)
[Immediate] Computes the bitwise exclusive-or between two images.
• vx node vxXorNode (vx graph graph, vx image in1, vx image in2, vx image out)
[Graph] Creates a bitwise exclusive-or node.
3.59.1 Detailed Description
Performs bitwise ”exclusive or” between two FOURCC U8 images. Bitwise ”exclusive or” is computed by, for eachbit in each pixel in the input images:
out(x,y) = in1(x,y)⊕ in2(x,y)
Or expressed as ”C” code:
out(x,y) = in 1(x,y) ˆ in 2(x,y)
3.59.2 Function Documentation
vx status vxuXor ( vx image in1, vx image in2, vx image out )
[Immediate] Computes the bitwise exclusive-or between two images.Parameters
in in1 A FOURCC U8 input imagein in2 A FOURCC U8 input imageout out The FOURCC U8 output image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
vx node vxXorNode ( vx graph graph, vx image in1, vx image in2, vx image out )
[Graph] Creates a bitwise exclusive-or node.Parameters
in graph The reference to the graph.in in1 A FOURCC U8 input imagein in2 A FOURCC U8 input imageout out The FOURCC U8 output image.
Returns
vx node
Return values
CHAPTER 3. MODULE DOCUMENTATION 200
0 Node could not be created.∗ Node Handle
CHAPTER 3. MODULE DOCUMENTATION 201
3.60 Kernel: Bitwise Not
Performs bitwise ”not” on a FOURCC U8 input image.
Functions
• vx node vxNotNode (vx graph graph, vx image input, vx image output)
[Graph] Creates a bitwise-not node.
• vx status vxuNot (vx image input, vx image output)
[Immediate] Computes the bitwise not of an image.
3.60.1 Detailed Description
Performs bitwise ”not” on a FOURCC U8 input image. Bitwise ”not” is computed by, for each bit in each pixel in theinput image:
out(x,y) =∼ in(x,y)
3.60.2 Function Documentation
vx node vxNotNode ( vx graph graph, vx image input, vx image output )
[Graph] Creates a bitwise-not node.Parameters
in graph The reference to the graph.in input A FOURCC U8 input imageout output The FOURCC U8 output image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuNot ( vx image input, vx image output )
[Immediate] Computes the bitwise not of an image.Parameters
in input The FOURCC U8 input imageout output The FOURCC U8 output image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 202
3.61 Kernel: Pixel-wise Multiplication
Performs element-wise multiplication between two images and a scalar value.
Functions
• vx node vxMultiplyNode (vx graph graph, vx image in1, vx image in2, vx scalar scale, vx enum policy, vx -image out)
[Graph] Creates an pixelwise-multiplication node.
• vx status vxuMultiply (vx image in1, vx image in2, vx float32 scale, vx enum policy, vx image out)
[Immediate] Performs elementwise multiplications on pixel values in the input images and a scale.
3.61.1 Detailed Description
Performs element-wise multiplication between two images and a scalar value. Pixel-wise multiplication is performedbetween the pixel values in two FOURCC U8 or FOURCC S16 images and a scalar floating-point number “scale”.The output image can be FOURCC U8 only if both source images are FOURCC U8 and the output image is explicitlyset to FOURCC U8. It is otherwise FOURCC S16. If one of the input images is of type FOURCC S16, all valuesare converted to FOURCC S16. The overflow handling is controlled by an overflow-policy parameter. For each pixelvalue in the two input images:
out(x,y) = in1(x,y)∗ in2(x,y)∗ scale
3.61.2 Function Documentation
vx node vxMultiplyNode ( vx graph graph, vx image in1, vx image in2, vx scalar scale, vx enum policy,vx image out )
[Graph] Creates an pixelwise-multiplication node.Parameters
in graph The reference to the graph.in in1 An input image, FOURCC U8 or FOURCC S16.in in2 An input image, FOURCC U8 or FOURCC S16.in scale A non-negative VX TYPE FLOAT32 multiplied to each product before over-
flow handlingin policy A VX TYPE ENUM of the vx convert policy e enumeration.out out The output image, a FOURCC U8 or FOURCC S16 image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuMultiply ( vx image in1, vx image in2, vx float32 scale, vx enum policy, vx image out )
[Immediate] Performs elementwise multiplications on pixel values in the input images and a scale.Parameters
in in1 A FOURCC U8 or FOURCC S16 input image.in in2 A FOURCC U8 or FOURCC S16 input image.
CHAPTER 3. MODULE DOCUMENTATION 203
in scale The scale value.in policy A vx convert policy e enumeration.out out The output image in FOURCC U8 or FOURCC S16 format.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 204
3.62 Kernel: Arithmetic Addition
Performs addition between two images.
Functions
• vx node vxAddNode (vx graph graph, vx image in1, vx image in2, vx enum policy, vx image out)
[Graph] Creates an arithmetic addition node.
• vx status vxuAdd (vx image in1, vx image in2, vx enum policy, vx image out)
[Immediate] Performs arithmetic addition on pixel values in the input images.
3.62.1 Detailed Description
Performs addition between two images. Arithmetic addition is performed between the pixel values in two FOURCC-U8 or FOURCC S16 images. The output image can be FOURCC U8 only if both source images are FOURCC U8
and the output image is explicitly set to FOURCC U8. It is otherwise FOURCC S16. If one of the input imagesis of type FOURCC S16, all values are converted to FOURCC S16. The overflow handling is controlled by anoverflow-policy parameter. For each pixel value in the two input images:
out(x,y) = in1(x,y)+ in2(x,y)
3.62.2 Function Documentation
vx node vxAddNode ( vx graph graph, vx image in1, vx image in2, vx enum policy, vx image out )
[Graph] Creates an arithmetic addition node.Parameters
in graph The reference to the graph.in in1 An input image, FOURCC U8 or FOURCC S16.in in2 An input image, FOURCC U8 or FOURCC S16.in policy A VX TYPE ENUM of the vx convert policy e enumeration.out out The output image, a FOURCC U8 or FOURCC S16 image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuAdd ( vx image in1, vx image in2, vx enum policy, vx image out )
[Immediate] Performs arithmetic addition on pixel values in the input images.Parameters
in in1 A FOURCC U8 or FOURCC S16 input image.in in2 A FOURCC U8 or FOURCC S16 input image.in policy A vx convert policy e enumeration.out out The output image in FOURCC U8 or FOURCC S16 format.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 205
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 206
3.63 Kernel: Arithmetic Subtraction
Performs subtraction between two images.
Functions
• vx node vxSubtractNode (vx graph graph, vx image in1, vx image in2, vx enum policy, vx image out)
[Graph] Creates an arithmetic subtraction node.
• vx status vxuSubtract (vx image in1, vx image in2, vx enum policy, vx image out)
[Immediate] Performs arithmetic subtraction on pixel values in the input images.
3.63.1 Detailed Description
Performs subtraction between two images. Arithmetic subtraction is performed between the pixel values in twoFOURCC U8 or FOURCC S16 images. The output image can be FOURCC U8 only if both source images are F-OURCC U8 and the output image is explicitly set to FOURCC U8. It is otherwise FOURCC S16. If one of the inputimages is of type FOURCC S16, all values are converted to FOURCC S16. The overflow handling is controlled byan overflow-policy parameter. For each pixel value in the two input images:
out(x,y) = in1(x,y)− in2(x,y)
3.63.2 Function Documentation
vx node vxSubtractNode ( vx graph graph, vx image in1, vx image in2, vx enum policy, vx image out )
[Graph] Creates an arithmetic subtraction node.Parameters
in graph The reference to the graph.in in1 An input image, FOURCC U8 or FOURCC S16, the minuend.in in2 An input image, FOURCC U8 or FOURCC S16, the subtrahend.in policy A VX TYPE ENUM of the vx convert policy e enumeration.out out The output image, a FOURCC U8 or FOURCC S16 image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
vx status vxuSubtract ( vx image in1, vx image in2, vx enum policy, vx image out )
[Immediate] Performs arithmetic subtraction on pixel values in the input images.Parameters
in in1 A FOURCC U8 or FOURCC S16 input image, the minuend.in in2 A FOURCC U8 or FOURCC S16 input image, the subtrahend.in policy A vx convert policy e enumeration.out out The output image in FOURCC U8 or FOURCC S16 format.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 207
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 208
3.64 Kernel: Convert Bit depth
Converts image bit depth.
Functions
• vx node vxConvertDepthNode (vx graph graph, vx image input, vx image output, vx enum policy, vx scalarshift)
[Graph] Creates a bit-depth conversion node.
• vx status vxuConvertDepth (vx image input, vx image output, vx enum policy, vx int32 shift)
[Immediate] Converts the input images bit-depth into the output image.
3.64.1 Detailed Description
Converts image bit depth. This kernel converts an image from some source bit-depth to another bit-depth asdescribed by the table below. The columns are output types and rows are input types and the conversion has theAPI version on which it is supported listed (An ’X’ implies an invalid operation).
I/O U8 U16 S16 U32 S32U8 X 1.0U16 X XS16 1.0 X XU32 X XS32 X X
Down-conversions with VX CONVERT POLICY TRUNCATE follow this equation:
output(x,y) = (OUTTYPE)input(x,y) >> shift
Down-conversions with VX CONVERT POLICY SATURATE follow this equation:
INTYPE value = input(x,y) >> shift;value = (value < OUTTYPE MIN ? OUTTYPE MIN : value);value = (value > OUTTYPE MAX ? OUTTYPE MAX : value);output(x,y) = (OUTTYPE)value;
Up-conversions ignore the policy and perform this operation:
output(x,y) = (OUTTYPE)input(x,y) << shift;
3.64.2 Function Documentation
vx node vxConvertDepthNode ( vx graph graph, vx image input, vx image output, vx enum policy,vx scalar shift )
[Graph] Creates a bit-depth conversion node.Parameters
in graph The reference to the graph.in input The input image.out output The output image.in policy A scalar containing a VX TYPE ENUM of the vx convert policy e enumeration.in shift A scalar containing a VX TYPE INT32 of the shift value.
Returns
vx node
Return values
CHAPTER 3. MODULE DOCUMENTATION 209
0 Node could not be created.∗ Node Handle
vx status vxuConvertDepth ( vx image input, vx image output, vx enum policy, vx int32 shift )
[Immediate] Converts the input images bit-depth into the output image.Parameters
in input The input image.out output The output image.in policy A vx convert policy e enumeration.in shift The shift value.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 210
3.65 Kernel: Canny Edge Detector
Canny Edge detection kernel.
Enumerations
• enum vx norm type e {VX NORM L1 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM NORM TYPE << 12)) + 0x0,VX NORM L2 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM NORM TYPE << 12)) + 0x1 }
A normalization type.
Functions
• vx node vxCannyEdgeDetectorNode (vx graph graph, vx image input, vx threshold hyst, vx int32 gradient -size, vx enum norm type, vx image output)
[Graph] Creates a Canny Edge Detection Node.
• vx status vxuCannyEdgeDetector (vx image input, vx threshold hyst, vx int32 gradient size, vx enum norm -type, vx image output)
[Immediate] Computes Canny Edges on the input image into the output image.
3.65.1 Detailed Description
Canny Edge detection kernel. This function implements an edge detection algorithm similar to that described in [2].The main components of the algorithm are
• Gradient magnitude and orientation computation using a noise resistant operator (Sobel)
• Non-maximum suppression of the gradient magnitude, using the gradient orientation information
• Tracing edges in the modified gradient image using hysteresis thresholding to produce a binary result
The details of each of these steps are described below.
• Gradient Computation: Conceptually, the input image is convolved with vertical and horizontal Sobel kernelsof the size indicated by the gradient size parameter. The two resulting directional gradient images ( dx anddy) are then used to compute a gradient magnitude image and a gradient orientation image. The normused to compute the gradient magnitude is indicated by the norm type parameter, so the magnitude may be|dx|+ |dy| for VX NORM L1 or
√dx2 +dy2 for VX NORM L2. The gradient orientation image is quantized
into 4 values: 0, 45, 90, and 135 degrees.
• Non-Maximum Suppression: This is then applied such that a pixel is retained as a potential edge pixel ifan only if its magnitude is greater than the pixels in the direction perpendicular to its edge orientation. Forexample, if the pixel’s orientation is 0 degrees, it is only retained if its gradient magnitude is larger than thatof the pixels at 90 and 270 degrees to it. If a pixel is suppressed via this condition, it must not appear as anedge pixel in the final output, i.e., its value must be 0 in the final output.
• Edge Tracing: The final edge pixels in the output are identified via a double thresholded hysteresis procedure.All retained pixels with magnitude above the ”high: threshold are marked as known edge pixels (valued 255)in the final output image. All pixels with magnitudes below the ”low” threshold must not be marked as edgepixels in the final output. For the pixels in between the thresholds, edges are traced and marked as edges(255) in the output. This can be done by starting at the known edge pixels and moving along the edge usingthe orientation information calculated above until the gradient magnitude falls below the low threshold.
• Caveats: The intermediate results described above are conceptual only, so for example the implementationmay not actually construct the gradient images and non-maximum-suppressed images. Only the final binary(0 or 255 valued) output image must be computed so that it matches the result of a final image constructedas described above.
CHAPTER 3. MODULE DOCUMENTATION 211
3.65.2 Enumeration Type Documentation
enum vx norm type e
A normalization type.
See Also
Kernel: Canny Edge Detector
Enumerator
VX NORM L1 The L1 normalization.
VX NORM L2 The L2 normalization.
Definition at line 1179 of file vx types.h.
3.65.3 Function Documentation
vx node vxCannyEdgeDetectorNode ( vx graph graph, vx image input, vx threshold hyst, vx int32gradient size, vx enum norm type, vx image output )
[Graph] Creates a Canny Edge Detection Node.Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.in hyst The double threshold for hysteresis.in gradient size The size of the Sobel filter window, must support at least 3, 5 and 7.in norm type A flag indicating the norm used to compute the gradient, VX NORM L1 or VX-
NORM L2.out output The output image in FOURCC U8 format with values either 0 or 255.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuCannyEdgeDetector ( vx image input, vx threshold hyst, vx int32 gradient size, vx enumnorm type, vx image output )
[Immediate] Computes Canny Edges on the input image into the output image.Parameters
in input The input FOURCC U8 image.in hyst The double threshold for hysteresis.in gradient size The size of the Sobel filter window, must support at least 3, 5 and 7.in norm type A flag indicating the norm used to compute the gradient, VX NORM L1 or VX-
NORM L2.out output The output image in FOURCC U8 format.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 212
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 213
3.66 Kernel: Warp Affine
Performs an affine transform on an image.
Functions
• vx status vxuWarpAffine (vx image input, vx matrix matrix, vx enum type, vx image output)
[Immediate] Performs an Affine warp on an image.
• vx node vxWarpAffineNode (vx graph graph, vx image input, vx matrix matrix, vx enum type, vx image out-put)
[Graph] Creates a Affine Warp Node.
3.66.1 Detailed Description
Performs an affine transform on an image. This kernel performs an affine transform with a 2x3 Matrix M with thismethod of pixel coordinate translation:
x0 = M1,1 ∗ x+M1,2 ∗ y+M1,3 (3.4)
y0 = M2,1 ∗ x+M2,2 ∗ y+M2,3 (3.5)
out put(x,y) = input(x0,y0) (3.6)
This translates into the ”C” declaration:
// x0 = a * x + b * y + c;// y0 = d * x + e * y + f;vx float32 mat[3][2] = {
{a, d}, // ’x’ coefficients{b, e}, // ’y’ coefficients{c, f}, // ’offsets’
};vx matrix matrix = vxCreateMatrix(context, 2, 3);vxAccessMatrix(matrix, NULL);vxCommitMatrix(matrix, mat);
3.66.2 Function Documentation
vx status vxuWarpAffine ( vx image input, vx matrix matrix, vx enum type, vx image output )
[Immediate] Performs an Affine warp on an image.Parameters
in input The input FOURCC U8 image.in matrix The affine matrix. Must be 2x3 of type VX TYPE FLOAT32.in type The interpolation type from vx interpolation type e.out output The output FOURCC U8 image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
vx node vxWarpAffineNode ( vx graph graph, vx image input, vx matrix matrix, vx enum type, vx imageoutput )
[Graph] Creates a Affine Warp Node.
CHAPTER 3. MODULE DOCUMENTATION 214
Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.in matrix The affine matrix. Must be 2x3 of type VX TYPE FLOAT32.in type The interpolation type from vx interpolation type e.out output The output FOURCC U8 image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
CHAPTER 3. MODULE DOCUMENTATION 215
3.67 Kernel: Warp Perspective
Performs a perspective transform on an image.
Functions
• vx status vxuWarpPerspective (vx image input, vx matrix matrix, vx enum type, vx image output)
[Immediate] Performs an Perspective warp on an image.
• vx node vxWarpPerspectiveNode (vx graph graph, vx image input, vx matrix matrix, vx enum type, vx imageoutput)
[Graph] Creates a Perspective Warp Node.
3.67.1 Detailed Description
Performs a perspective transform on an image. This kernel performs an perspective transform with a 3x3 Matrix Mwith this method of pixel coordinate translation:
x0 = M1,1 ∗ x+M1,2 ∗ y+M1,3 (3.7)
y0 = M2,1 ∗ x+M2,2 ∗ y+M2,3 (3.8)
z0 = M3,1 ∗ x+M3,2 ∗ y+M3,3 (3.9)
out put(x,y) = input(x0z0
,y0z0
) (3.10)
This translates into the ”C” declaration:
// x0 = a * x + b * y + c;// y0 = d * x + e * y + f;// z0 = g * x + h * y + i;vx float32 mat[3][3] = {
{a, d, g}, // ’x’ coefficients{b, e, h}, // ’y’ coefficients{c, f, i}, // ’offsets’
};vx matrix matrix = vxCreateMatrix(context, 3, 3);vxAccessMatrix(matrix, NULL);vxCommitMatrix(matrix, mat);
3.67.2 Function Documentation
vx status vxuWarpPerspective ( vx image input, vx matrix matrix, vx enum type, vx image output )
[Immediate] Performs an Perspective warp on an image.Parameters
in input The input FOURCC U8 image.in matrix The perspective matrix. Must be 3x3 of type VX TYPE FLOAT32.in type The interpolation type from vx interpolation type e.out output The output FOURCC U8 image.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
vx node vxWarpPerspectiveNode ( vx graph graph, vx image input, vx matrix matrix, vx enum type,vx image output )
[Graph] Creates a Perspective Warp Node.
CHAPTER 3. MODULE DOCUMENTATION 216
Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.in matrix The perspective matrix. Must be 3x3 of type VX TYPE FLOAT32.in type The interpolation type from vx interpolation type e.out output The output FOURCC U8 image.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
Referenced by example super resolution().
CHAPTER 3. MODULE DOCUMENTATION 217
3.68 Kernel: Harris Corners
Computes the Harris Corners of an image.
Functions
• vx node vxHarrisCornersNode (vx graph graph, vx image input, vx scalar strength thresh, vx scalar min -distance, vx scalar sensitivity, vx int32 gradient size, vx int32 block size, vx list corners)
[Graph] Creates a Harris Corners Node.
• vx status vxuHarrisCorners (vx image input, vx scalar strength thresh, vx scalar min distance, vx scalar sen-sitivity, vx int32 gradient size, vx int32 block size, vx list corners)
[Immediate] Computes the Harris Corners over an image and produces the list of scored points.
3.68.1 Detailed Description
Computes the Harris Corners of an image. The Harris Corners are computed with several parameters
I = input image (3.11)
Tc = corner strength threshold (3.12)
r = euclidean radius (3.13)
k = sensitivity threshold (3.14)
w = window size (3.15)
b = block size (3.16)
(3.17)
The computation to find the corner values or scores can be summarized as:
Gx = Sobelx(w, I) (3.18)
Gy = Sobely(w, I) (3.19)
A = windowGx,y(x−b/2,y−b/2,x+b/2,y+b/2) (3.20)
trace(A) =A
∑G2x +
A
∑G2y (3.21)
det(A) =A
∑G2x ∗
A
∑G2y−
(A
∑(Gx ∗Gy)
)2
(3.23)
Mc(x,y) = det(A)− k ∗ trace(A)2 (3.24)
Vc(x,y) =
{Mc(x,y) if Mc(x,y)> Tc
0 otherwise(3.25)
where Vc is the thresholded corner value.
Vc is then non-maximally suppressed within the Euclidean distance r and returned as a vx list of vx keypoint objects.
3.68.2 Function Documentation
vx node vxHarrisCornersNode ( vx graph graph, vx image input, vx scalar strength thresh, vx scalarmin distance, vx scalar sensitivity, vx int32 gradient size, vx int32 block size, vx list corners )
[Graph] Creates a Harris Corners Node.
CHAPTER 3. MODULE DOCUMENTATION 218
Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.in strength thresh The minimum threshold which to eliminate Harris Corner scores.in min distance The radial Euclidean distance for non-maximum suppression.in sensitivity The VX TYPE FLOAT32 scalar sensitivity threshold k from the Harris--
Stephens equation.in gradient size The gradient window size to use on the input. The implementation must sup-
port at least 3, 5, and 7.in block size The block window size used to compute the harris corner score. The imple-
mentation must support at least 3, 5, and 7.out corners The list of vx keypoint objects.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuHarrisCorners ( vx image input, vx scalar strength thresh, vx scalar min distance,vx scalar sensitivity, vx int32 gradient size, vx int32 block size, vx list corners )
[Immediate] Computes the Harris Corners over an image and produces the list of scored points.Parameters
in input The input FOURCC U8 image.in strength thresh The minimum threshold which to eliminate Harris Corner scores.in min distance The radial Euclidean distance for non-maximum suppression.in sensitivity The VX TYPE FLOAT32 scalar sensitivity threshold k from the Harris--
Stephens equation.in gradient size The gradient window size to use on the input. The implementation must sup-
port at least 3, 5, and 7.in block size The block window size used to compute the harris corner score. The imple-
mentation must support at least 3, 5, and 7.out corners The list of vx keypoint objects.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 219
3.69 Kernel: Fast Corners
Computes the corners in an image using FAST algorithm.
Functions
• vx node vxFastCornersNode (vx graph graph, vx image input, vx scalar strength thresh, vx bool nonmax -supression, vx list corners)
[Graph] Creates a FAST Corners Node.
• vx status vxuFastCorners (vx image input, vx scalar strength thresh, vx bool nonmax supression, vx list cor-ners)
[Immediate] Computes corners on an image using FAST algorithm and produces the list of feature points.
3.69.1 Detailed Description
Computes the corners in an image using FAST algorithm. The FAST (features from accelerated segment test)algorithm based on the FAST9 algorithm described in [3] and with some updates from[4] . It extracts corners byevaluating pixels on the Bresenham circle around a candidate point. If N contiguous pixels are brighter than thecandidate point by at least a threshold value t or darker by at least t, then the candidate point is considered to be acorner. For each detected corner, its strength is computed. Optionally, a non-maxima suppression step is appliedon all detected corners to remove multiple or spurious responses.
3.69.2 Segment Test Detector
The FAST corner detector uses the pixels on a Bresenham circle of radius 3 (16 pixels) to classify whether acandidate point p is actually a corner.
Given the following definitions:
I = input image (3.26)
p = candidate point position for a corner (3.27)
Ip = image intensity of the candidate point in image I (3.28)
x = pixel on the Bresenham circle around the candidate point p (3.29)
Ix = image intensity of the candidate point (3.30)
t = intensity difference threshold for a corner (3.31)
N = minimum number of contiguous pixel to detect a corner (3.32)
S = set of contiguous pixel on the Bresenham circle around the candidate point (3.33)
Cp = corner response at corner location p (3.34)
The two conditions for FAST corner detection can be expressed as:
• C1: A set of N contiguous pixels S, ∀x in S, Ix > Ip + t
• C2: A set of N contiguous pixels S, ∀x in S, Ix < Ip− t
So when either of these two conditions is met, the candidate p is classified as a corner.In this version of the FAST algorithm, the minimum number of contiguous pixels N is 9 (FAST9).The value of the intensity difference threshold strength thresh of type VX TYPE FLOAT32 must be
within:UINT 8MIN < t <UINT 8MAX
These limits are established due to the input data type FOURCC U8.
Corner Strength Computation Once a corner has been detected, its strength (response, saliency or score) iscomputed. The corner response Cp function is defined as the largest threshold t for which the pixel p remains acorner.
CHAPTER 3. MODULE DOCUMENTATION 220
Non-maximum suppression If the nonmax suppression flag is true, a non-maxima suppression step isapplied on the detected corners. This step is only keeping the corner which has a response greater than the onesof its neighboring corners within the Bresenham circle of radius 3.
See Also
http://www.edwardrosten.com/work/fast.htmlhttp://en.wikipedia.org/wiki/Features from accelerated segment test
3.69.3 Function Documentation
vx node vxFastCornersNode ( vx graph graph, vx image input, vx scalar strength thresh, vx boolnonmax supression, vx list corners )
[Graph] Creates a FAST Corners Node.Parameters
in graph The reference to the graph.in input The input FOURCC U8 image.in strength thresh Threshold on difference between intensity of the central pixel and pixels on
Bresenham’s circle of radius 3 (VX TYPE FLOAT32 scalar)in nonmax -
supressionIf true, non-maximum suppression is applied to detected corners before beingplaces in the vx list of vx keypoint objects.
out corners Output corner vx list of vx keypoint.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuFastCorners ( vx image input, vx scalar strength thresh, vx bool nonmax supression,vx list corners )
[Immediate] Computes corners on an image using FAST algorithm and produces the list of feature points.Parameters
in input The input FOURCC U8 image.in strength thresh Threshold on difference between intensity of the central pixel and pixels on
Bresenham’s circle of radius 3 (VX TYPE FLOAT32 scalar)in nonmax -
supressionIf true, non-maximum suppression is applied to detected corners before beingplaces in the vx list of vx keypoint objects.
out corners Output corner vx list of vx keypoint.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 221
3.70 Kernel: Optical Flow Pyramid (LK)
Computes the optical flow using the Lucas-Kanade method between two pyramid images.
Functions
• vx node vxOpticalFlowPyrLKNode (vx graph graph, vx pyramid old images, vx pyramid new images, vx listold points, vx list new points estimates, vx list new points, vx enum termination, vx scalar epsilon, vx scalarnum iterations, vx scalar use initial estimate, vx size window dimension)
[Graph] Creates a Lucas Kanade Tracking Node.
• vx status vxuOpticalFlowPyrLK (vx pyramid old images, vx pyramid new images, vx list old points, vx listnew points estimates, vx list new points, vx enum termination, vx scalar epsilon, vx scalar num iterations,vx scalar use initial estimate, vx size window dimension)
[Immediate] Computes an optical flow on two images.
3.70.1 Detailed Description
Computes the optical flow using the Lucas-Kanade method between two pyramid images. The function is animplementation of the algorithm described in[1] . The function inputs are two vx pyramid objects, old and new,along with a vx list of vx keypoint objects to track from the old vx pyramid. The function outputs a vx-list of vx keypoint objects that were tracked from the old vx pyramid to the new vx pyramid. Each
element in the vx list of vx keypoint objects in the new list may be valid or not. The implementation shallreturn the same number of vx keypoint objects in the new vx list that were in the older vx list.
In more detail: The Lucas-Kanade method finds the affine motion vector V for each point in the old imagetracking points list, using the following equation:[
VxVy
]=
[∑i Ix
2∑i Ix ∗ Iy
∑i Ix ∗ Iy ∑i Iy2
]−1 [−∑i Ix ∗ It−∑i Iy ∗ It
]Where Ix and Iy are obtained using the Scharr gradients on the input image:
Gx =
+3 0 −3+10 0 −10+3 0 −3
Gy =
+3 +10 +30 0 0−3 −10 −3
It is obtained by a simple difference between the same pixel in both images. i is defined as the adjacent pixels
to the point p(x,y) under consideration. With a given window size of M, i is M2 points. The pixel p(x,y) is centeredin the window. In practice, to get an accurate solution, it is necessary to iterate multiple times on this scheme (in aNewton-Raphson fashion). until the residual of the affine motion vector is smaller than a threshold. And/or maximumnumber of iteration achieved. Each iteration, the estimation of the previous iteration is used. By changing It to bethe difference between the old image and the pixel with the estimated coordinates in the new image. Each iterationthe function check if the pixel to track was lost. The criteria for lost tracking is that the matrix above is invertible. (Thedeterminant of the matrix is less then a threshold : 10−7 ). Or the minimum eigenvalue of the matrix is smaller thena threshold ( 10−4 ). Also lost tracking happen when the point tracked coordinate is outside the image coordinates.When vx true e is given as the input to use initial estimates, the algorithm starts by calculating It asthe difference between the old image and the pixel with the initial estimated coordinates in the new image. The inputvx list of vx keypoint objects with tracking status set to zero (lost) are copied to the new vx list.
Users are responsible for editing the output vx list of vx keypoint objects list before applying it asthe input vx list of vx keypoint objects for the next frame. For example, vx keypoint objects withtracking status set to zero may be removed by a user for efficiency.
This function changes just the x, y and tracking status members of the vx keypoint t structure andbehaves as if it copied the rest from the old tracking vx keypoint to new image vx keypoint.
CHAPTER 3. MODULE DOCUMENTATION 222
3.70.2 Function Documentation
vx node vxOpticalFlowPyrLKNode ( vx graph graph, vx pyramid old images, vx pyramid new images,vx list old points, vx list new points estimates, vx list new points, vx enum termination, vx scalarepsilon, vx scalar num iterations, vx scalar use initial estimate, vx size window dimension )
[Graph] Creates a Lucas Kanade Tracking Node.
CHAPTER 3. MODULE DOCUMENTATION 223
Parameters
in graph The reference to the graph.in old images Input of first (old) image pyramidin new images Input of destination (new) image pyramidin old points a list of key points in a vx list of vx keypoint those key points are defined at the
old images high resolution pyramidin new points -
estimatesa list of estimation on what is the output key points in a vx list of vx keypointthose keypoints are defined at the new images high resolution pyramid
out new points a output list of key points in a vx list of vx keypoint those key points are definedat the new images high resolution pyramid
in termination termination can be VX TERM CRITERIA ITERATIONS or VX TERM CR-ITERIA EPSILON or VX TERM CRITERIA BOTH
in epsilon is the vx uint32 error for terminating the algorithmin num iterations is the number of iterationsin use initial -
estimateCan be set to either vx false e or vx true e.
in window -dimension
is the window on which to perform the algorithm.
Returns
vx node
Return values
0 Node could not be created.∗ Node Handle
vx status vxuOpticalFlowPyrLK ( vx pyramid old images, vx pyramid new images, vx list old points,vx list new points estimates, vx list new points, vx enum termination, vx scalar epsilon, vx scalarnum iterations, vx scalar use initial estimate, vx size window dimension )
[Immediate] Computes an optical flow on two images.Parameters
in old images Input of first (old) image pyramidin new images Input of destination (new) image pyramidin old points a list of key points in a vx list of vx keypoint those key points are defined at the
old images high resolution pyramidin new points -
estimatesa list of estimation on what is the output key points in a vx list of vx keypointthose keypoints are defined at the new images high resolution pyramid
out new points a output list of key points in a vx list of vx keypoint those key points are definedat the new images high resolution pyramid
in termination termination can be VX TERM CRITERIA ITERATIONS or VX TERM CRITE-RIA EPSILON or VX TERM CRITERIA BOTH
in epsilon is the vx uint32 error for terminating the algorithmin num iterations is the number of iterationsin use initial -
estimateCan be set to either vx false e or vx true e.
in window -dimension
is the window on which to perform the algorithm.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 224
Return values
VX SUCCESS Success∗ An error occurred. See vx status e.
CHAPTER 3. MODULE DOCUMENTATION 225
3.71 Kernel: Remap
Maps output pixels in an image from input pixels in an image.
Functions
• vx node vxRemapNode (vx graph graph, vx image input, vx remap table, vx enum policy, vx image output)
[Graph] Creates a Remap Node.
• vx status vxuRemap (vx image input, vx remap table, vx enum policy, vx image output)
[Immediate] Remaps an output image from an input image.
3.71.1 Detailed Description
Maps output pixels in an image from input pixels in an image. Remap takes a remap table object vx remap to mapa set of output pixels back to source input pixels. A remap is typically defined as:
out put(x1,y1) = input(mapx(x0,y0),mapy(x0,y0))
However, the mapping functions are contained in the vx remap object.
3.71.2 Function Documentation
vx node vxRemapNode ( vx graph graph, vx image input, vx remap table, vx enum policy, vx imageoutput )
[Graph] Creates a Remap Node.Parameters
in graph The reference to the graph which will contain the node.in input The input FOURCC U8 image.in table The remap table object.in policy An interpolation type from vx interpolation type e. VX INTERPO-
LATION TYPE AREA is not supported.out output The output FOURCC U8 image.
Note
Only VX NODE ATTRIBUTE BORDER value VX BORDER MODE UNDEFINED or VX BORDER MODE C-ONSTANT is supported.
Returns
Returns a vx node
Return values
0 Node could not be created.∗ Node Handle.
vx status vxuRemap ( vx image input, vx remap table, vx enum policy, vx image output )
[Immediate] Remaps an output image from an input image.Parameters
in input The input FOURCC U8 image.
CHAPTER 3. MODULE DOCUMENTATION 226
in table The remap table object.in policy The interpolation policy from vx interpolation type e. VX INTERPOLATION -
TYPE AREA is not supported.out output The output FOURCC U8 image.
Returns
Returns a vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 227
3.72 Node: Border Modes
The border mode behaviors.
Data Structures
• struct vx border mode t
Used with the enumeration VX NODE ATTRIBUTE BORDER MODE to set the border mode behavior of a node whichsupports borders. More...
Enumerations
• enum vx border mode e {VX BORDER MODE UNDEFINED = ((( VX ID KHRONOS ) << 20) | ( VX ENUM BORDER MODE <<12)) + 0x0,VX BORDER MODE CONSTANT = ((( VX ID KHRONOS ) << 20) | ( VX ENUM BORDER MODE << 12))+ 0x1,VX BORDER MODE REPLICATE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM BORDER MODE << 12))+ 0x2 }
The border mode list.
3.72.1 Detailed Description
The border mode behaviors. Border Mode behavior is set as an attribute of the node, not as a direct parameter tothe kernel. This allows users to ”set-and-forget” the modes of any particular node which supports border modes.Most Nodes do not support any explicit border modes beyond VX BORDER MODE UNDEFINED.
3.72.2 Data Structure Documentation
struct vx border mode t
Used with the enumeration VX NODE ATTRIBUTE BORDER MODE to set the border mode behavior of a nodewhich supports borders.
Examples:
vx tiling ext.c.
Definition at line 1431 of file vx types.h.Data Fields
vx uint32 constant value For the mode VX BORDER MODE CONSTANT, this value will be filledinto each pixel. If there are sub-channels in the pixel then this value willbe divided up accordingly.
vx enum mode See vx border mode e.
3.72.3 Enumeration Type Documentation
enum vx border mode e
The border mode list.
Enumerator
VX BORDER MODE UNDEFINED No defined border mode behavior is given.
VX BORDER MODE CONSTANT For nodes which support this behavior, a constant value is ”filled-in” whenaccessing out-of-bounds pixels.
VX BORDER MODE REPLICATE For nodes which support this behavior, a replication of the nearest edgepixels value is given for out-of-bounds pixels.
Definition at line 1129 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 228
3.73 OpenVX Types
The types associated with OpenVX.
Typedefs
• typedef char vx char
An 8 bit ASCII character.• typedef int32 t vx enum
Sets the standard enumeration type size to be a fixed quantity. All enumerable fields should use this type as thecontainer to enforce enumeration ranges and sizeof()s.
• typedef float vx float32
A 32-bit float value.• typedef double vx float64
A 64-bit float value (aka double)• typedef uint32 t vx fourcc
Used to hold a FOURCC code to describe the pixel format and color space.• typedef int16 t vx int16
A 16-bit signed value.• typedef int32 t vx int32
A 32-bit signed value.• typedef int64 t vx int64
A 64-bit signed value.• typedef int8 t vx int8
An 8-bit signed value.• typedef size t vx size
A wrapper of size t to keep the naming convention uniform.• typedef vx enum vx status
A formal status type with known fixed size.• typedef uint16 t vx uint16
A 16-bit unsigned value.• typedef uint32 t vx uint32
A 32-bit unsigned value.• typedef uint64 t vx uint64
A 64-bit unsigned value.• typedef uint8 t vx uint8
An 8-bit unsigned value.
Enumerations
• enum vx bool {vx false e = 0,vx true e }
A boolean value. This allows 0 to be false, as it is in C, and any non-zero to be true.• enum vx channel e {
VX CHANNEL 0 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM CHANNEL << 12)) + 0x0,VX CHANNEL 1 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM CHANNEL << 12)) + 0x1,VX CHANNEL 2 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM CHANNEL << 12)) + 0x2,VX CHANNEL 3 = ((( VX ID KHRONOS ) << 20) | ( VX ENUM CHANNEL << 12)) + 0x3,VX CHANNEL R = VX CHANNEL 0,VX CHANNEL G = VX CHANNEL 1,VX CHANNEL B = VX CHANNEL 2,VX CHANNEL A = VX CHANNEL 3,VX CHANNEL Y = VX CHANNEL 0,VX CHANNEL U = VX CHANNEL 1,VX CHANNEL V = VX CHANNEL 2 }
CHAPTER 3. MODULE DOCUMENTATION 229
The channel enumerations for channel extractions.
• enum vx convert policy e {VX CONVERT POLICY TRUNCATE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM CONVERT POLICY<< 12)) + 0x0,VX CONVERT POLICY SATURATE = ((( VX ID KHRONOS ) << 20) | ( VX ENUM CONVERT POLICY<< 12)) + 0x1 }
The Conversion Policy Enumeration.
• enum vx enum e {VX ENUM DIRECTION = 0x00,VX ENUM ACTION = 0x01,VX ENUM HINT = 0x02,VX ENUM DIRECTIVE = 0x03,VX ENUM INTERPOLATION = 0x04,VX ENUM OVERFLOW = 0x05,VX ENUM COLOR SPACE = 0x06,VX ENUM COLOR RANGE = 0x07,VX ENUM PARAMETER STATE = 0x08,VX ENUM CHANNEL = 0x09,VX ENUM CONVERT POLICY = 0x0A,VX ENUM THRESHOLD TYPE = 0x0B,VX ENUM BORDER MODE = 0x0C,VX ENUM LIST ITERATORS = 0x0D,VX ENUM COMPARISON = 0x0E,VX ENUM IMPORT MEM = 0x0F,VX ENUM TERM CRITERIA = 0x10,VX ENUM NORM TYPE = 0x11 }
The set of supported enumerations in OpenVX.
• enum vx fourcc e {FOURCC VIRT = VX TYPE IMAGE,FOURCC RGB = (( ’R’ ) | ( ’G’ << 8) | ( ’B’ << 16) | ( ’2’ << 24)),FOURCC RGBX = (( ’R’ ) | ( ’G’ << 8) | ( ’B’ << 16) | ( ’A’ << 24)),FOURCC NV12 = (( ’N’ ) | ( ’V’ << 8) | ( ’1’ << 16) | ( ’2’ << 24)),FOURCC NV21 = (( ’N’ ) | ( ’V’ << 8) | ( ’2’ << 16) | ( ’1’ << 24)),FOURCC UYVY = (( ’U’ ) | ( ’Y’ << 8) | ( ’V’ << 16) | ( ’Y’ << 24)),FOURCC YUYV = (( ’Y’ ) | ( ’U’ << 8) | ( ’Y’ << 16) | ( ’V’ << 24)),FOURCC IYUV = (( ’I’ ) | ( ’Y’ << 8) | ( ’U’ << 16) | ( ’V’ << 24)),FOURCC YUV4 = (( ’Y’ ) | ( ’U’ << 8) | ( ’V’ << 16) | ( ’4’ << 24)),FOURCC U8 = (( ’U’ ) | ( ’0’ << 8) | ( ’0’ << 16) | ( ’8’ << 24)),FOURCC U16 = (( ’U’ ) | ( ’0’ << 8) | ( ’1’ << 16) | ( ’6’ << 24)),FOURCC S16 = (( ’S’ ) | ( ’0’ << 8) | ( ’1’ << 16) | ( ’6’ << 24)),FOURCC U32 = (( ’U’ ) | ( ’0’ << 8) | ( ’3’ << 16) | ( ’2’ << 24)),FOURCC S32 = (( ’S’ ) | ( ’0’ << 8) | ( ’3’ << 16) | ( ’2’ << 24)) }
Based on the FOURCC definition referenced on http://fourcc.org.
• enum vx interpolation type e {VX INTERPOLATION TYPE NEAREST NEIGHBOR = ((( VX ID KHRONOS ) << 20) | ( VX ENUM INTE-RPOLATION << 12)) + 0x0,VX INTERPOLATION TYPE BILINEAR = ((( VX ID KHRONOS ) << 20) | ( VX ENUM INTERPOLATION<< 12)) + 0x1,VX INTERPOLATION TYPE AREA = ((( VX ID KHRONOS ) << 20) | ( VX ENUM INTERPOLATION <<12)) + 0x2 }
The image reconstruction filters supported by image resampling operations.
• enum vx status e {
CHAPTER 3. MODULE DOCUMENTATION 230
VX STATUS MIN = -24,VX ERROR REFERENCE NONZERO = -23,VX ERROR MULTIPLE WRITERS = -22,VX ERROR GRAPH ABANDONED = -21,VX ERROR GRAPH SCHEDULED = -20,VX ERROR INVALID NODE = -19,VX ERROR INVALID GRAPH = -18,VX ERROR INVALID TYPE = -17,VX ERROR INVALID VALUE = -16,VX ERROR INVALID DIMENSION = -15,VX ERROR INVALID FORMAT = -14,VX ERROR INVALID LINK = -13,VX ERROR INVALID REFERENCE = -12,VX ERROR INVALID MODULE = -11,VX ERROR INVALID PARAMETERS = -10,VX ERROR OPTIMIZED AWAY = -9,VX ERROR NO MEMORY = -8,VX ERROR NO RESOURCES = -7,VX ERROR NOT COMPATIBLE = -6,VX ERROR NOT ALLOCATED = -5,VX ERROR NOT SUFFICIENT = -4,VX ERROR NOT SUPPORTED = -3,VX ERROR NOT IMPLEMENTED = -2,VX FAILURE = -1,VX SUCCESS = 0 }
The enumeration of all status codes.
• enum vx type e {
CHAPTER 3. MODULE DOCUMENTATION 231
VX TYPE INVALID = 0x000,VX TYPE CHAR = 0x001,VX TYPE INT8 = 0x002,VX TYPE UINT8 = 0x003,VX TYPE INT16 = 0x004,VX TYPE UINT16 = 0x005,VX TYPE INT32 = 0x006,VX TYPE UINT32 = 0x007,VX TYPE INT64 = 0x008,VX TYPE UINT64 = 0x009,VX TYPE FLOAT32 = 0x00A,VX TYPE FLOAT64 = 0x00B,VX TYPE ENUM = 0x00C,VX TYPE SIZE = 0x00D,VX TYPE FOURCC = 0x00E,VX TYPE BOOL = 0x010,VX TYPE SCALAR MAX,VX TYPE REFERENCE = 0x020,VX TYPE CONTEXT = 0x021,VX TYPE GRAPH = 0x022,VX TYPE NODE = 0x023,VX TYPE KERNEL = 0x024,VX TYPE PARAMETER = 0x025,VX TYPE DELAY = 0x026,VX TYPE TARGET = 0x027,VX TYPE RECTANGLE = 0x028,VX TYPE LUT = 0x029,VX TYPE DISTRIBUTION = 0x02A,VX TYPE PYRAMID = 0x02B,VX TYPE THRESHOLD = 0x02C,VX TYPE MATRIX = 0x02D,VX TYPE CONVOLUTION = 0x02E,VX TYPE COORDINATES = 0x02F,VX TYPE SCALAR = 0x030,VX TYPE LIST = 0x031,VX TYPE BUFFER = 0x032,VX TYPE IMAGE = 0x033,VX TYPE KEYPOINT = 0x034,VX TYPE REMAP = 0x035,VX TYPE OBJECT MAX }
The type enumeration lists all the known types in OpenVX.
3.73.1 Detailed Description
The types associated with OpenVX.
3.73.2 Typedef Documentation
typedef vx enum vx status
A formal status type with known fixed size.
See Also
vx status e
Definition at line 395 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 232
3.73.3 Enumeration Type Documentation
enum vx bool
A boolean value. This allows 0 to be false, as it is in C, and any non-zero to be true.
vx bool ret = vx true e;if (ret) printf("true!\n");ret = vx false e;if (!ret) printf("false!\n");
This would print both strings.
Enumerator
vx false e The ”false” value.
vx true e The ”true” value.
Definition at line 291 of file vx types.h.
enum vx channel e
The channel enumerations for channel extractions.
See Also
vxChannelExtractNodevxuChannelExtractVX KERNEL CHANNEL EXTRACT
Enumerator
VX CHANNEL 0 Used by formats with unknown channel types.
VX CHANNEL 1 Used by formats with unknown channel types.
VX CHANNEL 2 Used by formats with unknown channel types.
VX CHANNEL 3 Used by formats with unknown channel types.
VX CHANNEL R Used to extract the RED channel, no matter the byte or packing order.
VX CHANNEL G Used to extract the GREEN channel, no matter the byte or packing order.
VX CHANNEL B Used to extract the BLUE channel, no matter the byte or packing order.
VX CHANNEL A Used to extract the ALPHA channel, no matter the byte or packing order.
VX CHANNEL Y Used to extract the LUMA channel, no matter the byte or packing order.
VX CHANNEL U Used to extract the Cb/U channel, no matter the byte or packing order.
VX CHANNEL V Used to extract the Cr/V/Value channel, no matter the byte or packing order.
Definition at line 1014 of file vx types.h.
enum vx convert policy e
The Conversion Policy Enumeration.
Enumerator
VX CONVERT POLICY TRUNCATE Results are the least significant bits of the output operand, as if storedin two’s complement binary format in the size of its bit-depth.
VX CONVERT POLICY SATURATE Results are saturated to the bit depth of the output operand.
Definition at line 600 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 233
enum vx enum e
The set of supported enumerations in OpenVX.These can be extracted from enumerated values using VX ENUM TYPE.
Enumerator
VX ENUM DIRECTION Parameter Direction.
VX ENUM ACTION Action Codes.
VX ENUM HINT Hint Values.
VX ENUM DIRECTIVE Directive Values.
VX ENUM INTERPOLATION Interpolation Types.
VX ENUM OVERFLOW Overflow Policies.
VX ENUM COLOR SPACE Color Space.
VX ENUM COLOR RANGE Color Space Range.
VX ENUM PARAMETER STATE Parameter State.
VX ENUM CHANNEL Channel Name.
VX ENUM CONVERT POLICY Convert Policy.
VX ENUM THRESHOLD TYPE Threshold Type List.
VX ENUM BORDER MODE Border Mode List.
VX ENUM LIST ITERATORS List Iteration Names.
VX ENUM COMPARISON Comparison Values.
VX ENUM IMPORT MEM The memory import enumeration.
VX ENUM TERM CRITERIA A termination criteria.
VX ENUM NORM TYPE A norm type.
Definition at line 516 of file vx types.h.
enum vx fourcc e
Based on the FOURCC definition referenced on http://fourcc.org.
Note
Use vx fourcc to contain these values.
Enumerator
FOURCC VIRT A virtual image of no defined type.
FOURCC RGB A single plane of 24 bit pixel as 3 interleaved 8 bit units of R then G then B data. This usesthe BT709 full range by default.
FOURCC RGBX A single plane of 32 bit pixel as 4 interleaved 8 bit units of R then G then B data, then a”don’t care” byte. This uses the BT709 full range by default.
FOURCC NV12 A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling. This uses theBT709 full range by default.
FOURCC NV21 A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling. This uses theBT709 full range by default.
FOURCC UYVY A single plane of 32 bit macro pixel of U0, Y0, V0, Y1 bytes. This uses the BT709 full rangeby default.
FOURCC YUYV A single plane of 32 bit macro pixel of Y0, U0, Y1, V0 bytes. This uses the BT709 full rangeby default.
FOURCC IYUV A 3 plane of 8 bit 4:2:0 sampled Y, U, V planes. This uses the BT709 full range by default.
FOURCC YUV4 A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes. This uses the BT709 full range by default.
FOURCC U8 A single plane of unsigned 8 bit data. The range of data is not specified, as it may be extractedfrom a YUV or generated.
CHAPTER 3. MODULE DOCUMENTATION 234
FOURCC U16 A single place of unsigned 16 bit data. The range of data is not specified, as it may be extractedfrom a YUV or generated.
FOURCC S16 A single place of signed 16 bit data. The range of data is not specified, as it may be extractedfrom a YUV or generated.
FOURCC U32 A single place of unsigned 32 bit data. The range of data is not specified, as it may be extractedfrom a YUV or generated.
FOURCC S32 A single place of unsigned 32 bit data. The range of data is not specified, as it may be extractedfrom a YUV or generated.
Definition at line 613 of file vx types.h.
enum vx interpolation type e
The image reconstruction filters supported by image resampling operations.The edge of a pixel is interpreted as being aligned to the edge of the image. The values for an output pixel is
evaluated at the center of that pixel.This means, for example, that an even enlargement of a factor of two in nearest-neighbor interpolation will
replicate every source pixel into a 2x2 quad in the destination, and that an even shrink by a factor of two in bilinearinterpolation will create each destination pixel by average a 2x2 quad of source pixels.
Samples which cross the boundary of the source image have values determined by the border mode - seevx border mode e and VX NODE ATTRIBUTE BORDER MODE.
See Also
vxuScaleImagevxScaleImageNodeVX KERNEL SCALE IMAGEvxuWarpAffinevxWarpAffineNodeVX KERNEL WARP AFFINEvxuWarpPerspectivevxWarpPerspectiveNodeVX KERNEL WARP PERSPECTIVE
Enumerator
VX INTERPOLATION TYPE NEAREST NEIGHBOR Output values are defined to match the source pixelwhose center is nearest to the sample position.
VX INTERPOLATION TYPE BILINEAR Output values are defined by bilinear interpolation between the pix-els whose centers are closest to the sample position, weighted linearly by the distance of the sample fromthe pixel centers.
VX INTERPOLATION TYPE AREA Output values are determined by averaging the source pixels whose ar-eas fall under the area of the destination pixel, projected onto the source image.
Definition at line 1074 of file vx types.h.
enum vx status e
The enumeration of all status codes.
See Also
vx status.
Enumerator
VX STATUS MIN Indicates the lower bound of status codes in VX. Used for bounds checks only.
VX ERROR REFERENCE NONZERO Indicates that an operation could not complete due to a referencecount being non-zero.
VX ERROR MULTIPLE WRITERS Indicates that the graph had more than one node outputting to the samedata object. This is an invalid graph structure.
CHAPTER 3. MODULE DOCUMENTATION 235
VX ERROR GRAPH ABANDONED Indicates that the graph was stopped due to an error or a callback whichabandoned execution.
VX ERROR GRAPH SCHEDULED Indicates that the supplied graph already has been scheduled and maybe currently executing.
VX ERROR INVALID NODE Indicates that the supplied node could not be created.
VX ERROR INVALID GRAPH Indicates that the supplied graph had invalid connections (cycles)
VX ERROR INVALID TYPE Indicates that the supplied type parameter was incorrect.
VX ERROR INVALID VALUE Indicates that the supplied parameter had an incorrect value.
VX ERROR INVALID DIMENSION Indicates that the supplied parameter was too big or too small in dimen-sion.
VX ERROR INVALID FORMAT Indicates that the supplied parameter was in an invalid format.
VX ERROR INVALID LINK Indicates that the link was not possible as specified. The parameters were in-compatible.
VX ERROR INVALID REFERENCE Indicates that the reference provided was not valid.
VX ERROR INVALID MODULE This is returned from vxLoadKernels when the module did not containthe entry point.
VX ERROR INVALID PARAMETERS The supplied parameter information did not match the kernel contract.
VX ERROR OPTIMIZED AWAY This code indicates that the object refered to has been optimized out ofexistence.
VX ERROR NO MEMORY An internal or implicit allocation failed. Typically catastrophic. After detection,deconstruct the context.See Also
vxVerifyGraph
VX ERROR NO RESOURCES An internal or implicit resource could not be acquired (not memory). This istypically catastrophic. After detection, deconstruct the context.
See Also
vxVerifyGraph
VX ERROR NOT COMPATIBLE The attempt to link two parameters together failed due to type incompatibilty.
VX ERROR NOT ALLOCATED Indicates to the system that the parameter must be allocated by the system.
VX ERROR NOT SUFFICIENT The given graph has failed verification due to an insufficient number of re-quired parameters which can not be automatically created. Typically this indicate required atomic param-eters.See Also
vxVerifyGraph
VX ERROR NOT SUPPORTED The requested set of parameter produce a configuration which can not besupported. Refer to the supplied documentation on the configured kernels.
See Also
vx kernel e
VX ERROR NOT IMPLEMENTED The requested kernel is missing.
See Also
vx kernel e vxGetKernelByName
VX FAILURE The generic error code, used when no other will describe the error.
VX SUCCESS No error.
Definition at line 362 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 236
enum vx type e
The type enumeration lists all the known types in OpenVX.
Enumerator
VX TYPE CHAR A vx char
VX TYPE INT8 A vx int8
VX TYPE UINT8 A vx uint8
VX TYPE INT16 A vx int16
VX TYPE UINT16 A vx uint16
VX TYPE INT32 A vx int32
VX TYPE UINT32 A vx uint32
VX TYPE INT64 A vx int64
VX TYPE UINT64 A vx uint64
VX TYPE FLOAT32 A vx float32
VX TYPE FLOAT64 A vx float64
VX TYPE ENUM A vx enum. Equivalent in size to a vx int32
VX TYPE SIZE A vx size
VX TYPE FOURCC A vx fourcc
VX TYPE BOOL A vx bool
VX TYPE REFERENCE A vx reference
VX TYPE CONTEXT A vx context
VX TYPE GRAPH A vx graph
VX TYPE NODE A vx node
VX TYPE KERNEL A vx kernel
VX TYPE PARAMETER A vx parameter
VX TYPE DELAY A vx delay
VX TYPE TARGET A vx target
VX TYPE RECTANGLE A vx rectangle
VX TYPE LUT A vx lut
VX TYPE DISTRIBUTION A vx distribution
VX TYPE PYRAMID A vx pyramid
VX TYPE THRESHOLD A vx threshold
VX TYPE MATRIX A vx matrix
VX TYPE CONVOLUTION A vx convolution
VX TYPE COORDINATES A vx coordinates
VX TYPE SCALAR A vx scalar when needed to be completely generic for kernel validation.
VX TYPE LIST A vx list
VX TYPE BUFFER A vx buffer
VX TYPE IMAGE A vx image
VX TYPE KEYPOINT A vx keypoint
VX TYPE REMAP A vx remap
Definition at line 306 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 237
3.74 OpenVX Macros
The macros associated with OpenVX.
Macros
• #define VX ATTRIBUTE BASE(vendor, object) (((vendor) << 20) | (object << 8))
Defines the manner in which to combine the Vendor and Object IDs to get the base value of the enumeration.
• #define VX ENUM BASE(vendor, id) (((vendor) << 20) | (id << 12))
Defines the manner in which to combine the Vendor and Object IDs to get the base value of the enumeration.
• #define VX ENUM TYPE(e) (((vx uint32)e & VX ENUM TYPE MASK) >> 12)
A macro to extract the enum type from an enumerated value.
• #define VX FMT REF ”%zu”• #define VX FMT SIZE ”%zu”• #define VX FOURCC(a, b, c, d) ((a) | (b << 8) | (c << 16) | (d << 24))
Converts a set of four chars into a uint32 t container of a FOURCC code.
• #define VX KERNEL BASE(vendor, lib) (((vendor) << 20) | (lib << 12))
Defines the manner in which to combine the Vendor and Library IDs to get the base value of the enumeration.
• #define VX LIBRARY(e) (((vx uint32)e & VX LIBRARY MASK) >> 12)
A macro to extract the kernel library enumeration from a enumerated kernel value.
• #define VX SCALE UNITY (1024u)• #define VX TYPE(e) (((vx uint32)e & VX TYPE MASK) >> 8)
A macro to extract the type from an enumerated attribute value.
• #define VX VENDOR(e) (((vx uint32)e & VX VENDOR MASK) >> 20)
A macro to extract the vendor ID from the enumerated value.
3.74.1 Detailed Description
The macros associated with OpenVX.
3.74.2 Macro Definition Documentation
#define VX ENUM BASE( vendor, id ) (((vendor) << 20) | (id << 12))
Defines the manner in which to combine the Vendor and Object IDs to get the base value of the enumeration.From any enumerated value (with exceptions), the vendor, and enumeration type should be extractable. Those
types which are exceptions are vx vendor id e, vx type e, vx enum e, vx fourcc e, and vx bool.
#define VX FMT REF ”%zu”
Used to aid in debugging values in OpenVX.Definition at line 1333 of file vx types.h.
#define VX FMT SIZE ”%zu”
Used to aid in debugging values in OpenVX.Definition at line 1337 of file vx types.h.
#define VX FOURCC( a, b, c, d ) ((a) | (b << 8) | (c << 16) | (d << 24))
Converts a set of four chars into a uint32 t container of a FOURCC code.
Note
Use a vx fourcc variable to hold the value.
CHAPTER 3. MODULE DOCUMENTATION 238
#define VX SCALE UNITY (1024u)
Used to indicate the 1:1 ratio in Q22.10 format.Definition at line 1342 of file vx types.h.
CHAPTER 3. MODULE DOCUMENTATION 239
3.75 OpenVX Defines
The defines associated with OpenVX.
Macros
• #define VX ATTRIBUTE ID MASK (0x000000FF)
An object’s attribute ID is within the range of [0,28−1] (inclusive).
• #define VX ENUM MASK (0x00000FFF)
A generic enumeration list can have values between [0,212−1] (inclusive).
• #define VX ENUM TYPE MASK (0x000FF000)
A type of enumeration. The valid range is between [0,28−1] (inclusive).
• #define VX KERNEL MASK (0x00000FFF)
An individual kernel in a library has its own unique ID within [0,212−1] (inclusive).
• #define VX LIBRARY MASK (0x000FF000)
A library is a set of vision kernels with its own id supplied by a vendor. The vendor defines the library ID. The range is[0,28−1] inclusive.
• #define VX TYPE MASK (0x000FFF00)
A type mask removes the scalar/object type from the attribute. It is 3 nibbles in size and in contained between thethird and second byte.
• #define VX VENDOR MASK (0xFFF00000)
Vendor ID’s are 2 nibbles in size and are located in the upper byte of the 4 bytes of an enumeration.
• #define VX VERSION (VX VERSION MAJOR << 16 | VX VERSION MINOR)• #define VX VERSION MAJOR (0x0)• #define VX VERSION MINOR (0x5)
3.75.1 Detailed Description
The defines associated with OpenVX.
3.75.2 Macro Definition Documentation
#define VX TYPE MASK (0x000FFF00)
A type mask removes the scalar/object type from the attribute. It is 3 nibbles in size and in contained between thethird and second byte.
See Also
vx type e
Definition at line 423 of file vx types.h.
#define VX VERSION (VX VERSION MAJOR << 16 | VX VERSION MINOR)
The OpenVX Version NumberDefinition at line 72 of file vx.h.
#define VX VERSION MAJOR (0x0)
The major version numberDefinition at line 62 of file vx.h.
#define VX VERSION MINOR (0x5)
The minor version numberDefinition at line 67 of file vx.h.
CHAPTER 3. MODULE DOCUMENTATION 240
3.76 OpenVX Vendors
The set of Vendors which have OpenVX implementations.
Enumerations
• enum vx vendor id e {VX ID KHRONOS = 0x000,VX ID TI = 0x001,VX ID QUALCOMM = 0x002,VX ID NVIDIA = 0x003,VX ID ARM = 0x004,VX ID BDTI = 0x005,VX ID RENESAS = 0x006,VX ID VIVANTE = 0x007,VX ID XILINX = 0x008,VX ID AXIS = 0x009,VX ID MOVIDIUS = 0x00A,VX ID SAMSUNG = 0x00B,VX ID FREESCALE = 0x00C,VX ID AMD = 0x00D,VX ID BROADCOM = 0x00E,VX ID INTEL = 0x00F,VX ID MARVELL = 0x010,VX ID MEDIATEK = 0x011,VX ID ST = 0x012,VX ID CEVA = 0x013,VX ID MAX = 0xFFF,VX ID DEFAULT = VX ID MAX }
The Vendor ID of the Implementation. As new vendors submit their implementations, this enumeration will grow.
3.76.1 Detailed Description
The set of Vendors which have OpenVX implementations.
3.76.2 Enumeration Type Documentation
enum vx vendor id e
The Vendor ID of the Implementation. As new vendors submit their implementations, this enumeration will grow.
Enumerator
VX ID KHRONOS The Khronos Group.
VX ID TI Texas Instruments, Inc.
VX ID QUALCOMM Qualcomm, Inc.
VX ID NVIDIA NVIDIA Corporation.
VX ID ARM ARM Ltd.
VX ID BDTI Berkley Design Technology, Inc.
VX ID RENESAS Renasas Electronics.
VX ID VIVANTE Vivante Corporation.
VX ID XILINX Xilinx Inc.
VX ID AXIS Axis Communications.
VX ID MOVIDIUS Movidius Ltd.
VX ID SAMSUNG Samsung Electronics.
VX ID FREESCALE Freescale Semiconductor.
CHAPTER 3. MODULE DOCUMENTATION 241
VX ID AMD Advanced Micro Devices.
VX ID BROADCOM Broadcom Corporation.
VX ID INTEL Intel Corporation.
VX ID MARVELL Marvell Technology Group Ltd.
VX ID MEDIATEK MediaTek, Inc.
VX ID ST STMicroelectronics.
VX ID CEVA CEVA DSP.
VX ID DEFAULT For use by all Kernel authors until they can obtain an assigned ID.
Definition at line 40 of file vx vendors.h.
CHAPTER 3. MODULE DOCUMENTATION 242
3.77 OpenVX Examples
A series of examples of how to use the OpenVX API.
Modules
• Example: User Defined Kernel
An example of a user defined kernel to OpenVX and it’s required parts.
Data Structures
• struct vx graph factory t
A graph factory structure. More...
Typedefs
• typedef vx graph(∗ vx graph factory f )(vx context context)
An prototype of a graph factory method.
Enumerations
• enum vx factory name e {VX GRAPH FACTORY EDGE,VX GRAPH FACTORY CORNERS,VX GRAPH FACTORY PIPELINE }
Functions
• int example eyetracking (int argc, char ∗argv[ ])
An example of an Eye Tracking Graph.
• vx action example maximacallback (vx node node)
This will be called after the vxMinMaxLocNode completes and determines the maximum value in an image.
• int example super resolution (int argc, char ∗argv[ ])
An example of an super resolution algorithm.
• int main (int argc, char ∗argv[ ])
The graph factory example.
• vx graph vxCornersGraphFactory (vx context context)
An example of Corner Detection Graph Factory.
• vx graph vxEdgeGraphFactory (vx context c)
An example Graph Factory which creates an edge graph.
• vx graph vxGraphFactory (vx context context, vx enum factory name)
Returns a graph from one of the matching factories.
• vx graph vxPipelineGraphFactory (vx context context)
A simple vision pipeline factory which also adds callbacks.
Variables
• vx graph factory t factories [ ]
The array of factory functions.
3.77.1 Detailed Description
A series of examples of how to use the OpenVX API.
CHAPTER 3. MODULE DOCUMENTATION 243
3.77.2 Data Structure Documentation
struct vx graph factory t
A graph factory structure.Definition at line 46 of file vx graph factory.h.
Data Fields
vx graph -factory f
factory
vx enum factory name
3.77.3 Enumeration Type Documentation
enum vx factory name e
Definition at line 32 of file vx graph factory.h.
3.77.4 Variable Documentation
vx graph factory t factories[ ]
Initial value:
= {{VX GRAPH FACTORY EDGE, vxEdgeGraphFactory},{VX GRAPH FACTORY CORNERS, vxCornersGraphFactory},{VX GRAPH FACTORY PIPELINE, vxPipelineGraphFactory},
}
The array of factory functions.Definition at line 38 of file vx graph factory.c.
CHAPTER 3. MODULE DOCUMENTATION 244
3.78 Example: User Defined Kernel
An example of a user defined kernel to OpenVX and it’s required parts.
Enumerations
• enum xyz params e {XYZ PARAM INPUT = 0,XYZ PARAM VALUE,XYZ PARAM OUTPUT,XYZ PARAM TEMP }
Functions
• vx status vxPublishKernels (vx context context)
The entry point into this module to add the extensions to OpenVX.
• vx status XYZDeinitialize (vx node node, vx reference ∗parameters, vx uint32 num)
A deinitializer function.
• vx status XYZInitialize (vx node node, vx reference ∗parameters, vx uint32 num)
An initializer function.
• vx status XYZInputValidator (vx node node, vx uint32 index)
An example input parameter validator.
• vx status XYZKernel (vx node node, vx reference ∗parameters, vx uint32 num)
The private kernel function for XYZ.
• vx status XYZOutputValidator (vx node node, vx uint32 index, vx meta format t ∗ptr)
An example output parameter validator.
3.78.1 Detailed Description
An example of a user defined kernel to OpenVX and it’s required parts. Users Defined Kernels are a method bywhich to insert User defined code to execute inside the graph concurrently with other nodes in the Graph. Thebenefit of User Defined Kernels is that code which would otherwise have to stop all other graph processing andthen begin graph processing again, can be run, potentially in parallel, with other nodes in the graph, with no otherinterrupt of the graph. User Defined Kernels execute on the host processor by default. OpenVX does not definea language to describe kernels, but relies on the existing OS constructs of modules and symbols to be able toreference local functions on the host to validate input and output data as well as the invoke the kernel itself.
3.78.2 Enumeration Type Documentation
enum xyz params e
An internal definition of the order of the parameters to the function. This list must match the parameter list in thefunction and in the publish kernel list.
Examples:
xyz module.c.
Definition at line 53 of file xyz module.c.
3.78.3 Function Documentation
vx status vxPublishKernels ( vx context context )
The entry point into this module to add the extensions to OpenVX.
CHAPTER 3. MODULE DOCUMENTATION 245
Parameters
in context The handle to the implementation context.
Returns
A vx status e enumeration. Returns errors if some or all kernels were not added correctly.
Note
This follows the function pointer definition of a vx publish kernels f and uses the predefined name for the entrypoint, ”vxPublishKernels”.
Examples:
vx tiling ext.c, and xyz module.c.
Definition at line 245 of file xyz module.c.References VX BIDIRECTIONAL, VX INPUT, VX KERNEL ATTRIBUTE LOCAL DATA SIZE, VX OUTPUT,
VX PARAMETER STATE REQUIRED, VX SUCCESS, VX TYPE BUFFER, VX TYPE IMAGE, VX TYPE INT32,vxAddKernel(), vxAddParameterToKernel(), vxFinalizeKernel(), vxRemoveKernel(), vxSetKernelAttribute(), XYZ-Deinitialize(), XYZInitialize(), XYZInputValidator(), XYZKernel(), and XYZOutputValidator().
vx status XYZDeinitialize ( vx node node, vx reference ∗ parameters, vx uint32 num )
A deinitializer function.Parameters
in node The handle to the node this kernel is instanced into.in parameters The array of vx reference references.in num The number of parameters in the array. functions.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Successful return.VX ERROR INVALID PAR-
AMETERThe input or output image were of the incorrect dimensions.
Examples:
xyz module.c.
Definition at line 227 of file xyz module.c.References VX SUCCESS.Referenced by vxPublishKernels().
vx status XYZInitialize ( vx node node, vx reference ∗ parameters, vx uint32 num )
An initializer function.Parameters
in node The handle to the node this kernel is instanced into.in parameters The array of vx reference references.in num The number of parameters in the array. functions.
Returns
A vx status e enumeration.
CHAPTER 3. MODULE DOCUMENTATION 246
Return values
VX SUCCESS Successful return.VX ERROR INVALID PAR-
AMETERThe input or output image were of the incorrect dimensions.
Examples:
xyz module.c.
Definition at line 210 of file xyz module.c.References VX SUCCESS.Referenced by vxPublishKernels().
vx status XYZInputValidator ( vx node node, vx uint32 index )
An example input parameter validator.Parameters
in node The handle to the node.in index The index of the parameter to validate.
Returns
A vx status e enumeration.
Examples:
xyz module.c.
Definition at line 66 of file xyz module.c.References FOURCC U8, VX BUFFER ATTRIBUTE SIZE, VX ERROR INVALID DIMENSION, VX ERROR -
INVALID PARAMETERS, VX ERROR INVALID VALUE, VX IMAGE ATTRIBUTE FORMAT, VX SCALAR ATTR-IBUTE TYPE, VX SUCCESS, VX TYPE INT32, vxGetParameterByIndex(), vxQueryBuffer(), vxQueryImage(), vx-QueryParameter(), vxQueryScalar(), and vxReleaseParameter().
Referenced by vxPublishKernels().
vx status XYZKernel ( vx node node, vx reference ∗ parameters, vx uint32 num )
The private kernel function for XYZ.
Note
This is not called directly by users.
Parameters
in node The handle to the node this kernel is instanced into.in parameters The array of vx reference references.in num The number of parameters in the array. functions.
Returns
A vx status e enumeration.
Return values
VX SUCCESS Successful return.VX ERROR INVALID PAR-
AMETERThe input or output image were of the incorrect dimensions.
Examples:
xyz module.c.
CHAPTER 3. MODULE DOCUMENTATION 247
Definition at line 159 of file xyz module.c.References vx imagepatch addressing t::dim x, vx imagepatch addressing t::dim y, vx imagepatch -
addressing t::step x, vx imagepatch addressing t::step y, VX BUFFER ATTRIBUTE NUMUNITS, VX BUFFER A-TTRIBUTE UNITSIZE, VX ERROR INVALID PARAMETERS, VX SUCCESS, vxAccessBufferRange(), vxAccess-ImagePatch(), vxCommitBufferRange(), vxCommitImagePatch(), vxGetValidRegionImage(), vxQueryBuffer(), andvxReleaseRectangle().
Referenced by vxPublishKernels().
vx status XYZOutputValidator ( vx node node, vx uint32 index, vx meta format t ∗ ptr )
An example output parameter validator.Parameters
in node The handle to the node.in index The index of the parameter to validate.out ptr The metadata used to check the parameter.
Returns
A vx status e enumeration.
Examples:
xyz module.c.
Definition at line 127 of file xyz module.c.References vx meta format t::dim::image::height, vx meta format t::type, VX ERROR INVALID PARAMETER-
S, VX IMAGE ATTRIBUTE FORMAT, VX IMAGE ATTRIBUTE HEIGHT, VX IMAGE ATTRIBUTE WIDTH, VX S-UCCESS, vxGetParameterByIndex(), vxQueryImage(), vxQueryParameter(), vxReleaseParameter(), and vx meta-format t::dim::image::width.
Referenced by vxPublishKernels().
Chapter 4
Data Structure Documentation
4.1 vx tiling kernel t Struct Reference
Data Fields
• vx tile block size t block• vx border mode t border• vx enum enumeration• vx tiling kernel f function• vx kernel input validate f input validator• vx char name [VX MAX KERNEL NAME]• vx neighborhood size t nbhd• vx uint32 num params• vx kernel output validate f output validator• vx param description t parameters [10]
4.1.1 Detailed Description
[publish support]
Examples:
vx tiling ext.c.
Definition at line 216 of file vx tiling ext.c.
4.1.2 Field Documentation
vx tile block size t vx tiling kernel t::block
block sizeDefinition at line 232 of file vx tiling ext.c.
vx border mode t vx tiling kernel t::border
border information.Definition at line 236 of file vx tiling ext.c.
vx enum vx tiling kernel t::enumeration
kernel enumDefinition at line 220 of file vx tiling ext.c.
vx tiling kernel f vx tiling kernel t::function
tiling function pointerDefinition at line 222 of file vx tiling ext.c.
248
CHAPTER 4. DATA STRUCTURE DOCUMENTATION 249
vx kernel input validate f vx tiling kernel t::input validator
input validatorDefinition at line 228 of file vx tiling ext.c.
vx char vx tiling kernel t::name[VX MAX KERNEL NAME]
kernel nameDefinition at line 218 of file vx tiling ext.c.
vx neighborhood size t vx tiling kernel t::nbhd
neighborhood around blockDefinition at line 234 of file vx tiling ext.c.
vx uint32 vx tiling kernel t::num params
number of parameters
Examples:
vx tiling ext.c.
Definition at line 224 of file vx tiling ext.c.
vx kernel output validate f vx tiling kernel t::output validator
output validatorDefinition at line 230 of file vx tiling ext.c.
vx param description t vx tiling kernel t::parameters[10]
set of parametersDefinition at line 226 of file vx tiling ext.c.
Chapter 5
Example Documentation
5.1 vx eyetrack.c
The example graph used to preprocess eye tracking data.
Author
Erik Rainey [email protected]
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <vx examples.h>
int example eyetracking(int argc, char *argv[]){
vx status status = VX SUCCESS;vx uint32 width = 640;vx uint32 height = 480;vx bool running = vx true e;vx context context = vxCreateContext();if (context){
vx image images[] = {vxCreateImage(context, width, height, FOURCC UYVY),vxCreateImage(context, width, height, FOURCC U8),
};
vx graph graph = vxCreateGraph(context);if (graph){
vx node nodes[] = {};
status = vxVerifyGraph(context, graph);if (status == VX SUCCESS){
do {status = vxProcessGraph(context, graph, NULL);
} while (running == vx true e);}vxReleaseGraph(&graph);
}vxReleaseContext(&context);
250
CHAPTER 5. EXAMPLE DOCUMENTATION 251
}return status;
}
5.2 vx factory corners.c
An example of a graph to pre-process image data for a Corner Registration Graph.
Author
Erik Rainey [email protected]
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <vx graph factory.h>
vx graph vxCornersGraphFactory(vx context context){
vx status status = VX SUCCESS;vx uint32 i;vx float32 strength thresh = 10000.0f;vx float32 r = 1.5f;vx float32 sensitivity = 0.14f;vx int32 window size = 3;vx int32 block size = 3;vx enum channel = VX CHANNEL Y;vx graph graph = vxCreateGraph(context);if (graph){
vx image virts[] = {vxCreateVirtualImage(context),vxCreateVirtualImage(context),
};vx kernel kernels[] = {
vxGetKernelByEnum(context,VX KERNEL CHANNEL EXTRACT),
vxGetKernelByEnum(context, VX KERNEL MEDIAN 3x3),vxGetKernelByEnum(context, VX KERNEL HARRIS CORNERS),
};vx node nodes[dimof(kernels)] = {
vxCreateNode(graph, kernels[0]),vxCreateNode(graph, kernels[1]),vxCreateNode(graph, kernels[2]),
};vx scalar scalars[] = {
vxCreateScalar(context, VX TYPE ENUM, &channel),vxCreateScalar(context, VX TYPE FLOAT32, &strength thresh),vxCreateScalar(context, VX TYPE FLOAT32, &r),vxCreateScalar(context, VX TYPE FLOAT32, &sensitivity),vxCreateScalar(context, VX TYPE INT32, &window size),vxCreateScalar(context, VX TYPE INT32, &block size),
};// Channel Extractstatus |= vxAddParameterToGraphByIndex(graph, nodes[0], 0);status |= vxSetParameterByIndex(nodes[0], 1,
VX INPUT, scalars[0]);status |= vxSetParameterByIndex(nodes[0], 2,
VX OUTPUT, virts[0]);// Median Filterstatus |= vxSetParameterByIndex(nodes[1], 0,
VX INPUT, virts[0]);
CHAPTER 5. EXAMPLE DOCUMENTATION 252
status |= vxSetParameterByIndex(nodes[1], 1,VX OUTPUT, virts[1]);// Harris Cornersstatus |= vxSetParameterByIndex(nodes[2], 0,
VX INPUT, virts[1]);status |= vxSetParameterByIndex(nodes[2], 1,
VX INPUT, scalars[1]);status |= vxSetParameterByIndex(nodes[2], 2,
VX INPUT, scalars[2]);status |= vxSetParameterByIndex(nodes[2], 3,
VX INPUT, scalars[3]);status |= vxSetParameterByIndex(nodes[2], 4,
VX INPUT, scalars[4]);status |= vxSetParameterByIndex(nodes[2], 5,
VX INPUT, scalars[5]);status |= vxAddParameterToGraphByIndex(graph, nodes[2], 6);
for (i = 0; i < dimof(scalars); i++){
vxReleaseScalar(&scalars[i]);}for (i = 0; i < dimof(virts); i++){
vxReleaseImage(&virts[i]);}for (i = 0; i < dimof(kernels); i++){
vxReleaseKernel(&kernels[i]);}for (i = 0; i < dimof(nodes);i++){
vxReleaseNode(&nodes[i]);}
}return graph;
}
5.3 vx factory edge.c
An example graph factory.
Author
Erik Rainey [email protected]
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <stdio.h>#include <VX/vx.h>#include <VX/vx helper.h>
vx graph vxEdgeGraphFactory(vx context c){
vx status status = VX FAILURE;vx graph g = 0;if (c){
vx kernel kernels[] = {vxGetKernelByEnum(c, VX KERNEL GAUSSIAN 3x3),vxGetKernelByEnum(c, VX KERNEL SOBEL 3x3),vxGetKernelByEnum(c, VX KERNEL MAGNITUDE),
};
CHAPTER 5. EXAMPLE DOCUMENTATION 253
vx image virts[] = {vxCreateVirtualImage(c), // blurredvxCreateVirtualImage(c), // gxvxCreateVirtualImage(c), // gy
};g = vxCreateGraph(c);if (g){
vx node nodes[] = {vxCreateNode(g, kernels[0]), // GaussianvxCreateNode(g, kernels[1]), // SobelvxCreateNode(g, kernels[2]), // Mag
};vx parameter params[] = {
vxGetParameterByIndex(nodes[0], 0), // input GaussianvxGetParameterByIndex(nodes[2], 2), // output Mag
};vx uint32 p = 0;status = VX SUCCESS;for (p = 0; p < dimof(params); p++){
// the parameter inherits from the node its attributesstatus |= vxAddParameterToGraph(g, params[p]);
}// configure linkage of the graphstatus |= vxSetParameterByIndex(nodes[0], 1,
VX OUTPUT, virts[0]);status |= vxSetParameterByIndex(nodes[1], 0,
VX INPUT, virts[0]);status |= vxSetParameterByIndex(nodes[1], 1,
VX OUTPUT, virts[1]);status |= vxSetParameterByIndex(nodes[1], 2,
VX OUTPUT, virts[2]);status |= vxSetParameterByIndex(nodes[2], 0,
VX INPUT, virts[1]);status |= vxSetParameterByIndex(nodes[2], 1,
VX INPUT, virts[2]);for (p = 0; p < dimof(virts); p++){
/* this just decreases the external reference count */vxReleaseImage(&virts[p]);
}if (status != VX SUCCESS){
printf("Failed to create graph in factory!\n");vxReleaseGraph(&g);g = 0;
}}
}return g;
}
5.4 vx factory pipeline.c
A simple image pipeline factory using OpenVX.
Author
Erik Rainey [email protected]
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
CHAPTER 5. EXAMPLE DOCUMENTATION 254
*/
#include <vx graph factory.h>#include <VX/vx ext xyz.h>
vx action example maximacallback(vx node node){
vx status status = VX SUCCESS;vx uint32 max intensity = 0;vx scalar maxima;vx parameter param = vxGetParameterByIndex(node, 2); // max value
status |= vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &maxima, sizeof(maxima));status |= vxAccessScalarValue(maxima, &max intensity);if (status == VX SUCCESS){
if (max intensity > 10)return VX ACTION CONTINUE;
else if (max intensity <= 10)/* edges aren’t strong enough */return VX ACTION ABANDON;
}return VX ACTION ABANDON;
}
vx graph vxPipelineGraphFactory(vx context context){
vx status status = VX SUCCESS;vx bool running = vx true e;vx uint32 i;vx uint8 lo threshold = 120;vx uint8 hi threshold = 240;vx uint32 somevalue = 10;vx uint8 max = 0;vx enum channel = VX CHANNEL Y;vx graph graph = vxCreateGraph(context);vxLoadKernels(context, "xyz");if (graph){
vx image virts[] = {vxCreateVirtualImage(context),vxCreateVirtualImageWithFormat(context,
FOURCC S16),vxCreateVirtualImageWithFormat(context,
FOURCC S16),vxCreateVirtualImageWithFormat(context,
FOURCC U8),vxCreateVirtualImage(context),vxCreateVirtualImage(context),
};vx scalar scalars[] = {
vxCreateScalar(context, VX TYPE UINT32, &somevalue),vxCreateScalar(context, VX TYPE ENUM, &channel),vxCreateScalar(context, VX TYPE UINT8, &max),
};vx kernel kernels[] = {
vxGetKernelByEnum(context,VX KERNEL CHANNEL EXTRACT),
vxGetKernelByEnum(context, VX KERNEL SOBEL 3x3),vxGetKernelByEnum(context, VX KERNEL MAGNITUDE),vxGetKernelByEnum(context, VX KERNEL MINMAXLOC),vxGetKernelByEnum(context, VX KERNEL THRESHOLD),vxGetKernelByEnum(context, VX KERNEL KHR XYZ), // some extended user
feature.};vx node nodes[dimof(kernels)];vx threshold thresh = vxCreateThreshold(context,
VX THRESHOLD TYPE BINARY);vx buffer buf = vxCreateBuffer(context, 1, 374);
vxSetThresholdAttribute(thresh,VX THRESHOLD ATTRIBUTE VALUE, &lo threshold, sizeof(lo threshold));
for (i = 0; i < dimof(nodes); i++)nodes[i] = vxCreateNode(graph, kernels[i]);
// Channel Extractstatus |= vxAddParameterToGraphByIndex(graph, nodes[0], 0);status |= vxSetParameterByIndex(nodes[0], 1,
VX INPUT, scalars[1]);status |= vxSetParameterByIndex(nodes[0], 2,
VX OUTPUT, virts[0]);// Sobel 3x3status |= vxSetParameterByIndex(nodes[1], 0,
VX INPUT, virts[0]);status |= vxSetParameterByIndex(nodes[1], 1,
VX OUTPUT, virts[1]);
CHAPTER 5. EXAMPLE DOCUMENTATION 255
status |= vxSetParameterByIndex(nodes[1], 2,VX OUTPUT, virts[2]);// Magnitudestatus |= vxSetParameterByIndex(nodes[2], 0,
VX INPUT, virts[1]);status |= vxSetParameterByIndex(nodes[2], 1,
VX INPUT, virts[2]);status |= vxSetParameterByIndex(nodes[2], 2,
VX OUTPUT, virts[3]);// MinMaxLocstatus |= vxSetParameterByIndex(nodes[3], 0,
VX INPUT, virts[3]);status |= vxSetParameterByIndex(nodes[3], 1,
VX INPUT, 0); //optionalstatus |= vxSetParameterByIndex(nodes[3], 2,
VX INPUT, scalars[2]);status |= vxSetParameterByIndex(nodes[3], 3,
VX INPUT, 0); //optionalstatus |= vxSetParameterByIndex(nodes[3], 4,
VX INPUT, 0); //optional// if the max is too low, abandon the graph.status |= vxAssignNodeCallback(nodes[3],
example maximacallback);// Thresholdstatus |= vxSetParameterByIndex(nodes[4], 0,
VX INPUT, virts[3]);status |= vxSetParameterByIndex(nodes[4], 1,
VX INPUT, thresh);status |= vxSetParameterByIndex(nodes[4], 2,
VX OUTPUT, virts[4]);// XYZstatus |= vxSetParameterByIndex(nodes[5], 0,
VX INPUT, virts[3]);status |= vxSetParameterByIndex(nodes[5], 1,
VX INPUT, scalars[0]);status |= vxAddParameterToGraphByIndex(graph, nodes[5], 2);status |= vxSetParameterByIndex(nodes[5], 3,
VX BIDIRECTIONAL, buf);
vxReleaseBuffer(&buf);vxReleaseThreshold(&thresh);for (i = 0; i < dimof(nodes); i++){
vxReleaseNode(&nodes[i]);}for (i = 0; i < dimof(nodes); i++){
vxReleaseImage(&virts[i]);}for (i = 0; i < dimof(virts); i++){
vxReleaseScalar(&scalars[i]);}for (i = 0; i < dimof(kernels); i++){
vxReleaseKernel(&kernels[i]);}
}return graph;
}
5.5 vx helper.c/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
CHAPTER 5. EXAMPLE DOCUMENTATION 256
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx.h>#include <VX/vx helper.h>#ifdef OPENVX USE LIST#include <VX/vx khr list.h>#endif#include <math.h>
vx target vxFindTarget(vx context context,vx char name[VX MAX TARGET NAME])
{vx uint32 t, targets;vx target target = 0;vx char targetName[VX MAX TARGET NAME];vxQueryContext(context, VX CONTEXT ATTRIBUTE NUMTARGETS, &
targets, sizeof(targets));for (t = 0u; t < targets; t++){
target = vxGetTargetByIndex(context,t);vxQueryTarget(target, VX TARGET ATTRIBUTE NAME, &targetName,
VX MAX TARGET NAME);if (strncmp(targetName, name, VX MAX TARGET NAME) == 0){
break;}vxReleaseTarget(&target);target = 0;
}return target;
}
vx node vxCreateNodeByStructure(vx graph graph,vx enum kernelenum,vx parameter item t *params,vx uint32 num)
{vx status status = VX SUCCESS;vx node node = 0;vx context context = vxGetContext(graph);vx kernel kernel = vxGetKernelByEnum(context, kernelenum);if (kernel){
node = vxCreateNode(graph, kernel);if (node){
vx uint32 p = 0;for (p = 0; p < num; p++){
status = vxSetParameterByIndex(node,p,params[p].direction,params[p].reference);
if (status != VX SUCCESS){
vxAddLogEntry(graph, status, "Kernel %d Parameter %u is invalid.\n",kernelenum, p);
vxReleaseNode(&node);node = 0;break;
}}
}else{
vxAddLogEntry(graph, VX ERROR INVALID PARAMETERS, "Failed to create node with kernel enum %d\n", kernelenum);
status = VX ERROR NO MEMORY;}vxReleaseKernel(&kernel);
}else{
vxAddLogEntry(graph, VX ERROR INVALID PARAMETERS, "failedto retrieve kernel enum %d\n", kernelenum);status = VX ERROR NOT SUPPORTED;
}return node;
}
void vxClearLog(vx graph graph){
char message[VX MAX LOG MESSAGE LEN];vx status status = VX SUCCESS;do {
CHAPTER 5. EXAMPLE DOCUMENTATION 257
status = vxGetLogEntry(graph, message);} while (status != VX SUCCESS);
}
vx status vxLinkParametersByIndex(vx node node a,vx enum index a, vx node node b, vx enum index b) {
vx parameter param a = vxGetParameterByIndex(node a, index a);vx parameter param b = vxGetParameterByIndex(node b, index b);vx status status = vxLinkParametersByReference(param a, param b);vxReleaseParameter(¶m a);vxReleaseParameter(¶m b);return status;
}
vx status vxLinkParametersByReference(vx parameter a, vx parameter b) {
vx status status = VX SUCCESS;vx enum dirs[2] = {0,0};vx enum types[2] = {0,0};vx reference ref = 0;
status = vxQueryParameter(a,VX PARAMETER ATTRIBUTE DIRECTION, &dirs[0], sizeof(dirs[0]));
if (status != VX SUCCESS)return status;
status = vxQueryParameter(b,VX PARAMETER ATTRIBUTE DIRECTION, &dirs[1], sizeof(dirs[1]));
if (status != VX SUCCESS)return status;
status = vxQueryParameter(a, VX PARAMETER ATTRIBUTE TYPE, &types[0], sizeof(types[0]));if (status != VX SUCCESS)
return status;
status = vxQueryParameter(b, VX PARAMETER ATTRIBUTE TYPE, &types[1], sizeof(types[1]));if (status != VX SUCCESS)
return status;
if (types[0] == types[1]){
if ((dirs[0] == VX OUTPUT || dirs[0] == VX BIDIRECTIONAL) && dirs[1] ==VX INPUT)
{status = vxQueryParameter(a, VX PARAMETER ATTRIBUTE REF, &ref, sizeof(ref));if (status != VX SUCCESS)
return status;status = vxSetParameterByReference(b, ref);
}else if ((dirs[1] == VX OUTPUT || dirs[1] == VX BIDIRECTIONAL) && dirs[0]
== VX INPUT){
status = vxQueryParameter(b, VX PARAMETER ATTRIBUTE REF, &ref, sizeof(ref));if (status != VX SUCCESS)
return status;status = vxSetParameterByReference(a, ref);
}else
status = VX ERROR INVALID LINK;}return status;
}
vx status vxSetAffineRotationMatrix(vx matrix matrix,vx float32 angle,vx float32 scale,vx float32 center x,vx float32 center y)
{vx status status = VX FAILURE;vx float32 mat[3][2];vx size columns = 0ul, rows = 0ul;vx enum type = 0;vxQueryMatrix(matrix, VX MATRIX ATTRIBUTE COLUMNS, &columns,sizeof(columns));
vxQueryMatrix(matrix, VX MATRIX ATTRIBUTE ROWS, &rows, sizeof(rows));
vxQueryMatrix(matrix, VX MATRIX ATTRIBUTE TYPE, &type, sizeof(type));
if ((columns == 2) && (rows == 3) && (type == VX TYPE FLOAT32)){
status = vxAccessMatrix(matrix, mat);if (status == VX SUCCESS){
vx float32 radians = (angle / 360.0f) * (VX TAU);vx float32 a = scale * cos(radians);
CHAPTER 5. EXAMPLE DOCUMENTATION 258
vx float32 b = scale * sin(radians);mat[0][0] = a;mat[1][0] = b;mat[2][0] = ((1.0f - a) * center x) - (b * center y);mat[0][1] = -b;mat[1][1] = a;mat[2][1] = (b * center x) + ((1.0f - a) * center y);status = vxCommitMatrix(matrix, mat);
}}else{
vxAddLogEntry(matrix, status, "Failed to set affine matrix due to type or dimensionmismatch!\n");
}return status;
}
#ifdef OPENVX KHR LISTvx enum vxHarrisScoreSorter(vx reference a, vx reference b){
vx keypoint ca = (vx keypoint)a;vx keypoint cb = (vx keypoint)b;vx keypoint t kpa, *pkpa = &kpa;vx keypoint t kpb, *pkpb = &kpb;vx enum cmp = VX COMPARE UNKNOWN;if ((vxAccessKeypoint(ca, &pkpa) == VX SUCCESS) &&
(vxAccessKeypoint(cb, &pkpb) == VX SUCCESS)){
if (kpa.strength < kpb.strength)cmp = VX COMPARE LT;
else if (kpa.strength == kpb.strength)cmp = VX COMPARE EQ;
else if (kpa.strength > kpb.strength)cmp = VX COMPARE GT;
vxCommitKeypoint(ca, pkpa);vxCommitKeypoint(cb, pkpb);
}if (cmp == VX COMPARE UNKNOWN){
vxAddLogEntry(a, VX ERROR INVALID REFERENCE, "FATAL:References given to list sorter are not desired type!\n");
}return cmp;
}#endif
vx status vxAlterRectangle(vx rectangle rect,vx int32 dsx,vx int32 dsy,vx int32 dex,vx int32 dey)
{vx uint32 sx, sy, ex, ey;if (vxAccessRectangleCoordinates(rect, &sx, &sy, &ex, &ey) ==
VX SUCCESS){
sx += dsx;sy += dsy;ex += dex;ey += dey;return vxCommitRectangleCoordinates(rect, sx, sy, ex, ey);
}return VX ERROR INVALID REFERENCE;
}
vx status vxAddParameterToGraphByIndex(vx graph g, vx node n, vx uint32 index)
{vx parameter p = vxGetParameterByIndex(n, index);vx status status = vxAddParameterToGraph(g, p);vxReleaseParameter(&p);return status;
}
5.6 vx parameters.c
Author
Erik Rainey [email protected]
/** Copyright (c) 2012-2013 The Khronos Group Inc.
*
CHAPTER 5. EXAMPLE DOCUMENTATION 259
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx.h>
void example explore parameters(vx context context, vx kernel kernel){
vx uint32 p, numParams = 0;vx node node = vxCreateNode(context, kernel);vxQueryKernel(kernel, VX KERNEL ATTRIBUTE NUMPARAMS, &numParams, sizeof(numParams));
for (p = 0; p < numParams; p++){
vx parameter param = vxGetParameterByIndex(node, p);vx reference ref;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &ref, sizeof(ref));if (ref){
vx enum type;vxQueryParameter(param, VX PARAMETER ATTRIBUTE TYPE, &type, sizeof(type));/* cast the ref to the correct vx <type>. Atomics are now vx scalar */
}vxReleaseParameter(¶m);
}vxReleaseNode(&node);
}
5.7 vx tiling add.c/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx khr tiling.h>
void add image tiling(void * VX RESTRICT parameters[VX RESTRICT],void * VX RESTRICT tile memory,vx size tile memory size)
{vx uint32 i,j;vx tile t *in0 = (vx tile t *)parameters[0];vx tile t *in1 = (vx tile t *)parameters[1];vx tile t *out = (vx tile t *)parameters[2];
for (j = 0u; j < vxTileHeight(out,0); j+=vxTileBlockHeight(out)){
for (i = 0u; i < vxTileWidth(out,0); i+=vxTileBlockWidth(out)){
/* this math happens to cover a 1x1 block and has no neighborhood */
CHAPTER 5. EXAMPLE DOCUMENTATION 260
vx uint16 pixel = vxImagePixel(vx uint8, in0, 0, i, j, 0, 0) +vxImagePixel(vx uint8, in1, 0, i, j, 0, 0);
if (pixel > INT16 MAX)pixel = INT16 MAX;
vxImagePixel(vx int16, out, 0, i, j, 0, 0) = (vx int16)pixel;}
}}
5.8 vx tiling alpha.c/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx khr tiling.h>
void alpha image tiling(void * VX RESTRICT parameters[VX RESTRICT],void * VX RESTRICT tile memory,vx size tile memory size)
{vx uint32 i,j;vx tile t *in = (vx tile t *)parameters[0];vx float32 *alpha = (vx float32 *)parameters[1];vx tile t *out = (vx tile t *)parameters[2];
for (j = 0u; j < vxTileHeight(in, 0); j+=vxTileBlockHeight(in)){
for (i = 0u; i < vxTileWidth(in, 0); i+=vxTileBlockWidth(in)){
vx uint8 pixel = vxImagePixel(vx uint8, in, 0, i, j, 0, 0);vx uint8 coeff = 255 * (*alpha);vx uint16 value = (coeff * pixel) >> 8;if (value > 255)
value = 255;vxImagePixel(vx uint8, out, 0, i, j, 0, 0) = (vx uint8)value;
}}
}
5.9 vx tiling box.c/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
CHAPTER 5. EXAMPLE DOCUMENTATION 261
*/
#include <stdio.h>#include <VX/vx khr tiling.h>
void box image tiling(void * VX RESTRICT parameters[VX RESTRICT],void * VX RESTRICT tile memory,vx size tile memory size)
{vx uint32 x, y;vx tile t *in = (vx tile t *)parameters[0];vx tile t *out = (vx tile t *)parameters[1];
for (y = 0; y < vxTileHeight(out, 0); y+=vxTileBlockHeight(out)){
for (x = 0; x < vxTileWidth(out, 0); x+=vxTileBlockWidth(out)){
vx int32 j, i;vx uint32 sum = 0;vx uint32 count = 0;/* these loops can handle 3x3, 5x5, etc. since block size would be 1x1 */for (j = vxNeighborhoodTop(in); j < vxNeighborhoodBottom(in); j++){
for (i = vxNeighborhoodLeft(in); i < vxNeighborhoodRight(in); i++){
sum += vxImagePixel(vx uint8, in, 0, x, y, i, j);count++;
}}sum /= count;if (sum > 255)
sum = 255;vxImagePixel(vx uint8, out, 0, x, y, 0, 0) = (vx uint8)sum;
}}
}
5.10 vx tiling ext.c/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <stdio.h>#include <VX/vx khr tiling.h>#include <VX/vx helper.h>#define VX TILING EXT INTERNAL#include "vx tiling ext.h"
#ifndef dimof#define dimof(x) (sizeof(x)/sizeof(x[0]))#endif
static vx status vxFilterInputValidator(vx node node, vx uint32 index){
vx status status = VX ERROR INVALID PARAMETERS;if (index == 0){
vx parameter param = vxGetParameterByIndex(node, index);if (param){
vx image input = 0;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &input, sizeof(input));if (input){
CHAPTER 5. EXAMPLE DOCUMENTATION 262
vx fourcc format = 0;vxQueryImage(input, VX IMAGE ATTRIBUTE FORMAT, &format
, sizeof(format));if (format == FOURCC U8){
status = VX SUCCESS;}
}vxReleaseParameter(¶m);
}}return status;
}
static vx status vxFilterOutputValidator(vx node node, vx uint32 index,vx meta format t *ptr)
{vx status status = VX ERROR INVALID PARAMETERS;if (index == 1){
vx parameter param = vxGetParameterByIndex(node, 0); /* wereference an input image */if (param){
vx image input = 0;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &input, sizeof(input));if (input){
vx uint32 width = 0, height = 0;vxQueryImage(input, VX IMAGE ATTRIBUTE WIDTH, &width,
sizeof(width));vxQueryImage(input, VX IMAGE ATTRIBUTE HEIGHT, &height
, sizeof(height));ptr->type = VX TYPE IMAGE;ptr->dim.image.format = FOURCC U8;ptr->dim.image.width = width;ptr->dim.image.height = height;status = VX SUCCESS;
}vxReleaseParameter(¶m);
}}return status;
}
static vx status vxAddInputValidator(vx node node, vx uint32 index){
vx status status = VX ERROR INVALID PARAMETERS;if ((index == 0) || (index == 1)){
vx parameter param = vxGetParameterByIndex(node, index);if (param){
vx image input = 0;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &input, sizeof(input));if (input){
vx fourcc format = 0;vxQueryImage(input, VX IMAGE ATTRIBUTE FORMAT, &format
, sizeof(format));if (format == FOURCC U8){
status = VX SUCCESS;}
}vxReleaseParameter(¶m);
}}return status;
}
static vx status vxAddOutputValidator(vx node node, vx uint32 index,vx meta format t *ptr)
{vx status status = VX ERROR INVALID PARAMETERS;if (index == 2){
vx parameter param = vxGetParameterByIndex(node, 0); /* wereference an input image */if (param){
vx image input = 0;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &input, sizeof(input));if (input){
vx uint32 width = 0, height = 0;vxQueryImage(input, VX IMAGE ATTRIBUTE WIDTH, &width,
CHAPTER 5. EXAMPLE DOCUMENTATION 263
sizeof(width));vxQueryImage(input, VX IMAGE ATTRIBUTE HEIGHT, &height
, sizeof(height));ptr->type = VX TYPE IMAGE;ptr->dim.image.format = FOURCC S16;ptr->dim.image.width = width;ptr->dim.image.height = height;status = VX SUCCESS;
}vxReleaseParameter(¶m);
}}return status;
}
static vx status vxAlphaInputValidator(vx node node, vx uint32 index){
vx status status = VX ERROR INVALID PARAMETERS;if (index == 0){
vx parameter param = vxGetParameterByIndex(node, index);if (param){
vx image input = 0;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &input, sizeof(input));if (input){
vx fourcc format = 0;vxQueryImage(input, VX IMAGE ATTRIBUTE FORMAT, &format
, sizeof(format));if (format == FOURCC U8){
status = VX SUCCESS;}
}vxReleaseParameter(¶m);
}}else if (index == 1){
vx parameter param = vxGetParameterByIndex(node, index);if (param){
vx scalar scalar = 0;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &scalar, sizeof(scalar));if (scalar){
vx enum type = 0;vxQueryScalar(scalar, VX SCALAR ATTRIBUTE TYPE, &type,
sizeof(type));if (type == VX TYPE FLOAT32){
status = VX SUCCESS;}
}vxReleaseParameter(¶m);
}}return status;
}
static vx status vxAlphaOutputValidator(vx node node, vx uint32 index,vx meta format t *ptr)
{vx status status = VX ERROR INVALID PARAMETERS;if (index == 2){
vx parameter param = vxGetParameterByIndex(node, 0); /* wereference an input image */if (param){
vx image input = 0;vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &input, sizeof(input));if (input){
vx uint32 width = 0, height = 0;vxQueryImage(input, VX IMAGE ATTRIBUTE WIDTH, &width,
sizeof(width));vxQueryImage(input, VX IMAGE ATTRIBUTE HEIGHT, &height
, sizeof(height));ptr->type = VX TYPE IMAGE;ptr->dim.image.format = FOURCC U8;ptr->dim.image.width = width;ptr->dim.image.height = height;status = VX SUCCESS;
}vxReleaseParameter(¶m);
CHAPTER 5. EXAMPLE DOCUMENTATION 264
}}return status;
}
typedef struct vx tiling kernel t {vx char name[VX MAX KERNEL NAME];vx enum enumeration;vx tiling kernel f function;vx uint32 num params;vx param description t parameters[10];vx kernel input validate f input validator;vx kernel output validate f output validator;vx tile block size t block;vx neighborhood size t nbhd;vx border mode t border;
} vx tiling kernel t;
static vx tiling kernel t tiling kernels[] = {{"org.khronos.openvx.tiling gaussian 3x3",VX KERNEL GAUSSIAN 3x3 TILING,gaussian image tiling,2,{{VX INPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED},{VX OUTPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED}},vxFilterInputValidator,vxFilterOutputValidator,{1, 1},{-1, 1,-1, 1},{VX BORDER MODE UNDEFINED, 0},
},{"org.khronos.openvx.tiling alpha",VX KERNEL ALPHA TILING,alpha image tiling,3,{{VX INPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED},{VX INPUT, VX TYPE SCALAR,
VX PARAMETER STATE REQUIRED},{VX OUTPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED}},vxAlphaInputValidator,vxAlphaOutputValidator,{1, 1},{0, 0, 0, 0},{VX BORDER MODE UNDEFINED, 0},
},{"org.khronos.openvx.tiling box MxN",VX KERNEL BOX MxN TILING,box image tiling,2,{{VX INPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED},{VX OUTPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED}},vxFilterInputValidator,vxFilterOutputValidator,{1, 1},{-1, 1, -1, 1},{VX BORDER MODE UNDEFINED, 0},
},{"org.khronos.openvx.tiling add",VX KERNEL ADD TILING,add image tiling,3,{{VX INPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED},{VX INPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED},{VX OUTPUT, VX TYPE IMAGE,
VX PARAMETER STATE REQUIRED}},vxAddInputValidator,vxAddOutputValidator,{1, 1},{0, 0, 0, 0},{VX BORDER MODE UNDEFINED, 0},
},};vx status vxPublishKernels(vx context context){
vx status status = VX SUCCESS;vx uint32 k = 0;for (k = 0; k < dimof(tiling kernels); k++){
CHAPTER 5. EXAMPLE DOCUMENTATION 265
vx kernel kernel = vxAddTilingKernel(context,tiling kernels[k].name,tiling kernels[k].enumeration,tiling kernels[k].function,tiling kernels[k].num params,tiling kernels[k].input validator,tiling kernels[k].output validator);
if (kernel){
vx uint32 p = 0;for (p = 0; p < tiling kernels[k].num params; p++){
status |= vxAddParameterToKernel(kernel, p,tiling kernels[k].parameters[p].direction,tiling kernels[k].parameters[p].type,tiling kernels[k].parameters[p].state);
}status |= vxSetKernelAttribute(kernel,
VX KERNEL ATTRIBUTE INPUT NEIGHBORHOOD, &tiling kernels[k].nbhd, sizeof(vx neighborhood size t));status |= vxSetKernelAttribute(kernel,
VX KERNEL ATTRIBUTE OUTPUT TILE BLOCK SIZE, &tiling kernels[k].block, sizeof(vx tile block size t));status |= vxSetKernelAttribute(kernel, VX KERNEL ATTRIBUTE BORDER, &
tiling kernels[k].border, sizeof(vx border mode t));if (status != VX SUCCESS){
vxRemoveKernel(kernel);}else{
status = vxFinalizeKernel(kernel);}if (status != VX SUCCESS){
printf("Failed to publish kernel %s\n", tiling kernels[k].name);break;
}}
}return status;
}
5.11 vx tiling gaussian.c/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx khr tiling.h>
void gaussian image tiling(void * VX RESTRICT parameters[VX RESTRICT],void * VX RESTRICT tile memory,vx size tile memory size)
{vx uint32 x, y;vx tile t *in = (vx tile t *)parameters[0];vx tile t *out = (vx tile t *)parameters[1];
for (y = 0; y < vxTileHeight(out, 0); y += vxTileBlockHeight(out)){
for (x = 0; x < vxTileWidth(out, 0); x += vxTileBlockWidth(out)){
vx uint32 sum = 0;/* this math covers a {-1,1},{-1,1} neighborhood and a block of 1x1.
* an internal set of for loop could have been placed here instead.
*/
CHAPTER 5. EXAMPLE DOCUMENTATION 266
sum += vxImagePixel(vx uint8, in, 0, x, y, -1, -1);sum += vxImagePixel(vx uint8, in, 0, x, y, 0, -1) << 1;sum += vxImagePixel(vx uint8, in, 0, x, y, +1, -1);sum += vxImagePixel(vx uint8, in, 0, x, y, -1, 0) << 1;sum += vxImagePixel(vx uint8, in, 0, x, y, 0, 0) << 2;sum += vxImagePixel(vx uint8, in, 0, x, y, +1, 0) << 1;sum += vxImagePixel(vx uint8, in, 0, x, y, -1, +1);sum += vxImagePixel(vx uint8, in, 0, x, y, 0, +1) << 1;sum += vxImagePixel(vx uint8, in, 0, x, y, +1, +1);sum >>= 4;if (sum > 255)
sum = 255;vxImagePixel(vx uint8, out, 0, x, y, 0, 0) = (vx uint8)sum;
}}
}
5.12 vx tiling main.c/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <stdio.h>#include <VX/vx.h>#include <VX/vx khr tiling.h>#include <VX/vx ext debug.h>#include <VX/vx helper.h>#include "vx tiling ext.h"
vx node vxTilingAddNode(vx graph graph, vx image in0,vx image in1, vx image out)
{vx parameter item t params[] = {
{VX INPUT, in0},{VX INPUT, in1},{VX OUTPUT, out},
};return vxCreateNodeByStructure(graph,
VX KERNEL ADD TILING,params,dimof(params));
}
vx node vxTilingAlphaNode(vx graph graph, vx image in,vx scalar alpha, vx image out)
{vx parameter item t params[] = {
{VX INPUT, in},{VX INPUT, alpha},{VX OUTPUT, out},
};return vxCreateNodeByStructure(graph,
VX KERNEL ALPHA TILING,params,dimof(params));
}
vx node vxTilingBoxNode(vx graph graph, vx image in,vx image out, vx uint32 width, vx uint32 height)
{vx parameter item t params[] = {
{VX INPUT, in},{VX OUTPUT, out},
CHAPTER 5. EXAMPLE DOCUMENTATION 267
};vx node node = vxCreateNodeByStructure(graph,
VX KERNEL BOX MxN TILING,params,dimof(params));
if (node && (width&1) && (height&1)){
vx neighborhood size t nbhd;vxQueryNode(node, VX NODE ATTRIBUTE INPUT NEIGHBORHOOD, &nbhd, sizeof(nbhd));nbhd.left = -((width - 1)/2);nbhd.right = ((width - 1)/2);nbhd.top = -((height - 1)/2);nbhd.bottom = ((height - 1)/2);vxSetNodeAttribute(node, VX NODE ATTRIBUTE INPUT NEIGHBORHOOD, &nbhd, sizeof(nbhd
));}return node;
}
vx node vxTilingGaussianNode(vx graph graph, vx image in,vx image out)
{vx parameter item t params[] = {
{VX INPUT, in},{VX OUTPUT, out},
};return vxCreateNodeByStructure(graph,
VX KERNEL GAUSSIAN 3x3 TILING,params,dimof(params));
}
int main(int argc, char *argv[]){
vx status status = VX SUCCESS;vx context context = vxCreateContext();if (context){
vx rectangle rect = vxCreateRectangle(context, 1, 1, 513, 513); //512x512vx uint32 i = 0;vx image images[] = {
vxCreateImage(context, 514, 514, FOURCC U8), // 0:inputvxCreateImageFromROI(images[0], rect), // 1:ROI inputvxCreateImage(context, 512, 512, FOURCC U8), // 2:boxvxCreateImage(context, 512, 512, FOURCC U8), // 3:gaussianvxCreateImage(context, 512, 512, FOURCC U8), // 4:alphavxCreateImage(context, 512, 512, FOURCC S16),// 5:add
};vx float32 a = 0.5f;vx scalar alpha = vxCreateScalar(context, VX TYPE FLOAT32, &a);status |= vxLoadKernels(context, "openvx-tiling");status |= vxLoadKernels(context, "openvx-debug");if (status == VX SUCCESS){
vx graph graph = vxCreateGraph(context);if (graph){
vx node nodes[] = {vxFReadImageNode(graph, "lena 512x512.pgm", images[1]),vxTilingBoxNode(graph, images[1], images[2], 5, 5),vxFWriteImageNode(graph, images[2], "ot box lena 512x512.pgm"),vxTilingGaussianNode(graph, images[1], images[3]),vxFWriteImageNode(graph, images[3], "ot gauss lena 512x512.pgm"),vxTilingAlphaNode(graph, images[1], alpha, images[4]),vxFWriteImageNode(graph, images[4], "ot alpha lena 512x512.pgm"),vxTilingAddNode(graph, images[1], images[4], images[5]),vxFWriteImageNode(graph, images[5], "ot add lena 512x512.pgm"),
};for (i = 0; i < dimof(nodes); i++){
if (nodes[i] == 0){
printf("Failed to create node[%u]\n", i);status = VX ERROR INVALID NODE;break;
}}if (status == VX SUCCESS){
status = vxVerifyGraph(graph);if (status == VX SUCCESS){
status = vxProcessGraph(graph);}
}for (i = 0; i < dimof(nodes); i++)
CHAPTER 5. EXAMPLE DOCUMENTATION 268
{vxReleaseNode(&nodes[i]);
}vxReleaseGraph(&graph);
}}for (i = 0; i < dimof(images); i++){
vxReleaseImage(&images[i]);}vxReleaseRectangle(&rect);vxReleaseContext(&context);
}printf("%s::main() returns = %d\n", argv[0], status);return (int)status;
}
5.13 vx xyz ext.c
An example of how to write a user mode extension to OpenVX.
Author
Erik Rainey [email protected]
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx.h>#include <VX/vx ext xyz.h>#include <VX/vx helper.h>
vx node vxXYZNode(vx graph graph, vx image input,vx uint32 value, vx image output, vx buffer temp)
{vx uint32 i;vx node node = 0;vx context context = vxGetContext(graph);vx status status = vxLoadKernels(context, "xyz");if (status == VX SUCCESS){
vx kernel kernel = vxGetKernelByName(context, "org.khronos.example.xyz");if (kernel){
node = vxCreateNode(graph, kernel);if (node){
vx status statuses[4];vx scalar scalar = vxCreateScalar(context,
VX TYPE INT32, &value);statuses[0] = vxSetParameterByIndex(node, 0,
VX INPUT, input);statuses[1] = vxSetParameterByIndex(node, 1,
VX INPUT, scalar);statuses[2] = vxSetParameterByIndex(node, 2,
VX OUTPUT, output);statuses[3] = vxSetParameterByIndex(node, 3,
VX BIDIRECTIONAL, temp);for (i = 0; i < dimof(statuses); i++){
if (statuses[i] != VX SUCCESS){
status = VX ERROR INVALID PARAMETERS;
CHAPTER 5. EXAMPLE DOCUMENTATION 269
vxReleaseNode(&node);vxReleaseKernel(&kernel);node = 0;kernel = 0;break;
}}
}else{
vxReleaseKernel(&kernel);}
}}return node;
}
vx status vxuXYZ(vx image input, vx uint32 value,vx image output, vx buffer temp)
{vx context context = vxGetContext(input);vx status status = VX FAILURE;vx graph graph = vxCreateGraph(context);if (graph){
vx node node = vxXYZNode(graph, input, value, output, temp);if (node){
status = vxVerifyGraph(graph);if (status == VX SUCCESS){
status = vxProcessGraph(graph);}vxReleaseNode(&node);
}vxReleaseGraph(&graph);
}return status;
}
5.14 xyz module.c
An example implementation of a User Extension to OpenVX.
Author
Erik Rainey [email protected]
/** Copyright (c) 2012-2013 The Khronos Group Inc.
** Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and/or associated documentation files (the
* "Materials"), to deal in the Materials without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Materials, and to
* permit persons to whom the Materials are furnished to do so, subject to
* the following conditions:
** The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Materials.
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
#include <VX/vx.h>#include <VX/vx ext xyz.h>#include <stdarg.h>
typedef enum xyz params e {XYZ PARAM INPUT = 0,XYZ PARAM VALUE,XYZ PARAM OUTPUT,XYZ PARAM TEMP
} xyz params e;
CHAPTER 5. EXAMPLE DOCUMENTATION 270
vx status XYZInputValidator(vx node node,vx uint32 index)
{vx status status = VX ERROR INVALID PARAMETERS;vx parameter param = vxGetParameterByIndex(node, index);if (index == XYZ PARAM INPUT){
vx image image;vx fourcc fourcc = 0;if (vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &image, sizeof(
vx image)) == VX SUCCESS &&vxQueryImage(image, VX IMAGE ATTRIBUTE FORMAT, &fourcc,
sizeof(fourcc)) == VX SUCCESS){
if (fourcc == FOURCC U8)status = VX SUCCESS;
elsestatus = VX ERROR INVALID VALUE;
}}else if (index == XYZ PARAM VALUE){
vx scalar scalar = 0;vx enum type = 0;vx int32 value = 0;if (vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &scalar, sizeof(scalar)) ==
VX SUCCESS &&vxQueryScalar(scalar, VX SCALAR ATTRIBUTE TYPE, &type,
sizeof(type)) == VX SUCCESS &&type == VX TYPE INT32 &&vxAccessScalarValue(scalar, &value) == VX SUCCESS)
{if (XYZ VALUE MIN < value && value < XYZ VALUE MAX){
status = VX SUCCESS;}else{
status = VX ERROR INVALID VALUE;}
}}else if (index == XYZ PARAM TEMP){
vx buffer temp;vx size size = 0;if (vxQueryParameter(param, VX PARAMETER ATTRIBUTE REF, &temp, sizeof(temp)) ==
VX SUCCESS &&vxQueryBuffer(temp, VX BUFFER ATTRIBUTE SIZE, &size,
sizeof(size)) == VX SUCCESS){
if (size >= XYZ TEMP SIZE)status = VX SUCCESS;
elsestatus = VX ERROR INVALID DIMENSION;
}}vxReleaseParameter(¶m);return status;
}
vx status XYZOutputValidator(vx node node,vx uint32 index, vx meta format t *ptr)
{vx status status = VX ERROR INVALID PARAMETERS;if (index == XYZ PARAM OUTPUT){
vx parameter in0 = vxGetParameterByIndex(node, XYZ PARAM INPUT);vx image input;if (vxQueryParameter(in0, VX PARAMETER ATTRIBUTE REF, &input, sizeof(
vx image)) == VX SUCCESS){
vxQueryImage(input, VX IMAGE ATTRIBUTE FORMAT, &ptr->type, sizeof(ptr->type));
vxQueryImage(input, VX IMAGE ATTRIBUTE WIDTH, &ptr->dim.image.width, sizeof(ptr->dim.image.width));
vxQueryImage(input, VX IMAGE ATTRIBUTE HEIGHT, &ptr->dim.image.height, sizeof(ptr->dim.image.height));
status = VX SUCCESS;}vxReleaseParameter(&in0);
}return status;
}
vx status XYZKernel(vx node node, vx reference *parameters,vx uint32 num)
CHAPTER 5. EXAMPLE DOCUMENTATION 271
{vx status status = VX ERROR INVALID PARAMETERS;if (num == 4){
vx image input = (vx image)parameters[0];vx scalar scalar = (vx scalar)parameters[1];vx image output = (vx image)parameters[2];vx buffer temp = (vx buffer)parameters[3];void *buf, *in, *out;vx uint32 us = 0, nu = 0, y, x;vx int32 value = 0;vx imagepatch addressing t addr1, addr2;vx rectangle rect = 0;
status = VX SUCCESS;
status |= vxAccessScalarValue(scalar, &value);rect = vxGetValidRegionImage(input);status |= vxAccessImagePatch(input, rect, 0, &addr1, &in);status |= vxAccessImagePatch(output, rect, 0, &addr2, &out);status |= vxQueryBuffer(temp, VX BUFFER ATTRIBUTE NUMUNITS
, &nu, sizeof(nu));status |= vxQueryBuffer(temp, VX BUFFER ATTRIBUTE UNITSIZE
, &us, sizeof(us));status |= vxAccessBufferRange(temp, 0, nu, &buf);for (y = 0; y < addr1.dim y; y+=addr1.step y){
for (x = 0; x < addr1.dim x; x+=addr1.step x){
// do some operation...}
}// write back and releasestatus |= vxCommitBufferRange(temp, 0, nu, buf);status |= vxCommitImagePatch(output, rect, 0, &addr2, out);status |= vxCommitImagePatch(input, 0, 0, &addr1, in); // don’t write back into
the inputvxReleaseRectangle(&rect);
}return status;
}
vx status XYZInitialize(vx node node, vx reference *parameters,vx uint32 num)
{/* XYZ requires no initialization of memory or resources */return VX SUCCESS;
}
vx status XYZDeinitialize(vx node node,vx reference *parameters, vx uint32 num)
{/* XYZ requires no de-initialization of memory or resources */return VX SUCCESS;
}
//**********************************************************************// PUBLIC FUNCTION//**********************************************************************
vx status vxPublishKernels(vx context context){
vx status status = VX SUCCESS;vx kernel kernel = vxAddKernel(context,
"org.khronos.example.xyz",VX KERNEL KHR XYZ,XYZKernel,4,XYZInputValidator,XYZOutputValidator,XYZInitialize,XYZDeinitialize);
if (kernel){
vx size size = XYZ DATA AREA;status = vxAddParameterToKernel(kernel, 0,
VX INPUT, VX TYPE IMAGE, VX PARAMETER STATE REQUIRED);if (status != VX SUCCESS) goto exit;status = vxAddParameterToKernel(kernel, 1,
VX INPUT, VX TYPE INT32, VX PARAMETER STATE REQUIRED);if (status != VX SUCCESS) goto exit;status = vxAddParameterToKernel(kernel, 2,
VX OUTPUT, VX TYPE IMAGE, VX PARAMETER STATE REQUIRED);if (status != VX SUCCESS) goto exit;status = vxAddParameterToKernel(kernel, 3,
VX BIDIRECTIONAL, VX TYPE BUFFER,VX PARAMETER STATE REQUIRED);
CHAPTER 5. EXAMPLE DOCUMENTATION 272
if (status != VX SUCCESS) goto exit;status = vxSetKernelAttribute(kernel,
VX KERNEL ATTRIBUTE LOCAL DATA SIZE, &size, sizeof(size));if (status != VX SUCCESS) goto exit;status = vxFinalizeKernel(kernel);if (status != VX SUCCESS) goto exit;
}exit:
if (status != VX SUCCESS) {vxRemoveKernel(kernel);
}return status;
}
Bibliography
[1] Jean-Yves Bouguet. Pyramidal implementation of the lucas kanade feature tracker description of the algorithm,2000. 221
[2] J Canny. A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell., 8(6):679–698,June 1986. 210
[3] Edward Rosten and Tom Drummond. Machine learning for high-speed corner detection. In European Confer-ence on Computer Vision, volume 1, pages 430–443, May 2006. 219
[4] Edward Rosten, Reid Porter, and Tom Drummond. Faster and better: A machine learning approach to cornerdetection. IEEE Trans. Pattern Analysis and Machine Intelligence, 32:105–119, 2010. 219
273
Index
blockvx tiling kernel t, 248
bordervx tiling kernel t, 248
enumerationvx tiling kernel t, 248
Example: User Defined Kernel, 244vxPublishKernels, 244XYZDeinitialize, 245XYZInitialize, 245XYZInputValidator, 246XYZKernel, 246XYZOutputValidator, 247xyz params e, 244
FOURCC IYUVOpenVX Types, 233
FOURCC NV12OpenVX Types, 233
FOURCC NV21OpenVX Types, 233
FOURCC RGBOpenVX Types, 233
FOURCC RGBXOpenVX Types, 233
FOURCC S16OpenVX Types, 234
FOURCC S32OpenVX Types, 234
FOURCC U16OpenVX Types, 233
FOURCC U32OpenVX Types, 234
FOURCC U8OpenVX Types, 233
FOURCC UYVYOpenVX Types, 233
FOURCC VIRTOpenVX Types, 233
FOURCC YUV4OpenVX Types, 233
FOURCC YUYVOpenVX Types, 233
factoriesOpenVX Examples, 243
Framework: DirectiveVX DIRECTIVE DISABLE LOGGING, 140VX DIRECTIVE ENABLE LOGGING, 140
Framework: Hint
VX HINT SERIALIZE, 138Framework: Directive, 140
vx directive e, 140vxDirective, 140
Framework: Hint, 138vx hint e, 138vxHint, 138
Framework: Log, 101vxAddLogEntry, 101vxGetLogEntry, 101
Framework: Performance Measurement, 149Framework: Users Supplied Nodes, 142
vx kernel deinitialize f, 143vx kernel f, 143vx kernel initialize f, 143vx kernel input validate f, 143vx kernel output validate f, 144vx publish kernels f, 144vxAddKernel, 145vxAddParameterToKernel, 145vxFinalizeKernel, 146vxLoadKernels, 146vxRemoveKernel, 147vxSetKernelAttribute, 147
functionvx tiling kernel t, 248
input validatorvx tiling kernel t, 248
Kernel: Canny Edge DetectorVX NORM L1, 211VX NORM L2, 211
Kernel: Absolute Difference, 174vxAbsDiffNode, 174vxuAbsDiff, 174
Kernel: Accumulate, 189vxAccumulateImageNode, 189vxuAccumulateImage, 189
Kernel: Accumulate Squared, 192vxAccumulateSquareImageNode, 192vxuAccumulateSquareImage, 192
Kernel: Accumulate Weighted, 190vxAccumulateWeightedImageNode, 190vxuAccumulateWeightedImage, 190
Kernel: Arithmetic Addition, 204vxAddNode, 204vxuAdd, 204
Kernel: Arithmetic Subtraction, 206vxSubtractNode, 206
274
INDEX 275
vxuSubtract, 206Kernel: Bitwise And, 195
vxAndNode, 195vxuAnd, 195
Kernel: Bitwise Exclusive Or, 199vxXorNode, 199vxuXor, 199
Kernel: Bitwise Inclusive Or, 197vxOrNode, 197vxuOr, 197
Kernel: Bitwise Not, 201vxNotNode, 201vxuNot, 201
Kernel: Box Filter, 183vxBox3x3Node, 183vxuBox3x3, 183
Kernel: Canny Edge Detector, 210vx norm type e, 211vxCannyEdgeDetectorNode, 211vxuCannyEdgeDetector, 211
Kernel: Channel Combine, 161vxChannelCombineNode, 161vxuChannelCombine, 161
Kernel: Channel Extract, 159vxChannelExtractNode, 159vxuChannelExtract, 159
Kernel: Color Convert, 157vxColorConvertNode, 157vxuColorConvert, 157
Kernel: Convert Bit depth, 208vxConvertDepthNode, 208vxuConvertDepth, 209
Kernel: Custom Convolution, 185vxConvolveNode, 185vxuConvolve, 186
Kernel: Dilate Image, 181vxDilate3x3Node, 181vxuDilate3x3, 181
Kernel: Equalize Histogram, 173vxEqualizeHistNode, 173vxuEqualizeHist, 173
Kernel: Erode Image, 180vxErode3x3Node, 180vxuErode3x3, 180
Kernel: Fast Corners, 219vxFastCornersNode, 220vxuFastCorners, 220
Kernel: Gaussian Filter, 184vxGaussian3x3Node, 184vxuGaussian3x3, 184
Kernel: Harris Corners, 217vxHarrisCornersNode, 217vxuHarrisCorners, 218
Kernel: Histogram, 172vxHistogramNode, 172vxuHistogram, 172
Kernel: Image Pyramid, 187vxPyramidNode, 187
vxuPyramid, 188Kernel: Integral Image, 179
vxIntegralImageNode, 179vxuIntegralImage, 179
Kernel: Magnitude, 165vxMagnitudeNode, 165vxuMagnitude, 165
Kernel: Mean and Standard Deviation., 175vxMeanStdDevNode, 175vxuMeanStdDev, 175
Kernel: Median Filter, 182vxMedian3x3Node, 182vxuMedian3x3, 182
Kernel: Min, Max Location, 193vxMinMaxLocNode, 193vxuMinMaxLoc, 193
Kernel: Optical Flow Pyramid (LK), 221vxOpticalFlowPyrLKNode, 222vxuOpticalFlowPyrLK, 223
Kernel: Phase, 167vxPhaseNode, 167vxuPhase, 167
Kernel: Pixel-wise Multiplication, 202vxMultiplyNode, 202vxuMultiply, 202
Kernel: Remap, 225vxRemapNode, 225vxuRemap, 225
Kernel: Scale Image, 169vxScaleImageNode, 169vxuHalfScaleGaussian3x3, 170vxuScaleImage, 170
Kernel: Sobel 3x3, 163vxSobel3x3Node, 163vxuSobel3x3, 163
Kernel: TableLookup, 171vxTableLookupNode, 171vxuTableLookup, 171
Kernel: Thresholding, 177vxThresholdNode, 177vxuThreshold, 177
Kernel: Warp Affine, 213vxWarpAffineNode, 213vxuWarpAffine, 213
Kernel: Warp Perspective, 215vxWarpPerspectiveNode, 215vxuWarpPerspective, 215
namevx tiling kernel t, 249
nbhdvx tiling kernel t, 249
Node: Border ModesVX BORDER MODE CONSTANT, 227VX BORDER MODE REPLICATE, 227VX BORDER MODE UNDEFINED, 227
Node: Border Modes, 227vx border mode e, 227
num params
INDEX 276
vx tiling kernel t, 249
Object: BufferVX BUFFER ATTRIBUTE NUMUNITS, 49VX BUFFER ATTRIBUTE SIZE, 49VX BUFFER ATTRIBUTE UNITSIZE, 49
Object: ContextVX CONTEXT ATTRIBUTE CONVOLUTION MA-
XIMUM DIMENSION, 26VX CONTEXT ATTRIBUTE EXTENSIONS, 26VX CONTEXT ATTRIBUTE EXTENSIONS SIZE,
26VX CONTEXT ATTRIBUTE IMPLEMENTATION,
26VX CONTEXT ATTRIBUTE NUMKERNELS, 26VX CONTEXT ATTRIBUTE NUMMODULES, 26VX CONTEXT ATTRIBUTE NUMREFS, 26VX CONTEXT ATTRIBUTE NUMTARGETS, 26VX CONTEXT ATTRIBUTE VENDOR ID, 26VX CONTEXT ATTRIBUTE VERSION, 26VX IMPORT TYPE HOST, 27VX IMPORT TYPE NONE, 27VX TERM CRITERIA BOTH, 27VX TERM CRITERIA EPSILON, 27VX TERM CRITERIA ITERATIONS, 27
Object: ConvolutionVX CONVOLUTION ATTRIBUTE COLUMNS, 110VX CONVOLUTION ATTRIBUTE ROWS, 110VX CONVOLUTION ATTRIBUTE SCALE, 110VX CONVOLUTION ATTRIBUTE SIZE, 111
Object: CoordinatesVX COORDINATES ATTRIBUTE DIMENSIONS,
107VX COORDINATES ATTRIBUTE SIZE, 107
Object: DelayVX DELAY ATTRIBUTE COUNT, 93VX DELAY ATTRIBUTE TYPE, 93
Object: DistributionVX DISTRIBUTION ATTRIBUTE BINS, 114VX DISTRIBUTION ATTRIBUTE DIMENSIONS,
113VX DISTRIBUTION ATTRIBUTE OFFSET, 113VX DISTRIBUTION ATTRIBUTE RANGE, 113VX DISTRIBUTION ATTRIBUTE SIZE, 114VX DISTRIBUTION ATTRIBUTE WINDOW, 114
Object: GraphVX ACTION ABANDON, 72VX ACTION CONTINUE, 72VX ACTION RESTART, 72VX GRAPH ATTRIBUTE NUMNODES, 72VX GRAPH ATTRIBUTE NUMPARAMETERS, 72VX GRAPH ATTRIBUTE PERFORMANCE, 72VX GRAPH ATTRIBUTE STATUS, 72
Object: ImageVX CHANNEL RANGE FULL, 33VX CHANNEL RANGE RESTRICTED, 33VX COLOR SPACE BT601 525, 34VX COLOR SPACE BT601 625, 34VX COLOR SPACE BT709, 34
VX COLOR SPACE DEFAULT, 34VX COLOR SPACE NONE, 34VX IMAGE ATTRIBUTE FORMAT, 34VX IMAGE ATTRIBUTE HEIGHT, 34VX IMAGE ATTRIBUTE PLANES, 34VX IMAGE ATTRIBUTE RANGE, 34VX IMAGE ATTRIBUTE SIZE, 34VX IMAGE ATTRIBUTE SPACE, 34VX IMAGE ATTRIBUTE WIDTH, 34
Object: KernelVX KERNEL ABSDIFF, 58VX KERNEL ACCUMULATE, 60VX KERNEL ACCUMULATE SQUARE, 60VX KERNEL ACCUMULATE WEIGHTED, 60VX KERNEL ADD, 62VX KERNEL AND, 61VX KERNEL ATTRIBUTE ENUM, 56VX KERNEL ATTRIBUTE LOCAL DATA PTR, 56VX KERNEL ATTRIBUTE LOCAL DATA SIZE, 56VX KERNEL ATTRIBUTE NAME, 56VX KERNEL ATTRIBUTE NUMPARAMS, 56VX KERNEL BOX 3x3, 59VX KERNEL CANNY EDGE DETECTOR, 61VX KERNEL CHANNEL COMBINE, 57VX KERNEL CHANNEL EXTRACT, 56VX KERNEL COLOR CONVERT, 56VX KERNEL CONVERTDEPTH, 61VX KERNEL CUSTOM CONVOLUTION, 60VX KERNEL DILATE 3x3, 59VX KERNEL EQUALIZE HISTOGRAM, 58VX KERNEL ERODE 3x3, 59VX KERNEL FAST CORNERS, 63VX KERNEL GAUSSIAN 3x3, 59VX KERNEL HARRIS CORNERS, 63VX KERNEL HISTOGRAM, 58VX KERNEL INTEGRAL IMAGE, 59VX KERNEL INVALID, 56VX KERNEL MAGNITUDE, 57VX KERNEL MEAN STDDEV, 58VX KERNEL MEDIAN 3x3, 59VX KERNEL MINMAXLOC, 60VX KERNEL MULTIPLY, 62VX KERNEL NOT, 61VX KERNEL OPTICAL FLOW PYR LK, 63VX KERNEL OR, 61VX KERNEL PHASE, 57VX KERNEL PYRAMID, 60VX KERNEL SCALE IMAGE, 57VX KERNEL SOBEL 3x3, 57VX KERNEL SUBTRACT, 62VX KERNEL TABLE LOOKUP, 58VX KERNEL THRESHOLD, 58VX KERNEL WARP AFFINE, 62VX KERNEL WARP PERSPECTIVE, 62VX KERNEL XOR, 61
Object: LUTVX LUT ATTRIBUTE COUNT, 126VX LUT ATTRIBUTE SIZE, 126
INDEX 277
VX LUT ATTRIBUTE TYPE, 126Object: List
VX LIST ATTRIBUTE LENGTH, 131VX LIST ATTRIBUTE TYPE, 131VX LIST BACK, 131VX LIST FIRST, 131VX LIST FRONT, 131VX LIST LAST, 131VX LIST NEXT, 131VX LIST PREVIOUS, 131
Object: MatrixVX MATRIX ATTRIBUTE COLUMNS, 116VX MATRIX ATTRIBUTE ROWS, 116VX MATRIX ATTRIBUTE SIZE, 116VX MATRIX ATTRIBUTE TYPE, 116
Object: NodeVX NODE ATTRIBUTE BORDER MODE, 67VX NODE ATTRIBUTE LOCAL DATA PTR, 67VX NODE ATTRIBUTE LOCAL DATA SIZE, 67VX NODE ATTRIBUTE PERFORMANCE, 67VX NODE ATTRIBUTE STATUS, 67
Object: ParameterVX BIDIRECTIONAL, 81VX INPUT, 81VX OUTPUT, 81VX PARAMETER ATTRIBUTE DIRECTION, 81VX PARAMETER ATTRIBUTE INDEX, 81VX PARAMETER ATTRIBUTE STATE, 81VX PARAMETER STATE OPTIONAL, 81VX PARAMETER STATE REQUIRED, 81VX READ AND WRITE, 81VX READ ONLY, 81VX WRITE ONLY, 81
Object: PyramidVX PYRAMID ATTRIBUTE LEVELS, 88VX PYRAMID ATTRIBUTE SCALE, 88
Object: RectangleVX RECTANGLE ATTRIBUTE END X, 103VX RECTANGLE ATTRIBUTE END Y, 103VX RECTANGLE ATTRIBUTE START X, 103VX RECTANGLE ATTRIBUTE START Y, 103
Object: ReferenceVX REF ATTRIBUTE COUNT, 85VX REF ATTRIBUTE TYPE, 85
Object: RemapVX REMAP ATTRIBUTE DESTINATION HEIGH-
T, 134VX REMAP ATTRIBUTE DESTINATION WIDTH,
134VX REMAP ATTRIBUTE SOURCE HEIGHT, 134VX REMAP ATTRIBUTE SOURCE WIDTH, 134
Object: ScalarVX SCALAR ATTRIBUTE TYPE, 90
Object: TargetVX TARGET ATTRIBUTE INDEX, 98VX TARGET ATTRIBUTE KERNELTABLE, 98VX TARGET ATTRIBUTE NAME, 98VX TARGET ATTRIBUTE NUMKERNELS, 98
Object: ThresholdVX THRESHOLD ATTRIBUTE LOWER, 119VX THRESHOLD ATTRIBUTE TYPE, 119VX THRESHOLD ATTRIBUTE UPPER, 119VX THRESHOLD ATTRIBUTE VALUE, 119VX THRESHOLD TYPE BINARY, 120VX THRESHOLD TYPE RANGE, 120
Object: Buffer, 48vx buffer, 48vx buffer attribute e, 49vxAccessBufferRange, 49vxCommitBufferRange, 50vxComputeBufferRangeSize, 50vxCreateBuffer, 50vxCreateBufferFromHandle, 51vxCreateVirtualBuffer, 51vxQueryBuffer, 52vxReleaseBuffer, 52
Object: Context, 25vx context, 26vx context attribute e, 26vx import type e, 26vx termination criteria e, 27vxCreateContext, 27vxGetContext, 27vxQueryContext, 28vxReleaseContext, 28vxSetImmediateBorderMode, 29
Object: Convolution, 110vx convolution attribute e, 110vxAccessConvolutionCoefficients, 111vxCommitConvolutionCoefficients, 111vxCreateConvolution, 111vxQueryConvolution, 112vxReleaseConvolution, 112vxSetConvolutionAttribute, 112
Object: Coordinates, 107vx coordinates attribute e, 107vxAccessCoordinates, 107vxCommitCoordinates, 108vxCreateCoordinates, 108vxQueryCoordinates, 108vxReleaseCoordinates, 108vxSetCoordinatesAttributes, 109
Object: Delay, 92vx delay, 92vx delay attribute e, 93vxAgeDelay, 93vxAssociateDelayWithNode, 93vxCreateBufferDelay, 94vxCreateImageDelay, 94vxDissociateDelayFromNode, 95vxGetBufferFromDelay, 95vxGetImageFromDelay, 95vxQueryDelay, 96vxReleaseDelay, 96
Object: Distribution, 113vx distribution attribute e, 113
INDEX 278
vxAccessDistribution, 114vxCommitDistribution, 114vxCreateDistribution, 114vxQueryDistribution, 115vxReleaseDistribution, 115
Object: Graph, 71vx action, 72vx action e, 72vx graph, 72vx graph attribute e, 72vxAddParameterToGraph, 73vxCreateGraph, 74vxGetGraphParameterByIndex, 74vxIsGraphVerified, 75vxProcessGraph, 75vxQueryGraph, 75vxReleaseGraph, 77vxScheduleGraph, 77vxSetGraphParameterByIndex, 78vxVerifyGraph, 78vxWaitGraph, 79
Object: Image, 30vx channel range e, 33vx color space e, 33vx image, 33vx image attribute e, 34vxAccessImagePatch, 34vxCommitImagePatch, 36vxComputeImagePatchSize, 38vxCreateImage, 38vxCreateImageFromHandle, 38vxCreateImageFromROI, 39vxCreateUniformImage, 39vxCreateVirtualImage, 40vxCreateVirtualImageWithFormat, 40vxFormatImagePatchAddress1d, 41vxFormatImagePatchAddress2d, 42vxGetValidRegionImage, 45vxQueryImage, 45vxReleaseImage, 46vxSetImageAttribute, 46
Object: Kernel, 54vx kernel, 55vx kernel attribute e, 55vx kernel e, 56vxGetKernelByEnum, 63vxGetKernelByName, 64vxQueryKernel, 64vxReleaseKernel, 65
Object: Keypoint, 123vxAccessKeypoint, 123vxCommitKeypoint, 124vxCreateKeypoint, 124vxReleaseKeypoint, 125
Object: LUT, 126vx lut attribute e, 126vxAccessLUT, 126vxCommitLUT, 127
vxCreateLUT, 127vxQueryLUT, 127vxReleaseLUT, 129
Object: List, 130vx list attribute e, 131vx list iterator e, 131vxAddListItem, 131vxCreateList, 132vxEmptyList, 132vxGetListItem, 132vxQueryList, 133vxReleaseList, 133
Object: Matrix, 116vx matrix attribute e, 116vxAccessMatrix, 116vxCommitMatrix, 117vxCreateMatrix, 117vxQueryMatrix, 117vxReleaseMatrix, 118
Object: Node, 66vx node, 67vx node attribute e, 67vx nodecomplete f, 67vxAssignNodeCallback, 67vxCreateNode, 68vxQueryNode, 68vxReleaseNode, 69vxRetrieveNodeCallback, 69vxSetNodeAttribute, 70
Object: Parameter, 80vx direction e, 81vx parameter, 81vx parameter attribute e, 81vx parameter state e, 81vxGetParameterByIndex, 81vxQueryParameter, 82vxReleaseParameter, 82vxSetParameterByIndex, 83vxSetParameterByReference, 83
Object: Pyramid, 87vx pyramid attribute e, 88vxCreatePyramid, 88vxGetPyramidLevel, 88vxQueryPyramid, 88vxReleasePyramid, 89
Object: Rectangle, 103vx rectangle attribute e, 103vxAccessRectangleCoordinates, 104vxCommitRectangleCoordinates, 105vxCreateRectangle, 105vxQueryRectangle, 105vxReleaseRectangle, 106vxSetRectangleAttribute, 106
Object: Reference, 85vx reference, 85vx reference attribute e, 85vxQueryReference, 85
Object: Remap, 134
INDEX 279
vx remap attribute e, 134vxCreateRemap, 135vxGetRemapPoint, 136vxQueryRemap, 136vxReleaseRemap, 136vxSetRemapPoint, 137
Object: Scalar, 90vx scalar, 90vx scalar attribute e, 90vxQueryScalar, 90
Object: Target, 97vx target attribute e, 98vxAssignNode, 98vxGetTargetByIndex, 98vxGetTargetByName, 99vxQueryTarget, 99vxReleaseTarget, 99
Object: Threshold, 119vx threshold attribute e, 119vx threshold type e, 120vxCreateThreshold, 120vxQueryThreshold, 120vxReleaseThreshold, 120vxSetThresholdAttribute, 120
OpenVX TypesFOURCC IYUV, 233FOURCC NV12, 233FOURCC NV21, 233FOURCC RGB, 233FOURCC RGBX, 233FOURCC S16, 234FOURCC S32, 234FOURCC U16, 233FOURCC U32, 234FOURCC U8, 233FOURCC UYVY, 233FOURCC VIRT, 233FOURCC YUV4, 233FOURCC YUYV, 233VX CHANNEL 0, 232VX CHANNEL 1, 232VX CHANNEL 2, 232VX CHANNEL 3, 232VX CHANNEL A, 232VX CHANNEL B, 232VX CHANNEL G, 232VX CHANNEL R, 232VX CHANNEL U, 232VX CHANNEL V, 232VX CHANNEL Y, 232VX CONVERT POLICY SATURATE, 232VX CONVERT POLICY TRUNCATE, 232VX ENUM ACTION, 233VX ENUM BORDER MODE, 233VX ENUM CHANNEL, 233VX ENUM COLOR RANGE, 233VX ENUM COLOR SPACE, 233VX ENUM COMPARISON, 233
VX ENUM CONVERT POLICY, 233VX ENUM DIRECTION, 233VX ENUM DIRECTIVE, 233VX ENUM HINT, 233VX ENUM IMPORT MEM, 233VX ENUM INTERPOLATION, 233VX ENUM LIST ITERATORS, 233VX ENUM NORM TYPE, 233VX ENUM OVERFLOW, 233VX ENUM PARAMETER STATE, 233VX ENUM TERM CRITERIA, 233VX ENUM THRESHOLD TYPE, 233VX ERROR GRAPH ABANDONED, 234VX ERROR GRAPH SCHEDULED, 235VX ERROR INVALID DIMENSION, 235VX ERROR INVALID FORMAT, 235VX ERROR INVALID GRAPH, 235VX ERROR INVALID LINK, 235VX ERROR INVALID MODULE, 235VX ERROR INVALID NODE, 235VX ERROR INVALID PARAMETERS, 235VX ERROR INVALID REFERENCE, 235VX ERROR INVALID TYPE, 235VX ERROR INVALID VALUE, 235VX ERROR MULTIPLE WRITERS, 234VX ERROR NO MEMORY, 235VX ERROR NO RESOURCES, 235VX ERROR NOT ALLOCATED, 235VX ERROR NOT COMPATIBLE, 235VX ERROR NOT IMPLEMENTED, 235VX ERROR NOT SUFFICIENT, 235VX ERROR NOT SUPPORTED, 235VX ERROR OPTIMIZED AWAY, 235VX ERROR REFERENCE NONZERO, 234VX FAILURE, 235VX INTERPOLATION TYPE AREA, 234VX INTERPOLATION TYPE BILINEAR, 234VX INTERPOLATION TYPE NEAREST NEIGHB-
OR, 234VX STATUS MIN, 234VX SUCCESS, 235VX TYPE BOOL, 236VX TYPE BUFFER, 236VX TYPE CHAR, 236VX TYPE CONTEXT, 236VX TYPE CONVOLUTION, 236VX TYPE COORDINATES, 236VX TYPE DELAY, 236VX TYPE DISTRIBUTION, 236VX TYPE ENUM, 236VX TYPE FLOAT32, 236VX TYPE FLOAT64, 236VX TYPE FOURCC, 236VX TYPE GRAPH, 236VX TYPE IMAGE, 236VX TYPE INT16, 236VX TYPE INT32, 236VX TYPE INT64, 236
INDEX 280
VX TYPE INT8, 236VX TYPE KERNEL, 236VX TYPE KEYPOINT, 236VX TYPE LIST, 236VX TYPE LUT, 236VX TYPE MATRIX, 236VX TYPE NODE, 236VX TYPE PARAMETER, 236VX TYPE PYRAMID, 236VX TYPE RECTANGLE, 236VX TYPE REFERENCE, 236VX TYPE REMAP, 236VX TYPE SCALAR, 236VX TYPE SIZE, 236VX TYPE TARGET, 236VX TYPE THRESHOLD, 236VX TYPE UINT16, 236VX TYPE UINT32, 236VX TYPE UINT64, 236VX TYPE UINT8, 236vx false e, 232vx true e, 232
OpenVX VendorsVX ID AMD, 240VX ID ARM, 240VX ID AXIS, 240VX ID BDTI, 240VX ID BROADCOM, 241VX ID CEVA, 241VX ID DEFAULT, 241VX ID FREESCALE, 240VX ID INTEL, 241VX ID KHRONOS, 240VX ID MARVELL, 241VX ID MEDIATEK, 241VX ID MOVIDIUS, 240VX ID NVIDIA, 240VX ID QUALCOMM, 240VX ID RENESAS, 240VX ID SAMSUNG, 240VX ID ST, 241VX ID TI, 240VX ID VIVANTE, 240VX ID XILINX, 240
OpenVX Defines, 239VX TYPE MASK, 239VX VERSION, 239VX VERSION MAJOR, 239VX VERSION MINOR, 239
OpenVX Examples, 242factories, 243vx factory name e, 243
OpenVX Framework, 24OpenVX Helper, 150
vxAddParameterToGraphByIndex, 151vxAlterRectangle, 152vxClearLog, 152vxCreateNodeByStructure, 152
vxFindTarget, 153vxLinkParametersByIndex, 153vxLinkParametersByReference, 154vxSetAffineRotationMatrix, 154
OpenVX Kernels, 155OpenVX Macros, 237
VX ENUM BASE, 237VX FMT REF, 237VX FMT SIZE, 237VX FOURCC, 237VX SCALE UNITY, 237
OpenVX Objects, 22OpenVX Types, 228
vx bool, 232vx channel e, 232vx convert policy e, 232vx enum e, 232vx fourcc e, 233vx interpolation type e, 234vx status, 231vx status e, 234vx type e, 235
OpenVX Vendors, 240vx vendor id e, 240
output validatorvx tiling kernel t, 249
parametersvx tiling kernel t, 249
VX ACTION ABANDONObject: Graph, 72
VX ACTION CONTINUEObject: Graph, 72
VX ACTION RESTARTObject: Graph, 72
VX BIDIRECTIONALObject: Parameter, 81
VX BORDER MODE CONSTANTNode: Border Modes, 227
VX BORDER MODE REPLICATENode: Border Modes, 227
VX BORDER MODE UNDEFINEDNode: Border Modes, 227
VX BUFFER ATTRIBUTE NUMUNITSObject: Buffer, 49
VX BUFFER ATTRIBUTE SIZEObject: Buffer, 49
VX BUFFER ATTRIBUTE UNITSIZEObject: Buffer, 49
VX CHANNEL 0OpenVX Types, 232
VX CHANNEL 1OpenVX Types, 232
VX CHANNEL 2OpenVX Types, 232
VX CHANNEL 3OpenVX Types, 232
VX CHANNEL A
INDEX 281
OpenVX Types, 232VX CHANNEL B
OpenVX Types, 232VX CHANNEL G
OpenVX Types, 232VX CHANNEL R
OpenVX Types, 232VX CHANNEL RANGE FULL
Object: Image, 33VX CHANNEL RANGE RESTRICTED
Object: Image, 33VX CHANNEL U
OpenVX Types, 232VX CHANNEL V
OpenVX Types, 232VX CHANNEL Y
OpenVX Types, 232VX COLOR SPACE BT601 525
Object: Image, 34VX COLOR SPACE BT601 625
Object: Image, 34VX COLOR SPACE BT709
Object: Image, 34VX COLOR SPACE DEFAULT
Object: Image, 34VX COLOR SPACE NONE
Object: Image, 34VX CONTEXT ATTRIBUTE CONVOLUTION MAXIM-
UM DIMENSIONObject: Context, 26
VX CONTEXT ATTRIBUTE EXTENSIONSObject: Context, 26
VX CONTEXT ATTRIBUTE EXTENSIONS SIZEObject: Context, 26
VX CONTEXT ATTRIBUTE IMPLEMENTATIONObject: Context, 26
VX CONTEXT ATTRIBUTE NUMKERNELSObject: Context, 26
VX CONTEXT ATTRIBUTE NUMMODULESObject: Context, 26
VX CONTEXT ATTRIBUTE NUMREFSObject: Context, 26
VX CONTEXT ATTRIBUTE NUMTARGETSObject: Context, 26
VX CONTEXT ATTRIBUTE VENDOR IDObject: Context, 26
VX CONTEXT ATTRIBUTE VERSIONObject: Context, 26
VX CONVERT POLICY SATURATEOpenVX Types, 232
VX CONVERT POLICY TRUNCATEOpenVX Types, 232
VX CONVOLUTION ATTRIBUTE COLUMNSObject: Convolution, 110
VX CONVOLUTION ATTRIBUTE ROWSObject: Convolution, 110
VX CONVOLUTION ATTRIBUTE SCALEObject: Convolution, 110
VX CONVOLUTION ATTRIBUTE SIZEObject: Convolution, 111
VX COORDINATES ATTRIBUTE DIMENSIONSObject: Coordinates, 107
VX COORDINATES ATTRIBUTE SIZEObject: Coordinates, 107
VX DELAY ATTRIBUTE COUNTObject: Delay, 93
VX DELAY ATTRIBUTE TYPEObject: Delay, 93
VX DIRECTIVE DISABLE LOGGINGFramework: Directive, 140
VX DIRECTIVE ENABLE LOGGINGFramework: Directive, 140
VX DISTRIBUTION ATTRIBUTE BINSObject: Distribution, 114
VX DISTRIBUTION ATTRIBUTE DIMENSIONSObject: Distribution, 113
VX DISTRIBUTION ATTRIBUTE OFFSETObject: Distribution, 113
VX DISTRIBUTION ATTRIBUTE RANGEObject: Distribution, 113
VX DISTRIBUTION ATTRIBUTE SIZEObject: Distribution, 114
VX DISTRIBUTION ATTRIBUTE WINDOWObject: Distribution, 114
VX ENUM ACTIONOpenVX Types, 233
VX ENUM BORDER MODEOpenVX Types, 233
VX ENUM CHANNELOpenVX Types, 233
VX ENUM COLOR RANGEOpenVX Types, 233
VX ENUM COLOR SPACEOpenVX Types, 233
VX ENUM COMPARISONOpenVX Types, 233
VX ENUM CONVERT POLICYOpenVX Types, 233
VX ENUM DIRECTIONOpenVX Types, 233
VX ENUM DIRECTIVEOpenVX Types, 233
VX ENUM HINTOpenVX Types, 233
VX ENUM IMPORT MEMOpenVX Types, 233
VX ENUM INTERPOLATIONOpenVX Types, 233
VX ENUM LIST ITERATORSOpenVX Types, 233
VX ENUM NORM TYPEOpenVX Types, 233
VX ENUM OVERFLOWOpenVX Types, 233
VX ENUM PARAMETER STATEOpenVX Types, 233
INDEX 282
VX ENUM TERM CRITERIAOpenVX Types, 233
VX ENUM THRESHOLD TYPEOpenVX Types, 233
VX ERROR GRAPH ABANDONEDOpenVX Types, 234
VX ERROR GRAPH SCHEDULEDOpenVX Types, 235
VX ERROR INVALID DIMENSIONOpenVX Types, 235
VX ERROR INVALID FORMATOpenVX Types, 235
VX ERROR INVALID GRAPHOpenVX Types, 235
VX ERROR INVALID LINKOpenVX Types, 235
VX ERROR INVALID MODULEOpenVX Types, 235
VX ERROR INVALID NODEOpenVX Types, 235
VX ERROR INVALID PARAMETERSOpenVX Types, 235
VX ERROR INVALID REFERENCEOpenVX Types, 235
VX ERROR INVALID TYPEOpenVX Types, 235
VX ERROR INVALID VALUEOpenVX Types, 235
VX ERROR MULTIPLE WRITERSOpenVX Types, 234
VX ERROR NO MEMORYOpenVX Types, 235
VX ERROR NO RESOURCESOpenVX Types, 235
VX ERROR NOT ALLOCATEDOpenVX Types, 235
VX ERROR NOT COMPATIBLEOpenVX Types, 235
VX ERROR NOT IMPLEMENTEDOpenVX Types, 235
VX ERROR NOT SUFFICIENTOpenVX Types, 235
VX ERROR NOT SUPPORTEDOpenVX Types, 235
VX ERROR OPTIMIZED AWAYOpenVX Types, 235
VX ERROR REFERENCE NONZEROOpenVX Types, 234
VX FAILUREOpenVX Types, 235
VX GRAPH ATTRIBUTE NUMNODESObject: Graph, 72
VX GRAPH ATTRIBUTE NUMPARAMETERSObject: Graph, 72
VX GRAPH ATTRIBUTE PERFORMANCEObject: Graph, 72
VX GRAPH ATTRIBUTE STATUSObject: Graph, 72
VX HINT SERIALIZEFramework: Hint, 138
VX ID AMDOpenVX Vendors, 240
VX ID ARMOpenVX Vendors, 240
VX ID AXISOpenVX Vendors, 240
VX ID BDTIOpenVX Vendors, 240
VX ID BROADCOMOpenVX Vendors, 241
VX ID CEVAOpenVX Vendors, 241
VX ID DEFAULTOpenVX Vendors, 241
VX ID FREESCALEOpenVX Vendors, 240
VX ID INTELOpenVX Vendors, 241
VX ID KHRONOSOpenVX Vendors, 240
VX ID MARVELLOpenVX Vendors, 241
VX ID MEDIATEKOpenVX Vendors, 241
VX ID MOVIDIUSOpenVX Vendors, 240
VX ID NVIDIAOpenVX Vendors, 240
VX ID QUALCOMMOpenVX Vendors, 240
VX ID RENESASOpenVX Vendors, 240
VX ID SAMSUNGOpenVX Vendors, 240
VX ID STOpenVX Vendors, 241
VX ID TIOpenVX Vendors, 240
VX ID VIVANTEOpenVX Vendors, 240
VX ID XILINXOpenVX Vendors, 240
VX IMAGE ATTRIBUTE FORMATObject: Image, 34
VX IMAGE ATTRIBUTE HEIGHTObject: Image, 34
VX IMAGE ATTRIBUTE PLANESObject: Image, 34
VX IMAGE ATTRIBUTE RANGEObject: Image, 34
VX IMAGE ATTRIBUTE SIZEObject: Image, 34
VX IMAGE ATTRIBUTE SPACEObject: Image, 34
VX IMAGE ATTRIBUTE WIDTHObject: Image, 34
INDEX 283
VX IMPORT TYPE HOSTObject: Context, 27
VX IMPORT TYPE NONEObject: Context, 27
VX INPUTObject: Parameter, 81
VX INTERPOLATION TYPE AREAOpenVX Types, 234
VX INTERPOLATION TYPE BILINEAROpenVX Types, 234
VX INTERPOLATION TYPE NEAREST NEIGHBOROpenVX Types, 234
VX KERNEL ABSDIFFObject: Kernel, 58
VX KERNEL ACCUMULATEObject: Kernel, 60
VX KERNEL ACCUMULATE SQUAREObject: Kernel, 60
VX KERNEL ACCUMULATE WEIGHTEDObject: Kernel, 60
VX KERNEL ADDObject: Kernel, 62
VX KERNEL ANDObject: Kernel, 61
VX KERNEL ATTRIBUTE ENUMObject: Kernel, 56
VX KERNEL ATTRIBUTE LOCAL DATA PTRObject: Kernel, 56
VX KERNEL ATTRIBUTE LOCAL DATA SIZEObject: Kernel, 56
VX KERNEL ATTRIBUTE NAMEObject: Kernel, 56
VX KERNEL ATTRIBUTE NUMPARAMSObject: Kernel, 56
VX KERNEL BOX 3x3Object: Kernel, 59
VX KERNEL CANNY EDGE DETECTORObject: Kernel, 61
VX KERNEL CHANNEL COMBINEObject: Kernel, 57
VX KERNEL CHANNEL EXTRACTObject: Kernel, 56
VX KERNEL COLOR CONVERTObject: Kernel, 56
VX KERNEL CONVERTDEPTHObject: Kernel, 61
VX KERNEL CUSTOM CONVOLUTIONObject: Kernel, 60
VX KERNEL DILATE 3x3Object: Kernel, 59
VX KERNEL EQUALIZE HISTOGRAMObject: Kernel, 58
VX KERNEL ERODE 3x3Object: Kernel, 59
VX KERNEL FAST CORNERSObject: Kernel, 63
VX KERNEL GAUSSIAN 3x3Object: Kernel, 59
VX KERNEL HARRIS CORNERSObject: Kernel, 63
VX KERNEL HISTOGRAMObject: Kernel, 58
VX KERNEL INTEGRAL IMAGEObject: Kernel, 59
VX KERNEL INVALIDObject: Kernel, 56
VX KERNEL MAGNITUDEObject: Kernel, 57
VX KERNEL MEAN STDDEVObject: Kernel, 58
VX KERNEL MEDIAN 3x3Object: Kernel, 59
VX KERNEL MINMAXLOCObject: Kernel, 60
VX KERNEL MULTIPLYObject: Kernel, 62
VX KERNEL NOTObject: Kernel, 61
VX KERNEL OPTICAL FLOW PYR LKObject: Kernel, 63
VX KERNEL ORObject: Kernel, 61
VX KERNEL PHASEObject: Kernel, 57
VX KERNEL PYRAMIDObject: Kernel, 60
VX KERNEL SCALE IMAGEObject: Kernel, 57
VX KERNEL SOBEL 3x3Object: Kernel, 57
VX KERNEL SUBTRACTObject: Kernel, 62
VX KERNEL TABLE LOOKUPObject: Kernel, 58
VX KERNEL THRESHOLDObject: Kernel, 58
VX KERNEL WARP AFFINEObject: Kernel, 62
VX KERNEL WARP PERSPECTIVEObject: Kernel, 62
VX KERNEL XORObject: Kernel, 61
VX LIST ATTRIBUTE LENGTHObject: List, 131
VX LIST ATTRIBUTE TYPEObject: List, 131
VX LIST BACKObject: List, 131
VX LIST FIRSTObject: List, 131
VX LIST FRONTObject: List, 131
VX LIST LASTObject: List, 131
VX LIST NEXTObject: List, 131
INDEX 284
VX LIST PREVIOUSObject: List, 131
VX LUT ATTRIBUTE COUNTObject: LUT, 126
VX LUT ATTRIBUTE SIZEObject: LUT, 126
VX LUT ATTRIBUTE TYPEObject: LUT, 126
VX MATRIX ATTRIBUTE COLUMNSObject: Matrix, 116
VX MATRIX ATTRIBUTE ROWSObject: Matrix, 116
VX MATRIX ATTRIBUTE SIZEObject: Matrix, 116
VX MATRIX ATTRIBUTE TYPEObject: Matrix, 116
VX NODE ATTRIBUTE BORDER MODEObject: Node, 67
VX NODE ATTRIBUTE LOCAL DATA PTRObject: Node, 67
VX NODE ATTRIBUTE LOCAL DATA SIZEObject: Node, 67
VX NODE ATTRIBUTE PERFORMANCEObject: Node, 67
VX NODE ATTRIBUTE STATUSObject: Node, 67
VX NORM L1Kernel: Canny Edge Detector, 211
VX NORM L2Kernel: Canny Edge Detector, 211
VX OUTPUTObject: Parameter, 81
VX PARAMETER ATTRIBUTE DIRECTIONObject: Parameter, 81
VX PARAMETER ATTRIBUTE INDEXObject: Parameter, 81
VX PARAMETER ATTRIBUTE STATEObject: Parameter, 81
VX PARAMETER STATE OPTIONALObject: Parameter, 81
VX PARAMETER STATE REQUIREDObject: Parameter, 81
VX PYRAMID ATTRIBUTE LEVELSObject: Pyramid, 88
VX PYRAMID ATTRIBUTE SCALEObject: Pyramid, 88
VX READ AND WRITEObject: Parameter, 81
VX READ ONLYObject: Parameter, 81
VX RECTANGLE ATTRIBUTE END XObject: Rectangle, 103
VX RECTANGLE ATTRIBUTE END YObject: Rectangle, 103
VX RECTANGLE ATTRIBUTE START XObject: Rectangle, 103
VX RECTANGLE ATTRIBUTE START YObject: Rectangle, 103
VX REF ATTRIBUTE COUNTObject: Reference, 85
VX REF ATTRIBUTE TYPEObject: Reference, 85
VX REMAP ATTRIBUTE DESTINATION HEIGHTObject: Remap, 134
VX REMAP ATTRIBUTE DESTINATION WIDTHObject: Remap, 134
VX REMAP ATTRIBUTE SOURCE HEIGHTObject: Remap, 134
VX REMAP ATTRIBUTE SOURCE WIDTHObject: Remap, 134
VX SCALAR ATTRIBUTE TYPEObject: Scalar, 90
VX STATUS MINOpenVX Types, 234
VX SUCCESSOpenVX Types, 235
VX TARGET ATTRIBUTE INDEXObject: Target, 98
VX TARGET ATTRIBUTE KERNELTABLEObject: Target, 98
VX TARGET ATTRIBUTE NAMEObject: Target, 98
VX TARGET ATTRIBUTE NUMKERNELSObject: Target, 98
VX TERM CRITERIA BOTHObject: Context, 27
VX TERM CRITERIA EPSILONObject: Context, 27
VX TERM CRITERIA ITERATIONSObject: Context, 27
VX THRESHOLD ATTRIBUTE LOWERObject: Threshold, 119
VX THRESHOLD ATTRIBUTE TYPEObject: Threshold, 119
VX THRESHOLD ATTRIBUTE UPPERObject: Threshold, 119
VX THRESHOLD ATTRIBUTE VALUEObject: Threshold, 119
VX THRESHOLD TYPE BINARYObject: Threshold, 120
VX THRESHOLD TYPE RANGEObject: Threshold, 120
VX TYPE BOOLOpenVX Types, 236
VX TYPE BUFFEROpenVX Types, 236
VX TYPE CHAROpenVX Types, 236
VX TYPE CONTEXTOpenVX Types, 236
VX TYPE CONVOLUTIONOpenVX Types, 236
VX TYPE COORDINATESOpenVX Types, 236
VX TYPE DELAYOpenVX Types, 236
INDEX 285
VX TYPE DISTRIBUTIONOpenVX Types, 236
VX TYPE ENUMOpenVX Types, 236
VX TYPE FLOAT32OpenVX Types, 236
VX TYPE FLOAT64OpenVX Types, 236
VX TYPE FOURCCOpenVX Types, 236
VX TYPE GRAPHOpenVX Types, 236
VX TYPE IMAGEOpenVX Types, 236
VX TYPE INT16OpenVX Types, 236
VX TYPE INT32OpenVX Types, 236
VX TYPE INT64OpenVX Types, 236
VX TYPE INT8OpenVX Types, 236
VX TYPE KERNELOpenVX Types, 236
VX TYPE KEYPOINTOpenVX Types, 236
VX TYPE LISTOpenVX Types, 236
VX TYPE LUTOpenVX Types, 236
VX TYPE MATRIXOpenVX Types, 236
VX TYPE NODEOpenVX Types, 236
VX TYPE PARAMETEROpenVX Types, 236
VX TYPE PYRAMIDOpenVX Types, 236
VX TYPE RECTANGLEOpenVX Types, 236
VX TYPE REFERENCEOpenVX Types, 236
VX TYPE REMAPOpenVX Types, 236
VX TYPE SCALAROpenVX Types, 236
VX TYPE SIZEOpenVX Types, 236
VX TYPE TARGETOpenVX Types, 236
VX TYPE THRESHOLDOpenVX Types, 236
VX TYPE UINT16OpenVX Types, 236
VX TYPE UINT32OpenVX Types, 236
VX TYPE UINT64OpenVX Types, 236
VX TYPE UINT8OpenVX Types, 236
VX WRITE ONLYObject: Parameter, 81
VX ENUM BASEOpenVX Macros, 237
VX FMT REFOpenVX Macros, 237
VX FMT SIZEOpenVX Macros, 237
VX FOURCCOpenVX Macros, 237
VX SCALE UNITYOpenVX Macros, 237
VX TYPE MASKOpenVX Defines, 239
VX VERSIONOpenVX Defines, 239
VX VERSION MAJOROpenVX Defines, 239
VX VERSION MINOROpenVX Defines, 239
vx border mode t, 227vx false e
OpenVX Types, 232vx graph factory t, 243vx imagepatch addressing t, 31vx kernel description t, 150vx keypoint t, 123vx meta format t, 143vx param description t, 151vx parameter item t, 151vx perf t, 149vx target kernel t, 97vx true e
OpenVX Types, 232vx action
Object: Graph, 72vx action e
Object: Graph, 72vx bool
OpenVX Types, 232vx border mode e
Node: Border Modes, 227vx buffer
Object: Buffer, 48vx buffer attribute e
Object: Buffer, 49vx channel e
OpenVX Types, 232vx channel range e
Object: Image, 33vx color space e
Object: Image, 33vx context
Object: Context, 26vx context attribute e
Object: Context, 26
INDEX 286
vx convert policy eOpenVX Types, 232
vx convolution attribute eObject: Convolution, 110
vx coordinates attribute eObject: Coordinates, 107
vx delayObject: Delay, 92
vx delay attribute eObject: Delay, 93
vx direction eObject: Parameter, 81
vx directive eFramework: Directive, 140
vx distribution attribute eObject: Distribution, 113
vx enum eOpenVX Types, 232
vx factory name eOpenVX Examples, 243
vx fourcc eOpenVX Types, 233
vx graphObject: Graph, 72
vx graph attribute eObject: Graph, 72
vx hint eFramework: Hint, 138
vx imageObject: Image, 33
vx image attribute eObject: Image, 34
vx import type eObject: Context, 26
vx interpolation type eOpenVX Types, 234
vx kernelObject: Kernel, 55
vx kernel attribute eObject: Kernel, 55
vx kernel deinitialize fFramework: Users Supplied Nodes, 143
vx kernel eObject: Kernel, 56
vx kernel fFramework: Users Supplied Nodes, 143
vx kernel initialize fFramework: Users Supplied Nodes, 143
vx kernel input validate fFramework: Users Supplied Nodes, 143
vx kernel output validate fFramework: Users Supplied Nodes, 144
vx list attribute eObject: List, 131
vx list iterator eObject: List, 131
vx lut attribute eObject: LUT, 126
vx matrix attribute eObject: Matrix, 116
vx nodeObject: Node, 67
vx node attribute eObject: Node, 67
vx nodecomplete fObject: Node, 67
vx norm type eKernel: Canny Edge Detector, 211
vx parameterObject: Parameter, 81
vx parameter attribute eObject: Parameter, 81
vx parameter state eObject: Parameter, 81
vx publish kernels fFramework: Users Supplied Nodes, 144
vx pyramid attribute eObject: Pyramid, 88
vx rectangle attribute eObject: Rectangle, 103
vx referenceObject: Reference, 85
vx reference attribute eObject: Reference, 85
vx remap attribute eObject: Remap, 134
vx scalarObject: Scalar, 90
vx scalar attribute eObject: Scalar, 90
vx statusOpenVX Types, 231
vx status eOpenVX Types, 234
vx target attribute eObject: Target, 98
vx termination criteria eObject: Context, 27
vx threshold attribute eObject: Threshold, 119
vx threshold type eObject: Threshold, 120
vx tiling kernel t, 248block, 248border, 248enumeration, 248function, 248input validator, 248name, 249nbhd, 249num params, 249output validator, 249parameters, 249
vx type eOpenVX Types, 235
vx vendor id e
INDEX 287
OpenVX Vendors, 240vxAbsDiffNode
Kernel: Absolute Difference, 174vxAccessBufferRange
Object: Buffer, 49vxAccessConvolutionCoefficients
Object: Convolution, 111vxAccessCoordinates
Object: Coordinates, 107vxAccessDistribution
Object: Distribution, 114vxAccessImagePatch
Object: Image, 34vxAccessKeypoint
Object: Keypoint, 123vxAccessLUT
Object: LUT, 126vxAccessMatrix
Object: Matrix, 116vxAccessRectangleCoordinates
Object: Rectangle, 104vxAccumulateImageNode
Kernel: Accumulate, 189vxAccumulateSquareImageNode
Kernel: Accumulate Squared, 192vxAccumulateWeightedImageNode
Kernel: Accumulate Weighted, 190vxAddKernel
Framework: Users Supplied Nodes, 145vxAddListItem
Object: List, 131vxAddLogEntry
Framework: Log, 101vxAddNode
Kernel: Arithmetic Addition, 204vxAddParameterToGraph
Object: Graph, 73vxAddParameterToGraphByIndex
OpenVX Helper, 151vxAddParameterToKernel
Framework: Users Supplied Nodes, 145vxAgeDelay
Object: Delay, 93vxAlterRectangle
OpenVX Helper, 152vxAndNode
Kernel: Bitwise And, 195vxAssignNode
Object: Target, 98vxAssignNodeCallback
Object: Node, 67vxAssociateDelayWithNode
Object: Delay, 93vxBox3x3Node
Kernel: Box Filter, 183vxCannyEdgeDetectorNode
Kernel: Canny Edge Detector, 211vxChannelCombineNode
Kernel: Channel Combine, 161vxChannelExtractNode
Kernel: Channel Extract, 159vxClearLog
OpenVX Helper, 152vxColorConvertNode
Kernel: Color Convert, 157vxCommitBufferRange
Object: Buffer, 50vxCommitConvolutionCoefficients
Object: Convolution, 111vxCommitCoordinates
Object: Coordinates, 108vxCommitDistribution
Object: Distribution, 114vxCommitImagePatch
Object: Image, 36vxCommitKeypoint
Object: Keypoint, 124vxCommitLUT
Object: LUT, 127vxCommitMatrix
Object: Matrix, 117vxCommitRectangleCoordinates
Object: Rectangle, 105vxComputeBufferRangeSize
Object: Buffer, 50vxComputeImagePatchSize
Object: Image, 38vxConvertDepthNode
Kernel: Convert Bit depth, 208vxConvolveNode
Kernel: Custom Convolution, 185vxCreateBuffer
Object: Buffer, 50vxCreateBufferDelay
Object: Delay, 94vxCreateBufferFromHandle
Object: Buffer, 51vxCreateContext
Object: Context, 27vxCreateConvolution
Object: Convolution, 111vxCreateCoordinates
Object: Coordinates, 108vxCreateDistribution
Object: Distribution, 114vxCreateGraph
Object: Graph, 74vxCreateImage
Object: Image, 38vxCreateImageDelay
Object: Delay, 94vxCreateImageFromHandle
Object: Image, 38vxCreateImageFromROI
Object: Image, 39vxCreateKeypoint
INDEX 288
Object: Keypoint, 124vxCreateLUT
Object: LUT, 127vxCreateList
Object: List, 132vxCreateMatrix
Object: Matrix, 117vxCreateNode
Object: Node, 68vxCreateNodeByStructure
OpenVX Helper, 152vxCreatePyramid
Object: Pyramid, 88vxCreateRectangle
Object: Rectangle, 105vxCreateRemap
Object: Remap, 135vxCreateThreshold
Object: Threshold, 120vxCreateUniformImage
Object: Image, 39vxCreateVirtualBuffer
Object: Buffer, 51vxCreateVirtualImage
Object: Image, 40vxCreateVirtualImageWithFormat
Object: Image, 40vxDilate3x3Node
Kernel: Dilate Image, 181vxDirective
Framework: Directive, 140vxDissociateDelayFromNode
Object: Delay, 95vxEmptyList
Object: List, 132vxEqualizeHistNode
Kernel: Equalize Histogram, 173vxErode3x3Node
Kernel: Erode Image, 180vxFastCornersNode
Kernel: Fast Corners, 220vxFinalizeKernel
Framework: Users Supplied Nodes, 146vxFindTarget
OpenVX Helper, 153vxFormatImagePatchAddress1d
Object: Image, 41vxFormatImagePatchAddress2d
Object: Image, 42vxGaussian3x3Node
Kernel: Gaussian Filter, 184vxGetBufferFromDelay
Object: Delay, 95vxGetContext
Object: Context, 27vxGetGraphParameterByIndex
Object: Graph, 74vxGetImageFromDelay
Object: Delay, 95vxGetKernelByEnum
Object: Kernel, 63vxGetKernelByName
Object: Kernel, 64vxGetListItem
Object: List, 132vxGetLogEntry
Framework: Log, 101vxGetParameterByIndex
Object: Parameter, 81vxGetPyramidLevel
Object: Pyramid, 88vxGetRemapPoint
Object: Remap, 136vxGetTargetByIndex
Object: Target, 98vxGetTargetByName
Object: Target, 99vxGetValidRegionImage
Object: Image, 45vxHarrisCornersNode
Kernel: Harris Corners, 217vxHint
Framework: Hint, 138vxHistogramNode
Kernel: Histogram, 172vxIntegralImageNode
Kernel: Integral Image, 179vxIsGraphVerified
Object: Graph, 75vxLinkParametersByIndex
OpenVX Helper, 153vxLinkParametersByReference
OpenVX Helper, 154vxLoadKernels
Framework: Users Supplied Nodes, 146vxMagnitudeNode
Kernel: Magnitude, 165vxMeanStdDevNode
Kernel: Mean and Standard Deviation., 175vxMedian3x3Node
Kernel: Median Filter, 182vxMinMaxLocNode
Kernel: Min, Max Location, 193vxMultiplyNode
Kernel: Pixel-wise Multiplication, 202vxNotNode
Kernel: Bitwise Not, 201vxOpticalFlowPyrLKNode
Kernel: Optical Flow Pyramid (LK), 222vxOrNode
Kernel: Bitwise Inclusive Or, 197vxPhaseNode
Kernel: Phase, 167vxProcessGraph
Object: Graph, 75vxPublishKernels
INDEX 289
Example: User Defined Kernel, 244vxPyramidNode
Kernel: Image Pyramid, 187vxQueryBuffer
Object: Buffer, 52vxQueryContext
Object: Context, 28vxQueryConvolution
Object: Convolution, 112vxQueryCoordinates
Object: Coordinates, 108vxQueryDelay
Object: Delay, 96vxQueryDistribution
Object: Distribution, 115vxQueryGraph
Object: Graph, 75vxQueryImage
Object: Image, 45vxQueryKernel
Object: Kernel, 64vxQueryLUT
Object: LUT, 127vxQueryList
Object: List, 133vxQueryMatrix
Object: Matrix, 117vxQueryNode
Object: Node, 68vxQueryParameter
Object: Parameter, 82vxQueryPyramid
Object: Pyramid, 88vxQueryRectangle
Object: Rectangle, 105vxQueryReference
Object: Reference, 85vxQueryRemap
Object: Remap, 136vxQueryScalar
Object: Scalar, 90vxQueryTarget
Object: Target, 99vxQueryThreshold
Object: Threshold, 120vxReleaseBuffer
Object: Buffer, 52vxReleaseContext
Object: Context, 28vxReleaseConvolution
Object: Convolution, 112vxReleaseCoordinates
Object: Coordinates, 108vxReleaseDelay
Object: Delay, 96vxReleaseDistribution
Object: Distribution, 115vxReleaseGraph
Object: Graph, 77vxReleaseImage
Object: Image, 46vxReleaseKernel
Object: Kernel, 65vxReleaseKeypoint
Object: Keypoint, 125vxReleaseLUT
Object: LUT, 129vxReleaseList
Object: List, 133vxReleaseMatrix
Object: Matrix, 118vxReleaseNode
Object: Node, 69vxReleaseParameter
Object: Parameter, 82vxReleasePyramid
Object: Pyramid, 89vxReleaseRectangle
Object: Rectangle, 106vxReleaseRemap
Object: Remap, 136vxReleaseTarget
Object: Target, 99vxReleaseThreshold
Object: Threshold, 120vxRemapNode
Kernel: Remap, 225vxRemoveKernel
Framework: Users Supplied Nodes, 147vxRetrieveNodeCallback
Object: Node, 69vxScaleImageNode
Kernel: Scale Image, 169vxScheduleGraph
Object: Graph, 77vxSetAffineRotationMatrix
OpenVX Helper, 154vxSetConvolutionAttribute
Object: Convolution, 112vxSetCoordinatesAttributes
Object: Coordinates, 109vxSetGraphParameterByIndex
Object: Graph, 78vxSetImageAttribute
Object: Image, 46vxSetImmediateBorderMode
Object: Context, 29vxSetKernelAttribute
Framework: Users Supplied Nodes, 147vxSetNodeAttribute
Object: Node, 70vxSetParameterByIndex
Object: Parameter, 83vxSetParameterByReference
Object: Parameter, 83vxSetRectangleAttribute
INDEX 290
Object: Rectangle, 106vxSetRemapPoint
Object: Remap, 137vxSetThresholdAttribute
Object: Threshold, 120vxSobel3x3Node
Kernel: Sobel 3x3, 163vxSubtractNode
Kernel: Arithmetic Subtraction, 206vxTableLookupNode
Kernel: TableLookup, 171vxThresholdNode
Kernel: Thresholding, 177vxVerifyGraph
Object: Graph, 78vxWaitGraph
Object: Graph, 79vxWarpAffineNode
Kernel: Warp Affine, 213vxWarpPerspectiveNode
Kernel: Warp Perspective, 215vxXorNode
Kernel: Bitwise Exclusive Or, 199vxuAbsDiff
Kernel: Absolute Difference, 174vxuAccumulateImage
Kernel: Accumulate, 189vxuAccumulateSquareImage
Kernel: Accumulate Squared, 192vxuAccumulateWeightedImage
Kernel: Accumulate Weighted, 190vxuAdd
Kernel: Arithmetic Addition, 204vxuAnd
Kernel: Bitwise And, 195vxuBox3x3
Kernel: Box Filter, 183vxuCannyEdgeDetector
Kernel: Canny Edge Detector, 211vxuChannelCombine
Kernel: Channel Combine, 161vxuChannelExtract
Kernel: Channel Extract, 159vxuColorConvert
Kernel: Color Convert, 157vxuConvertDepth
Kernel: Convert Bit depth, 209vxuConvolve
Kernel: Custom Convolution, 186vxuDilate3x3
Kernel: Dilate Image, 181vxuEqualizeHist
Kernel: Equalize Histogram, 173vxuErode3x3
Kernel: Erode Image, 180vxuFastCorners
Kernel: Fast Corners, 220vxuGaussian3x3
Kernel: Gaussian Filter, 184vxuHalfScaleGaussian3x3
Kernel: Scale Image, 170vxuHarrisCorners
Kernel: Harris Corners, 218vxuHistogram
Kernel: Histogram, 172vxuIntegralImage
Kernel: Integral Image, 179vxuMagnitude
Kernel: Magnitude, 165vxuMeanStdDev
Kernel: Mean and Standard Deviation., 175vxuMedian3x3
Kernel: Median Filter, 182vxuMinMaxLoc
Kernel: Min, Max Location, 193vxuMultiply
Kernel: Pixel-wise Multiplication, 202vxuNot
Kernel: Bitwise Not, 201vxuOpticalFlowPyrLK
Kernel: Optical Flow Pyramid (LK), 223vxuOr
Kernel: Bitwise Inclusive Or, 197vxuPhase
Kernel: Phase, 167vxuPyramid
Kernel: Image Pyramid, 188vxuRemap
Kernel: Remap, 225vxuScaleImage
Kernel: Scale Image, 170vxuSobel3x3
Kernel: Sobel 3x3, 163vxuSubtract
Kernel: Arithmetic Subtraction, 206vxuTableLookup
Kernel: TableLookup, 171vxuThreshold
Kernel: Thresholding, 177vxuWarpAffine
Kernel: Warp Affine, 213vxuWarpPerspective
Kernel: Warp Perspective, 215vxuXor
Kernel: Bitwise Exclusive Or, 199
XYZDeinitializeExample: User Defined Kernel, 245
XYZInitializeExample: User Defined Kernel, 245
XYZInputValidatorExample: User Defined Kernel, 246
XYZKernelExample: User Defined Kernel, 246
XYZOutputValidatorExample: User Defined Kernel, 247
xyz params e
INDEX 291
Example: User Defined Kernel, 244