Hello,
I am attempting to use fcvFilterConvolveMxNu8() to perform convolution of a 320x240 image with a 11x11 kernel. The source image is of type unsigned char, and kernel is of type short, so both are in line with the requirements of the function.
The relevant code snippet is as follows:
fcvStatus op_status = fcvFilterConvolveMxNu8( (const int16_t *__restrict)myKernel, 11, 11, (int8_t)CONVOL_SHIFT_VALUE, (const uint8_t *__restrict)src, 320, 240, 320, (uint8_t *__restrict)dst, 320, FASTCV_BORDER_CONSTANT, 128 );
Here, CONVOL_SHIFT_VALUE is the 'shift' parameter of the FastCV function. Per the API documentation, "This parameter can be used to normalize the input kernel by converting the data into fixed point values. Shift can be considered as Q factor of kernel." Since my kernel is of type short, I assumed that it does not require any normalization. Therefore, I set this parameter to '1'. But I am getting an output image with completely saturated (255) pixel values.
Is my understanding wrong? What should the value of the 'shift' parameter be in this case?
Thanks and regards,
Sagar Kirtany
Hi,
I used fcvFilterConvolveMxNu8() function to perform convolution of 64x64 image with 11x11 kernel. Source image is of type uint8_t and kernel is of type short and shift value is 1 and border value is 128.
The code snippet is as follow
fcvFilterConvolveMxNu8 ((const int16_t *__restrict)kernel, kernel_width, kernel_height, shift_value, (const uint8_t *__restrict)src, src_width, src_height, src_width, (uint8_t *__restrict)dst, src_width, FASTCV_BORDER_CONSTANT, border_val);
It is working fine and I am getting output image with not completely saturated(255) pixel values.
If you are still facing problem means please send me full code, i will check it
Hello,
I managed to resolve this issue on my own, and got the proper output.
Thank you for your input.