Defines the Threshold Object Interface.
|
typedef struct _vx_threshold * | vx_threshold |
| The Threshold Object. A thresholding object contains the types and limit values of the thresholding required.
|
|
|
vx_status VX_API_CALL | vxCopyThresholdOutput (vx_threshold thresh, vx_pixel_value_t *true_value_ptr, vx_pixel_value_t *false_value_ptr, vx_enum usage, vx_enum user_mem_type) |
| Allows the application to copy the true and false output values from/into a threshold object. More...
|
|
vx_status VX_API_CALL | vxCopyThresholdRange (vx_threshold thresh, vx_pixel_value_t *lower_value_ptr, vx_pixel_value_t *upper_value_ptr, vx_enum usage, vx_enum user_mem_type) |
| Allows the application to copy thresholding values from/into a threshold object with type VX_THRESHOLD_TYPE_RANGE . More...
|
|
vx_status VX_API_CALL | vxCopyThresholdValue (vx_threshold thresh, vx_pixel_value_t *value_ptr, vx_enum usage, vx_enum user_mem_type) |
| Allows the application to copy the thresholding value from/into a threshold object with type VX_THRESHOLD_TYPE_BINARY . More...
|
|
vx_threshold VX_API_CALL | vxCreateThresholdForImage (vx_context context, vx_enum thresh_type, vx_df_image input_format, vx_df_image output_format) |
| Creates a threshold object and returns a reference to it. More...
|
|
vx_threshold VX_API_CALL | vxCreateVirtualThresholdForImage (vx_graph graph, vx_enum thresh_type, vx_df_image input_format, vx_df_image output_format) |
| Creates an opaque reference to a threshold object without direct user access. More...
|
|
vx_status VX_API_CALL | vxQueryThreshold (vx_threshold thresh, vx_enum attribute, void *ptr, vx_size size) |
| Queries an attribute on the threshold object. More...
|
|
vx_status VX_API_CALL | vxReleaseThreshold (vx_threshold *thresh) |
| Releases a reference to a threshold object. The object may not be garbage collected until its total reference count is zero. More...
|
|
vx_status VX_API_CALL | vxSetThresholdAttribute (vx_threshold thresh, vx_enum attribute, const void *ptr, vx_size size) |
| Sets attributes on the threshold object. More...
|
|
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). Use with Canny Edge Detection.
|
Definition at line 1053 of file vx_types.h.
The threshold attributes.
Enumerator |
---|
VX_THRESHOLD_TYPE |
The value type of the threshold. Read-only. Use a vx_enum parameter. Will contain a vx_threshold_type_e .
|
VX_THRESHOLD_INPUT_FORMAT |
The input image format the threshold was created for. Read-only. Use a vx_enum parameter. Will contain a vx_df_image_e .
|
VX_THRESHOLD_OUTPUT_FORMAT |
The output image format the threshold was created for. Read-only. Use a vx_enum parameter. Will contain a vx_df_image_e .
|
Definition at line 1063 of file vx_types.h.
Creates a threshold object and returns a reference to it.
The threshold object defines the parameters of a thresholding operation to an input image, that generates an output image that can have a different format. The thresholding 'false' or 'true' output values are specified per pixel channels of the output format and can be modified with vxCopyThresholdOutput
. The default 'false' output value of pixels channels should be 0, and the default 'true' value should be non-zero. For standard image formats, default output pixel values are defined as following:
- VX_DF_IMAGE_RGB : false={0, 0, 0}, true={255,255,255}
- VX_DF_IMAGE_RGBX : false={0, 0, 0, 0}, true={255,255,255,255}
- VX_DF_IMAGE_NV12 : false={0, 0, 0}, true={255,255,255}
- VX_DF_IMAGE_NV21 : false={0, 0, 0}, true={255,255,255}
- VX_DF_IMAGE_UYVY : false={0, 0, 0}, true={255,255,255}
- VX_DF_IMAGE_YUYV : false={0, 0, 0}, true={255,255,255}
- VX_DF_IMAGE_IYUV : false={0, 0, 0}, true={255,255,255}
- VX_DF_IMAGE_YUV4 : false={0, 0, 0}, true={255,255,255}
- VX_DF_IMAGE_U8 : false=0, true=0xFF
- VX_DF_IMAGE_S16 : false=0, true=-1
- VX_DF_IMAGE_U16 : false=0, true=0xFFFF
- VX_DF_IMAGE_S32 : false=0, true=-1
- VX_DF_IMAGE_U32 : false=0, true=0xFFFFFFFF
- Parameters
-
[in] | context | The reference to the context in which the object is created. |
[in] | thresh_type | The type of thresholding operation. |
[in] | input_format | The format of images that will be used as input of the thresholding operation. |
[in] | output_format | The format of images that will be generated by the thresholding operation. |
- Returns
- A threshold reference
vx_threshold
. Any possible errors preventing a successful creation should be checked using vxGetStatus
.
Creates an opaque reference to a threshold object without direct user access.
- Parameters
-
[in] | graph | The reference to the parent graph. |
[in] | thresh_type | The type of thresholding operation. |
[in] | input_format | The format of images that will be used as input of the thresholding operation. |
[in] | output_format | The format of images that will be generated by the thresholding operation. |
- See also
vxCreateThresholdForImage
- Returns
- A threshold reference
vx_threshold
. Any possible errors preventing a successful creation should be checked using vxGetStatus
.
Allows the application to copy the thresholding value from/into a threshold object with type VX_THRESHOLD_TYPE_BINARY
.
- Parameters
-
[in] | thresh | The reference to the threshold object that is the source or the destination of the copy. |
[in,out] | value_ptr | The address of the memory location where to store the thresholding value if the copy was requested in read mode, or from where to get the thresholding value to store into the threshold object if the copy was requested in write mode. |
[in] | usage | This declares the effect of the copy with regard to the threshold object using the vx_accessor_e enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are supported:
VX_READ_ONLY means that the thresholding value is copied from the threshold object into the user memory. After the copy, only the field of the (*value_ptr) union that corresponds to the input image format of the threshold object is meaningful.
VX_WRITE_ONLY means the field of the (*value_ptr) union corresponding to the input format of the threshold object is copied into the threshold object.
|
[in] | user_mem_type | A vx_memory_type_e enumeration that specifies the type of the memory referenced by value_ptr . |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_ERROR_INVALID_REFERENCE | The threshold reference is not actually a threshold reference. |
VX_ERROR_NOT_COMPATIBLE | The threshold object doesn't have type VX_THRESHOLD_TYPE_BINARY |
VX_ERROR_INVALID_PARAMETERS | An other parameter is incorrect. |
Allows the application to copy thresholding values from/into a threshold object with type VX_THRESHOLD_TYPE_RANGE
.
- Parameters
-
[in] | thresh | The reference to the threshold object that is the source or the destination of the copy. |
[in,out] | lower_value_ptr | The address of the memory location where to store the lower thresholding value if the copy was requested in read mode, or from where to get the lower thresholding value to store into the threshold object if the copy was requested in write mode. |
[in,out] | upper_value_ptr | The address of the memory location where to store the upper thresholding value if the copy was requested in read mode, or from where to get the upper thresholding value to store into the threshold object if the copy was requested in write mode. |
[in] | usage | This declares the effect of the copy with regard to the threshold object using the vx_accessor_e enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are supported:
VX_READ_ONLY means that thresholding values are copied from the threshold object into the user memory. After the copy, only the field of (*lower_value_ptr) and (*upper_value_ptr) unions that corresponds to the input image format of the threshold object is meaningful.
VX_WRITE_ONLY means the field of the (*lower_value_ptr) and (*upper_value_ptr) unions corresponding to the input format of the threshold object is copied into the threshold object.
|
[in] | user_mem_type | A vx_memory_type_e enumeration that specifies the type of the memory referenced by lower_value_ptr and upper_value_ptr . |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_ERROR_INVALID_REFERENCE | The threshold reference is not actually a threshold reference. |
VX_ERROR_NOT_COMPATIBLE | The threshold object doesn't have type VX_THRESHOLD_TYPE_RANGE |
VX_ERROR_INVALID_PARAMETERS | An other parameter is incorrect. |
Allows the application to copy the true and false output values from/into a threshold object.
- Parameters
-
[in] | thresh | The reference to the threshold object that is the source or the destination of the copy. |
[in,out] | true_value_ptr | The address of the memory location where to store the true output value if the copy was requested in read mode, or from where to get the true output value to store into the threshold object if the copy was requested in write mode. |
[in,out] | false_value_ptr | The address of the memory location where to store the false output value if the copy was requested in read mode, or from where to get the false output value to store into the threshold object if the copy was requested in write mode. |
[in] | usage | This declares the effect of the copy with regard to the threshold object using the vx_accessor_e enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are supported:
VX_READ_ONLY means that true and false output values are copied from the threshold object into the user memory. After the copy, only the field of (*true_value_ptr) and (*false_value_ptr) unions that corresponds to the output image format of the threshold object is meaningful.
VX_WRITE_ONLY means the field of the (*true_value_ptr) and (*false_value_ptr) unions corresponding to the output format of the threshold object is copied into the threshold object.
|
[in] | user_mem_type | A vx_memory_type_e enumeration that specifies the type of the memory referenced by true_value_ptr and false_value_ptr . |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_ERROR_INVALID_REFERENCE | The threshold reference is not actually a threshold reference. |
VX_ERROR_INVALID_PARAMETERS | An other parameter is incorrect. |
Releases a reference to a threshold object. The object may not be garbage collected until its total reference count is zero.
- Parameters
-
[in] | thresh | The pointer to the threshold to release. |
- Postcondition
- After returning from this function the reference is zeroed.
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | thresh is not a valid vx_threshold reference. |
Sets attributes on the threshold object.
- 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 which to set the attribute. |
[in] | size | The size of the data pointed to by ptr. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | thresh is not a valid vx_threshold reference. |
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 location at which to store the resulting value. |
[in] | size | The size of the container to which ptr points. |
- Returns
- A
vx_status_e
enumeration.
- Return values
-
VX_SUCCESS | No errors; any other value indicates failure. |
VX_ERROR_INVALID_REFERENCE | thresh is not a valid vx_threshold reference. |