Ask Your Question

Revision history [back]

OpenCV Sobel kernel maximum aperture size 7 or 31

The OpenCV documentation states here that the maximum kernel size for getDerivKernels() is 7.

However, the code here states that the kernel size can be up to 31.

Why does the documentation say up to 7, when it is allowed up to 31? And why is it limited to 31?

OpenCV Sobel derivative kernel maximum aperture size 7 or 31

The OpenCV documentation states here that the maximum kernel size for getDerivKernels() is 7.

However, the code here states that the kernel size can be up to 31.

Why does the documentation say up to 7, when it is allowed up to 31? And why is it limited to 31?

Update: As kbarni says, the kernel is padded with zeroes, so after 7x7 the kernel basically stays the same. But why has it been limited to 31x31?