Forums - face recognition

2 posts / 0 new
Last post
face recognition
Join Date: 29 Jan 21
Posts: 2
Posted: Fri, 2021-01-29 01:15

void fcvImageGradientSobelPlanars16(const uint8_t *__restrict src,  unsigned int srcWidth,  unsigned int srcHeight,  unsigned int srcStride,  int16_t *__restrict dx,  int16_t *__restrict dy  )

i am new to fastcv. i am caclulating gradient matrix in x direction and y direction using above api. but i don't know how to pass parameter

here src means input image how to pass digital image there. should i pass array of pixel values or image pointer. srcStride dx and dy what value i need to give. If there is any code snippets please share and tell how to give parameter to the above api.

Thank you in advance

  • Up0
  • Down0
Join Date: 29 May 18
Posts: 48
Posted: Tue, 2021-03-23 04:14


Please use  fcvImageGradientSobelPlanars16_v3 instead.

src is the pointer for image buffer. fill it as follows:

#define  src_image_width 640
#define  src_image_height 480
#define src_bpp 2 //bit per pixel, 2, 3 etc
int read_buffer_size  = src_image_width * src_image_height * src_bpp;
//allocate read_buffer
uint8_t *src   = new uint8_t[read_buffer_size];
//read and fill from file - example. src_image_path points to a file with yuv/rgb data 
FILE *f_src = fopen(src_image_path, "rb");
fread(src, sizeof(uint8_t), read_buffer_size, f_src);

In this case srcStride will be src_image_width * src_bpp

srcStride =  640 * 2


dx and dy are destination buffers where horizontal and vertical gradient will be stored

#define dst_bpp 2 //bit per pixel, 2, 3 etc
#define  dst_image_width 640
#define  dst_image_height 480
dstStride = dst_image_width * dst_bpp
//allocate gradient buffers
uint16_t *dx   = new uint16_t[dst_image_width * dst_image_height];
uint16_t *dy   = new uint16_t[dst_image_width * dst_image_height];


  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.