


"""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__			(					__lowercase )						->						Tuple:
				_A       	=      np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]] )
				_A       	=      np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]] )

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

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

				_A       	=      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   a__			(					__lowercase  ,      __lowercase )						->						Tuple:
				_A       	=      1
				while b > 0:
								if b & 1:
												res *= a

								a *= a
								b >>= 1

				return res






def   a__			(					__lowercase  ,      __lowercase  ,      __lowercase )						->						Optional[Any]:
				_A       	=      1
				while b > 0:
								if b & 1:
												_A       	=      ((res % c) * (a % c)) % c

								a *= a
								b >>= 1

				return res