# Screen output error

**URL:** <https://forum.opencv.org/t/screen-output-error/12768>\
**Category:** Python\
**Created:** [April 11, 2023, 3:12pm UTC](https://forum.opencv.org/t/screen-output-error/12768 "2023-04-11T15:12:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![evilmonkey](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/evilmonkey/32/7538_2.png) [@evilmonkey](https://forum.opencv.org/u/evilmonkey)\
**Post date:** [April 11, 2023, 3:12pm UTC](https://forum.opencv.org/t/screen-output-error/12768/1 "2023-04-11T15:12:02Z")

</div>

hello! i m learning about Dog filtering from examples. and i succeed to print some filters, but not all.  
problem is print Dog\_x filter, Dog\_y filter.  
sceens are so small and not showing.  
i think this is mask problem.  
could you help to check my code?  
thank you !!!

here is my code.

```auto
import cv2
import numpy as np

import os, sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname( __file__ ))))
from my_filtering_true import my_filtering

def get_DoG_filter(fsize, sigma=1):
    
    y, x = np.mgrid[-(fsize//2):(fsize//2)+1, -(fsize//2):(fsize//2)+1]

    DoG_x = (-x/sigma**2) * np.exp(-(x**2+y**2)/(2*sigma**2))
    DoG_y = (-y/sigma**2) * np.exp(-(x**2+y**2)/(2*sigma**2))

    return DoG_x, DoG_y

def main():
    src = cv2.imread('Lena.png', cv2.IMREAD_GRAYSCALE)
    DoG_x, DoG_y = get_DoG_filter(fsize=3, sigma=1)

    
    x, y = get_DoG_filter(fsize=256, sigma=10)
    x = ((DoG_x-np.min(DoG_x))/np.max(DoG_x- np.min(DoG_x))*255).astype(np.uint8)
    y = ((DoG_y-np.min(DoG_y))/np.max(DoG_y- np.min(DoG_y))*255).astype(np.uint8)

    dst_x = my_filtering(src, DoG_x)
    dst_y = my_filtering(src, DoG_y)

    
    dst = np.sqrt((dst_x)**2 + (dst_y)**2)

  

    cv2.imshow('DoG_x filter ', x)
    cv2.imshow('DoG_y filter ', y)
    cv2.imshow('dst_x ', dst_x/255)
    cv2.imshow('dst_y ', dst_y/255)
    cv2.imshow('dst ', dst/255)
    cv2.waitKey()
    cv2.destroyAllWindows()

if __name__ == ' __main__':
    main()

```
