The scale value Custom convolution kernel

In the OpenVX custom convolution kernel, what “scale” value exactly mean?

Is it just a kernel size? (e.g., 9 in 3x3 ksize…)

Best regards,
Sanghyun

Or… is it the sum of each element of kernel matrix?

Scale is the final divisor of the sum.

example:
input image = p
coefficients[3][3] = c
scale = s
output value = v

v = ( (p[0][0] * c[0][0]) + (p[0][1] * c[0][1]) + (p[0][2] * c[0][2]) + (p[1][0] * c[1][0]) + (p[1][1] * c[1][1]) + (p[1][2] * c[1][2]) + (p[2][0] * c[2][0]) + (p[2][1] * c[2][1]) + (p[2][2] * c[2][2]) ) / s;

Also s != 0

      • Updated - - -

Normally s is the sum of the coefficients, but it can be set manually too.

Thanks for your reply.
The reason why I asked this question is that there’s no field named “scale” in the specification document, describing the Custom Convolution kernel. Specifically, there’s no input parameter named “scale” in vxConvolveNode(…).

You’ve said that the scale value can be set menually. Then, the scale variable is one of the member field of vx_convolution? or vx_image?
Where should ‘scale’ be located?

Best regards,
Sanghyun

It’s an attribute of the vx_convolution object. *

vxSetConvolutionAttribute(conv, VX_CONVOLUTION_ATTRIBUTE_SCALE, &scale, sizeof(scale));