Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  • The middle pixel will be taken into account, i.e. in your example it will change to 94.

Small python-example to illustrate it:

>>> a = np.array([100,100,100,100,50,100,100,100,100]).reshape(3,-1)
>>> cv2.blur(a, (3,3))
array([[78, 89, 78],
       [89, 94, 89],
       [78, 89, 78]], dtype=int32)

( Note, the border pixels change here as well, since they are interpolated).

  • No, a kernel size of (1,1) doesn't make sense and will have no effect (then each pixel will just be divided by 1).

    cv2.blur(a, (1,1)) array([[100, 100, 100], [100, 50, 100], [100, 100, 100]], dtype=int32)

  • The middle pixel will be taken into account, i.e. in your example it will change to 94.

Small python-example to illustrate it:

>>> a = np.array([100,100,100,100,50,100,100,100,100]).reshape(3,-1)
>>> cv2.blur(a, (3,3))
array([[78, 89, 78],
       [89, 94, 89],
       [78, 89, 78]], dtype=int32)

( Note, the border pixels change here as well, since they are interpolated).


  • No, a kernel size of (1,1) doesn't make sense and will have no effect (then each pixel will just be divided by 1).

    >>> cv2.blur(a, (1,1)) 
     array([[100, 100, 100],
            [100,  50, 100],
            [100, 100, 100]], dtype=int32)

    dtype=int32)

The middle pixel will be taken into account, i.e. in your example it will change to 94.

Small python-example to illustrate it:

>>> a = np.array([100,100,100,100,50,100,100,100,100]).reshape(3,-1)
>>> cv2.blur(a, (3,3))
array([[78, 89, 78],
       [89, 94, 89],
       [78, 89, 78]], dtype=int32)

( Note, (Note, the border pixels change here as well, since they the border-pixels are interpolated).


No, a kernel size of (1,1) doesn't make sense and will have no effect (then each pixel will just be divided by 1).

>>> cv2.blur(a, (1,1)) 
array([[100, 100, 100],
       [100,  50, 100],
       [100, 100, 100]], dtype=int32)