


'''simple docstring'''


from itertools import product

from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import dot, exp, mgrid, pi, ravel, square, uinta, zeros






def  __lowerCAmelCase (__lowerCAmelCase      , __lowerCAmelCase   ):
		_UpperCAmelCase		:       Any								=      k_size // 2
		_UpperCAmelCase		:       Dict								=      mgrid[0 - center : k_size - center, 0 - center : k_size - center]
		_UpperCAmelCase		:       List[str]								=      1 / (2 * pi * sigma) * exp(-(square(__lowerCAmelCase   ) + square(__lowerCAmelCase   )) / (2 * square(__lowerCAmelCase   ))   )
		return g






def  __lowerCAmelCase (__lowerCAmelCase      , __lowerCAmelCase      , __lowerCAmelCase   ):
		_UpperCAmelCase		:       Dict								=      image.shape[0], image.shape[1]
		# dst image height and width
		_UpperCAmelCase		:       Tuple								=      height - k_size + 1
		_UpperCAmelCase		:       Optional[int]								=      width - k_size + 1

		# im2col, turn the k_size*k_size pixels into a row and np.vstack all rows
		_UpperCAmelCase		:       Union[str, Any]								=      zeros((dst_height * dst_width, k_size * k_size)   )
		_UpperCAmelCase		:       List[Any]								=      0
		for i, j in product(range(__lowerCAmelCase   )      , range(__lowerCAmelCase   )   ):
				_UpperCAmelCase		:       Union[str, Any]								=      ravel(image[i : i + k_size, j : j + k_size]   )
				_UpperCAmelCase		:       List[Any]								=      window
				row += 1

		#  turn the kernel into shape(k*k, 1)
		_UpperCAmelCase		:       Tuple								=      gen_gaussian_kernel(__lowerCAmelCase      , __lowerCAmelCase   )
		_UpperCAmelCase		:       Optional[int]								=      ravel(__lowerCAmelCase   )

		# reshape and get the dst image
		_UpperCAmelCase		:       List[str]								=      dot(__lowerCAmelCase      , __lowerCAmelCase   ).reshape(__lowerCAmelCase      , __lowerCAmelCase   ).astype(__lowerCAmelCase   )

		return dst


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

						# get values with two different mask size
						lowerCamelCase__    	=     gaussian_filter(gray, 3, sigma=1)
						lowerCamelCase__    	=     gaussian_filter(gray, 5, sigma=0.8)

						# show result images
						imshow('gaussian filter with 3x3 mask', gaussianaxa)
						imshow('gaussian filter with 5x5 mask', gaussianaxa)
						waitKey()







'''simple docstring'''


def  __lowerCAmelCase ():
		_UpperCAmelCase		:       str								=      0
		for i in range(1      , 1_001   ):
				total += i**i
		return str(__lowerCAmelCase   )[-10:]


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



