



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

from digital_image_processing.filters.convolve import img_convolve


def 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

					_lowerCAmelCase      =   np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]      )
					_lowerCAmelCase      =   np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]      )

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

					_lowerCAmelCase      =   np.sqrt((np.square(snake_case      )) + (np.square(snake_case      ))      )
					_lowerCAmelCase      =   dst_xy * 2_55 / np.max(snake_case      )
					_lowerCAmelCase      =   dst_xy.astype(np.uinta      )

					_lowerCAmelCase      =   np.arctana(snake_case     ,						snake_case      )
					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)








from math import exp


def 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

					return 8 * x - 2 * exp(-x      )


def 		_UpperCAmelCase    (				snake_case     ,						snake_case     ,						snake_case      ):





					"""simple docstring"""

					_lowerCAmelCase      =   lower_bound
					_lowerCAmelCase      =   upper_bound
					for _ in range(0     ,						snake_case      ):
										_lowerCAmelCase     ,     _lowerCAmelCase      =   xa, xa - (f(snake_case      ) * (xa - xa)) / (f(snake_case      ) - f(snake_case      ))
					return xa


if __name__ == "__main__":
	print(f"Example: {secant_method(1, 3, 2)}")



