
'''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       _a		(						_SCREAMING_SNAKE_CASE		: Union[str, Any]	):
						_SCREAMING_SNAKE_CASE					=			np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]	)
						_SCREAMING_SNAKE_CASE					=			np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]	)

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

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

						_SCREAMING_SNAKE_CASE					=			np.arctana(_SCREAMING_SNAKE_CASE						,      _SCREAMING_SNAKE_CASE	)
						return dst, theta


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

						_snake_case			,		_snake_case					: Dict     			=					sobel_filter(gray)

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

'''simple docstring'''







def       _a		(						_SCREAMING_SNAKE_CASE		: int						,      _SCREAMING_SNAKE_CASE		: int	):
						return (input_a, input_a).count(0	) % 2



def       _a		(						):
						assert xor_gate(0						,      0	) == 0
						assert xor_gate(0						,      1	) == 1
						assert xor_gate(1						,      0	) == 1
						assert xor_gate(1						,      1	) == 0


if __name__ == "__main__":
						print(xor_gate(0, 0))
						print(xor_gate(0, 1))