






def 				snake_case  (     lowerCamelCase = 10					):




	'''simple docstring'''







	if not isinstance(lowerCamelCase				,  lowerCamelCase					) or n < 0:
		raise ValueError("""Invalid input"""					)
	__lowercase					       =  10**n
	__lowercase					       =  28_433 * (pow(2				,  7_830_457				,  lowerCamelCase					)) + 1
	return str(number % modulus					)


if __name__ == "__main__":
						from doctest import testmod

						testmod()
						print(F'''{solution(10) = }''')









import numpy as np
from cva import COLOR_BGR2GRAY, CV_8UC3, cvtColor, filteraD, imread, imshow, waitKey





def 				snake_case  (     lowerCamelCase				,  lowerCamelCase				,  lowerCamelCase				,  lowerCamelCase				,  lowerCamelCase				,  lowerCamelCase					):




	'''simple docstring'''







	if (ksize % 2) == 0:
		__lowercase             =  ksize + 1
	__lowercase             =  np.zeros((ksize, ksize)				,  dtype=np.floataa					)

	# each value
	for y in range(lowerCamelCase					):
		for x in range(lowerCamelCase					):
			# distance from center
			__lowercase             =  x - ksize // 2
			__lowercase             =  y - ksize // 2

			# degree to radiant
			__lowercase             =  theta / 180 * np.pi
			__lowercase             =  np.cos(_theta					)
			__lowercase             =  np.sin(_theta					)

			# get kernel x
			__lowercase             =  cos_theta * px + sin_theta * py

			# get kernel y
			__lowercase             =  -sin_theta * px + cos_theta * py

			# fill kernel
			__lowercase             =  np.exp(
			    -(_x**2 + gamma**2 * _y**2) / (2 * sigma**2)					) * np.cos(2 * np.pi * _x / lambd + psi					)

	return gabor


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						# read original image
						__UpperCamelCase      :      List[Any]     						=						imread("""../image_data/lena.jpg""")
						# turn image in gray scale value
						__UpperCamelCase      :      Union[str, Any]     						=						cvtColor(img, COLOR_BGR2GRAY)

						# Apply multiple Kernel to detect edges
						__UpperCamelCase      :      Union[str, Any]     						=						np.zeros(gray.shape[:2])
						for theta in [0, 30, 60, 90, 120, 150]:
												__UpperCamelCase      :      Tuple     						=						gabor_filter_kernel(10, 8, theta, 10, 0, 0)
												out += filteraD(gray, CV_8UC3, kernel_aa)
						__UpperCamelCase      :      List[str]     						=						out / out.max() * 255
						__UpperCamelCase      :      List[str]     						=						out.astype(np.uinta)

						imshow("""Original""", gray)
						imshow("""Gabor filter with 20x20 mask and 6 directions""", out)

						waitKey(0)

