





'''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 				_lowerCamelCase(	UpperCamelCase__     :			Optional[int]		)		->	List[str]:
    A							:							Optional[int]				=    np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]		)
    A							:							List[str]				=    np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]		)

    A							:							str				=    np.abs(img_convolve(UpperCamelCase__     ,							UpperCamelCase__		)		)
    A							:							int				=    np.abs(img_convolve(UpperCamelCase__     ,							UpperCamelCase__		)		)
    # modify the pix within [0, 255]
    A							:							List[Any]				=    dst_x * 255 / np.max(UpperCamelCase__		)
    A							:							Dict				=    dst_y * 255 / np.max(UpperCamelCase__		)

    A							:							int				=    np.sqrt((np.square(UpperCamelCase__		)) + (np.square(UpperCamelCase__		))		)
    A							:							int				=    dst_xy * 255 / np.max(UpperCamelCase__		)
    A							:							Optional[int]				=    dst_xy.astype(np.uinta		)

    A							:							Optional[int]				=    np.arctana(UpperCamelCase__     ,							UpperCamelCase__		)
    return dst, theta


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

     snake_case_     			=						sobel_filter(gray)

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


'''simple docstring'''







def 				_snake_case (		lowercase						)       ->       int:
				if not isinstance(lowercase			,    lowercase						):
								__a       :     Union[str, Any]								=	F"""Input value of [number={number}] must be an integer"""
								raise TypeError(lowercase						)
				if number < 1:
								raise ValueError("""Input must be a positive integer"""						)
				return number * (2 * number - 1)


if __name__ == "__main__":
					import doctest

					doctest.testmod()