


"""simple docstring"""






class     A:

  """simple docstring"""





  def __init__(   self      )			->  None:

     """simple docstring"""



     _UpperCamelCase				:Tuple				    =  [0, 1]





  def      _UpperCamelCase(   self				,							SCREAMING_SNAKE_CASE__      )			->  list:

     """simple docstring"""



     if (difference := index - (len(self.sequence      ) - 2)) >= 1:
        for _ in range(__A      ):
           self.sequence.append(self.sequence[-1] + self.sequence[-2]      )
     return self.sequence[:index]





def 							A_					(   )				->     None:
   print(
       '''Fibonacci Series Using Dynamic Programming\n'''					,				'''Enter the index of the Fibonacci number you want to calculate '''					,				'''in the prompt below. (To exit enter exit or Ctrl-C)\n'''					,				sep=''''''					,				)
   _UpperCamelCase				:List[str]				    =  Fibonacci()

   while True:
      _UpperCamelCase				:str				    =  input('''>> '''		)
      if prompt in {"exit", "quit"}:
         break

      try:
         _UpperCamelCase				:int				    =  int(snake_case__		)
      except ValueError:
         print('''Enter a number or \'exit\''''		)
         continue

      print(fibonacci.get(snake_case__		)		)


if __name__ == "__main__":
     main()





"""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_					(   snake_case__		)				->     str:
			_UpperCamelCase				:List[Any]				    =  np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]		)
			_UpperCamelCase				:Dict				    =  np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]		)

			_UpperCamelCase				:List[str]				    =  np.abs(img_convolve(snake_case__					,				snake_case__		)		)
			_UpperCamelCase				:Dict				    =  np.abs(img_convolve(snake_case__					,				snake_case__		)		)
			# modify the pix within [0, 255]
			_UpperCamelCase				:List[Any]				    =  dst_x * 2_55 / np.max(snake_case__		)
			_UpperCamelCase				:Tuple				    =  dst_y * 2_55 / np.max(snake_case__		)

			_UpperCamelCase				:Tuple				    =  np.sqrt((np.square(snake_case__		)) + (np.square(snake_case__		))		)
			_UpperCamelCase				:Any				    =  dst_xy * 2_55 / np.max(snake_case__		)
			_UpperCamelCase				:Optional[int]				    =  dst_xy.astype(np.uinta		)

			_UpperCamelCase				:str				    =  np.arctana(snake_case__					,				snake_case__		)
			return dst, theta


if __name__ == "__main__":
					# read original image
					UpperCamelCase__							:List[str]       =  imread("""../image_data/lena.jpg""")
					# turn image in gray scale value
					UpperCamelCase__							:Union[str, Any]       =  cvtColor(img, COLOR_BGR2GRAY)

					UpperCamelCase__      , UpperCamelCase__							:Optional[int]       =  sobel_filter(gray)

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

