TIOVX User Guide
|
Go to the source code of this file.
Macros | |
#define | IN_FILE_NAME "${VX_TEST_DATA_PATH}/colors.bmp" |
Input file name. | |
#define | OUT_FILE_NAME "${VX_TEST_DATA_PATH}/vx_tutorial_image_histogram_out.bmp" |
Output file name. | |
Functions | |
vx_image | convert_distribution_to_image (vx_distribution distribution, uint32_t width, uint32_t height) |
Convert distribution given as input to image. More... | |
void | vx_tutorial_image_histogram () |
Tutorial Entry Point. More... | |
Create a distribution from an image then convert the to an image.
In this tutorial we learn the below concepts,
To include OpenVX interfaces include below file
To include TI OpenVX extensions include below file
Follow the comments in the function vx_tutorial_image_histogram() to understand this tutorial
As part of this tutorial, we create few utility functions as listed below. These functions will be used in subsequent tutorials to display node and graph attributes.
Utility function | Description |
---|---|
convert_distribution_to_image() | Converts a distribution data object to an image data object |
Definition in file vx_tutorial_image_histogram.c.
vx_image convert_distribution_to_image | ( | vx_distribution | distribution, |
uint32_t | width, | ||
uint32_t | height | ||
) |
Convert distribution given as input to image.
distribution | [in] Distribution to be converted to image |
width | [in] Width of distribution |
height | [in] Height of distribution |
- Create OpenVX image object.
Creates an OpenVX image object of 'width' x 'height' and having data format 'df'.
- Query distribution attributes. Queries distribution for number of bins
- Copy distribution. Copy distribution to array
- Map image patch. Allows direct access to rectangular patch of image object plane
- Unmap image patch.
- Release image object. Since we are done with using this image object, release it
Definition at line 396 of file vx_tutorial_image_histogram.c.
void vx_tutorial_image_histogram | ( | ) |
Tutorial Entry Point.
- Define objects that we wish to create in the OpenVX application.
A vx_context object is defined which is used as input parameter for all subesquent OpenVX object create APIs
- Create OpenVX context.
This MUST be done first before any OpenVX API call. The context that is returned is used as input for subsequent OpenVX APIs
- Create OpenVX graph.
- Create image object.
Follow the comments in tivx_utils_create_vximage_from_bmpfile() to see how a vx_image object is created and filled with RGB data from BMP file IN_FILE_NAME
- Show image attributes.
Follow the comments in show_image_attributes() to see how image attributes are queried and displayed.
- Create OpenVX distribution.
Creates distribution with parameters num_bins (256), offset (0) and range (256)
Below is equivalent of doing node0 = vxHistogramNode(graph, in_image, histogram);
- Verify graph object.
Verifies that all parameters of graph object are valid.
export graph to dot file, which can be coverted to jpg using dot tool
- Show graph attributes.
Follow the comments in show_graph_attributes() to see how graph attributes are queried and displayed.
- Show node attributes.
Follow the comments in show_node_attributes() to see how node attributes are queried and displayed.
- Schedule graph.
Schedules graph for future execution. vxVerifyGraph must return VX_SUCCESS before this function will pass.
- Wait graph.
Waits for graph to complete.
- Show graph attributes.
Follow the comments in show_graph_attributes() to see how graph attributes are queried and displayed.
- Show node attributes.
Follow the comments in show_node_attributes() to see how node attributes are queried and displayed.
- Show image attributes.
Follow the comments in show_image_attributes() to see how image attributes are queried and displayed.
- Save image object to bitmap file OUT_FILE_NAME.
Follow the comments in tivx_utils_save_vximage_to_bmpfile() to see how data in vx_image object is accessed to store pixel values from the image object to BMP file OUT_FILE_NAME
- Release image object.
Since we are done with using this image object, release it
- Release image object.
Since we are done with using this image object, release it
- Release distribution object.
Since we are done with using this distribution object, release it
- Release node object.
Since we are done with using this node object, release it
- Release graph object.
Since we are done with using this graph object, release it
- Release context object.
Since we are done using OpenVX context, release it. No further OpenVX API calls should be done, until a context is again created using vxCreateContext()
Definition at line 127 of file vx_tutorial_image_histogram.c.