




"""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 					UpperCamelCase__       (						lowercase__					:       Tuple				):
		snake_case						:  Any        =			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						:  Dict        =			np.abs(img_convolve(lowercase__    ,       lowercase__				)				)
		snake_case						:  List[str]        =			np.abs(img_convolve(lowercase__    ,       lowercase__				)				)
		# modify the pix within [0, 255]
		snake_case						:  Any        =			dst_x * 255 / np.max(lowercase__				)
		snake_case						:  Tuple        =			dst_y * 255 / np.max(lowercase__				)

		snake_case						:  Dict        =			np.sqrt((np.square(lowercase__				)) + (np.square(lowercase__				))				)
		snake_case						:  Optional[Any]        =			dst_xy * 255 / np.max(lowercase__				)
		snake_case						:  List[Any]        =			dst_xy.astype(np.uinta				)

		snake_case						:  str        =			np.arctana(lowercase__    ,       lowercase__				)
		return dst, theta


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

							__A						,    __A							=     sobel_filter(gray)

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







"""simple docstring"""

def 					UpperCamelCase__       (						lowercase__					:       int				):
		if not isinstance(lowercase__    ,       lowercase__				):
				raise ValueError("double_factorial() only accepts integral values"				)
		if n < 0:
				raise ValueError("double_factorial() not defined for negative values"				)
		return 1 if n <= 1 else n * double_factorial(n - 2				)


if __name__ == "__main__":
							import doctest

							doctest.testmod()

