Hi All,
We are working on a project.IN which, We are using TDA2xx EVM to develop algorithms.We are new for this TDA2x ADAS family.
We want to develop canny edge detection algorithm.So, we have used TI's vxlib library APIs.
For developing this algorithm we have to follow below-listed steps,
1.Gradient magnitude and orientation computation using a noise resistant operator (Sobel).
2.Non-maximum suppression of the gradient magnitude, using the gradient orientation information.
3.Apply double threshold to determine potential edges.
4.Tracing edges in the modified gradient image using hysteresis thresholding to produce a binary result.
VxLIB has provides above all steps' API to develop canny edge detection, When we use Sobel filter image API (first step ) then output frame's width is going half and this API consume the 90 % of DSP used.So, We have below listed queries for this
1. Why this API takes 90% of CPU usage?
2. How to we can achieve full frame width in Sobel API?
We have attached sobel API's c file for your reference.
Please let us know if you need more information from our side.
Thanks,
Parth
1) To compute sobel filter image we have used VXLIB_sobel_3x3_i8u_o16s_o16s API.
See the below code for API we have sets parameter.
src_addr.dim_x = width;
src_addr.dim_y = height;
src_addr.stride_y = inPitch[0];
src_addr.data_type = VXLIB_UINT8;
dst_x_addr.dim_x = width - 2;
dst_x_addr.dim_y = height - 2;
dst_x_addr.stride_y = inPitch[0];
dst_x_addr.data_type = VXLIB_INT16;
dst_y_addr.dim_x = width - 2;
dst_y_addr.dim_y = height - 2;
dst_y_addr.stride_y = inPitch[0];
dst_y_addr.data_type = VXLIB_INT16;
VXLIB_sobel_3x3_i8u_o16s_o16s((const uint8_t *)inputPtr,&src_addr,
(int16_t *)pBufGradX, &dst_x_addr,
(int16_t *)pBufGradY, &dst_y_addr);
2) To compute L1 norm form we have used VXLIB_normL1_i16s_i16s_o16u API.
See the below code for API we have sets parameter.
src_x_addr.dim_x = width - 2;
src_x_addr.dim_y = height - 2;
src_x_addr.stride_y = inPitch[0];
src_x_addr.data_type = VXLIB_INT16;
src_y_addr.dim_x = width - 2;
src_y_addr.dim_y = height - 2;
src_y_addr.stride_y = inPitch[0];
src_y_addr.data_type = VXLIB_INT16;
dst_addr.dim_x = width;
dst_addr.dim_y = height;
dst_addr.stride_y = outPitch[0];
dst_addr.data_type = VXLIB_UINT16;
VXLIB_normL1_i16s_i16s_o16u((const int16_t *)pBufGradX, &src_x_addr,
(const int16_t *)pBufGradY, &src_y_addr,
(uint16_t *)outputPtr, &dst_addr);
