





"""simple docstring"""
import numpy as np
from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey

from digital_image_processing.filters.convolve import img_convolve

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  Union[str, Any]       ):
 lowerCAmelCase  							=      np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]       )
 lowerCAmelCase  							=      np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]       )

 lowerCAmelCase  							=      np.abs(img_convolve(_UpperCAmelCase   ,			_UpperCAmelCase       )       )
 lowerCAmelCase  							=      np.abs(img_convolve(_UpperCAmelCase   ,			_UpperCAmelCase       )       )
 # modify the pix within [0, 255]
 lowerCAmelCase  							=      dst_x * 255 / np.max(_UpperCAmelCase       )
 lowerCAmelCase  							=      dst_y * 255 / np.max(_UpperCAmelCase       )

 lowerCAmelCase  							=      np.sqrt((np.square(_UpperCAmelCase       )) + (np.square(_UpperCAmelCase       ))       )
 lowerCAmelCase  							=      dst_xy * 255 / np.max(_UpperCAmelCase       )
 lowerCAmelCase  							=      dst_xy.astype(np.uinta       )

 lowerCAmelCase  							=      np.arctana(_UpperCAmelCase   ,			_UpperCAmelCase       )
 return dst, theta


if __name__ == "__main__":
       # read original image
       __UpperCamelCase			:		Dict		    =   imread('''../image_data/lena.jpg''')
       # turn image in gray scale value
       __UpperCamelCase			:		str		    =   cvtColor(img, COLOR_BGR2GRAY)

       __UpperCamelCase    ,__UpperCamelCase			:		Union[str, Any]		    =   sobel_filter(gray)

       # show result images
       imshow('''sobel filter''', sobel_grad)
       imshow('''sobel theta''', sobel_theta)
       waitKey(0)












"""simple docstring"""
__UpperCamelCase			:		Tuple		    =   10**8

def 						_SCREAMING_SNAKE_CASE       (_UpperCAmelCase :  int       ):
 if n % 10 == 0:
  return False
 lowerCAmelCase  							=      str(_UpperCAmelCase       )
 return s == s[::-1]

def 						_SCREAMING_SNAKE_CASE       ():
 lowerCAmelCase  							=      set()
 lowerCAmelCase  							=      1
 lowerCAmelCase  							=      5
 while sum_squares < LIMIT:
  lowerCAmelCase  							=      first_square + 1
  while sum_squares < LIMIT:
   if is_palindrome(_UpperCAmelCase       ):
    answer.add(_UpperCAmelCase       )
   last_square += 1
   sum_squares += last_square**2
  first_square += 1
  lowerCAmelCase  							=      first_square**2 + (first_square + 1) ** 2

 return sum(_UpperCAmelCase       )


if __name__ == "__main__":
       print(solution())





