# Why do we always use square kernels for filters?

In image processing, why do we always use odd square kernels(3x3, 5x5, 7x7, etc.) for filters?

Why can't we use kernels of size 3x1, 5x3, etc. that are rectangular kernels? Also, why do we not prefer even kernels (2x2, 4x4, 6x6, etc.)?

Kernel size selection is often supported in the filter kernel options in the image processing packages, such as all the imfilter related functions in Matlab image processing toolbox. Yet I would also like to take an high-pass filter example if you design the filters by yourself. For a square kernel with odd dimensions, the value for all filter weights can be set to a negative value, except for the center cell, which has a positive value which increases with the size of the kernel; A square kernel that has even dimensions has the positive value in the central group of four cells; A rectangular kernel has a center group of positive value cells in proportion to the kernel's dimensions. They all work as a high-pass filter.