




'''simple docstring'''


import doctest
from collections import deque

import numpy as np
class   __A :



   """simple docstring"""







   def __init__(      self						)->       Any:
      lowercase__       							=							[2, 1, 2, -1]
      lowercase__       							=							[1, 2, 3, 4]

   def snake_case_(      self						)->       int:
      lowercase__       							=							len(self.first_signal						)
      lowercase__       							=							len(self.second_signal						)

      lowercase__       							=							max(__lowercase				, __lowercase						)

      # create a zero matrix of max_length x max_length
      lowercase__       							=							[[0] * max_length for i in range(__lowercase						)]

      # fills the smaller signal with zeros to make both signals of same length
      if length_first_signal < length_second_signal:
         self.first_signal += [0] * (max_length - length_first_signal)
      elif length_first_signal > length_second_signal:
         self.second_signal += [0] * (max_length - length_second_signal)
      for i in range(__lowercase						):
         lowercase__       							=							deque(self.second_signal						)
         rotated_signal.rotate(__lowercase						)
         for j, item in enumerate(__lowercase						):
            matrix[i][j] += item

                # multiply the matrix with the first signal
      lowercase__       							=							np.matmul(np.transpose(__lowercase						)				, np.transpose(self.first_signal						)						)

      # rounding-off to two decimal places
      return [round(__lowercase				, 2						) for i in final_signal]


if __name__ == "__main__":
  doctest.testmod()








'''simple docstring'''
import numpy as np
from cva import destroyAllWindows, imread, imshow, waitKey

class     _lowerCamelCase       :




 '''simple docstring'''


 def __init__(   self   ,   __lowercase   ,   __lowercase   ,   __lowercase    ):

  """simple docstring"""







  if dst_width < 0 or dst_height < 0:
   raise ValueError('Destination width/height should be > 0'    )

  __A	:		Dict	  =      img
  __A	:		Dict	  =      img.shape[1]
  __A	:		Tuple	  =      img.shape[0]
  __A	:		List[str]	  =      dst_width
  __A	:		Tuple	  =      dst_height

  __A	:		Optional[Any]	  =      self.src_w / self.dst_w
  __A	:		List[str]	  =      self.src_h / self.dst_h

  __A	:		Dict	  =      (
      np.ones((self.dst_h, self.dst_w, 3)   ,   np.uinta    ) * 255
  )


 def 			snake_case__ (   self    ):

  """simple docstring"""







  for i in range(self.dst_h    ):
   for j in range(self.dst_w    ):
    __A	:		List[str]	  =      self.img[self.get_y(__lowercase    )][self.get_x(__lowercase    )]


 def 			snake_case__ (   self   ,   __lowercase    ):

  """simple docstring"""







  return int(self.ratio_x * x    )







 def 			snake_case__ (   self   ,   __lowercase    ):

  """simple docstring"""







  return int(self.ratio_y * y    )


if __name__ == "__main__":
 UpperCAmelCase_				,      UpperCAmelCase_			:  str										=   8_0_0, 6_0_0
 UpperCAmelCase_			:  str										=   imread('image_data/lena.jpg', 1)
 UpperCAmelCase_			:  List[str]										=   NearestNeighbour(im, dst_w, dst_h)
 n.process()

 imshow(
     f'''Image resized from: {im.shape[1]}x{im.shape[0]} to {dst_w}x{dst_h}''', n.output
 )
 waitKey(0)
 destroyAllWindows()






