






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

from digital_image_processing.filters.convolve import img_convolve

def    lowerCAmelCase__		(			_a				:	str			):
		snake_case_ :							Optional[int]         =				np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]			)
		snake_case_ :							Tuple         =				np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]			)

		snake_case_ :							Union[str, Any]         =				np.abs(img_convolve(_a     ,					_a			)			)
		snake_case_ :							Union[str, Any]         =				np.abs(img_convolve(_a     ,					_a			)			)
		# modify the pix within [0, 255]
		snake_case_ :							Optional[Any]         =				dst_x * 2_55 / np.max(_a			)
		snake_case_ :							Dict         =				dst_y * 2_55 / np.max(_a			)

		snake_case_ :							Optional[int]         =				np.sqrt((np.square(_a			)) + (np.square(_a			))			)
		snake_case_ :							str         =				dst_xy * 2_55 / np.max(_a			)
		snake_case_ :							Tuple         =				dst_xy.astype(np.uinta			)

		snake_case_ :							Union[str, Any]         =				np.arctana(_a     ,					_a			)
		return dst, theta


if __name__ == "__main__":
							# read original image
							lowercase     :							Tuple	     =			imread('''../image_data/lena.jpg''')
							# turn image in gray scale value
							lowercase     :							Optional[Any]	     =			cvtColor(img, COLOR_BGR2GRAY)

							lowercase     ,lowercase     :							List[Any]	     =			sobel_filter(gray)

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








def    lowerCAmelCase__		(			_a				:	str     ,					_a				:	int = 13			):
		snake_case_ :							List[Any]         =				""
		for c in s:
				if "A" <= c <= "Z":
						out += chr(ord("A"			) + (ord(_a			) - ord("A"			) + n) % 26			)
				elif "a" <= c <= "z":
						out += chr(ord("a"			) + (ord(_a			) - ord("a"			) + n) % 26			)
				else:
						out += c
		return out

def    lowerCAmelCase__		(			):
		snake_case_ :							int         =				input("Enter message: "			)

		snake_case_ :							List[Any]         =				dencrypt(_a     ,					13			)
		print("Encryption:"     ,					_a			)

		snake_case_ :							int         =				dencrypt(_a     ,					13			)
		print("Decryption: "     ,					_a			)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							main()
