```
def adaptive_gaussian_thresholding(self, filename):
    im = cv2.imread(filename, 0)
    filtered_image = cv2.adaptiveThreshold(im, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, 3, cv2.THRESH_BINARY, 3, 0)
    cv2.imwrite(filename, filtered_image)

```

> 
> 
> ```
> filtered_image = cv2.adaptiveThreshold(im, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, 3, cv2.THRESH_BINARY, 3, 0)
> error: /root/opencv/modules/imgproc/src/thresh.cpp:1287: error: (-215) blockSize % 2 == 1 && blockSize > 1 in function adaptiveThreshold
> 
> ```
> 
> 

The blocksize or tile size is the number of pixels^2 to be used for the kernel that is passed to the procedure. It needs to be an odd number. I am unsure if this is a bug or something else is wrong?

[Official documentation](http://docs.opencv.org/2.4/modules/imgproc/doc/miscellaneous_transformations.html#cv2.adaptiveThreshold)