How to perform arithmetic operations in floating point using visionworks?

Hi

Is there any function/API to perform power and exponential operation on vxImage. Also, scalar arithmetic operation in vxImage of floating type.

Thanks,
Krishna Kumar.G

Hi,

VisionWorks doesn’t have a power or exponential operation like TensorRT.
The closest API is nvxcuMultiply and nvxcuMultiplyByScalar.

nvxcuMultiply computes element-wise multiplication between two images and a scalar value.

nvxcu_error_status_e nvxcuMultiply ( const nvxcu_image_t * in1,
                                     const nvxcu_image_t * in2,
                                     float scale,
                                     nvxcu_convert_policy_e overflow_policy,
                                     nvxcu_round_policy_e rounding_policy,
                                     const nvxcu_image_t * out,
                                     const nvxcu_exec_target_t * exec_target 
)

So you can approximate pow2 with by setting in1=in2=input.

There is another scalar function but only NVX_DF_IMAGE_2S16 input is accepted.

vx_node nvxMultiplyByScalarNode ( vx_graph graph,
                                  vx_image src,
                                  vx_image dst,
                                  vx_float32 alpha 
)

Thanks.