






from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like





def 						A_					(						lowercase_	,  lowercase_=3			)				->List[Any]:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		int(mask / 2			)
 # copy image size
 SCREAMING_SNAKE_CASE				    =		zeros_like(lowercase_			)
 for i in range(lowercase_	,  gray_img.shape[0] - bd			):
  for j in range(lowercase_	,  gray_img.shape[1] - bd			):
   # get mask according with mask
   SCREAMING_SNAKE_CASE				    =		ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]			)
   # calculate mask median
   SCREAMING_SNAKE_CASE				    =		sort(lowercase_			)[inta(divide((multiply(lowercase_	,  lowercase_			))	,  2			) + 1			)]
   SCREAMING_SNAKE_CASE				    =		median
 return median_img


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

      # get values with two different mask size
      __UpperCAmelCase      =				median_filter(gray, 3)
      __UpperCAmelCase      =				median_filter(gray, 5)

      # show result images
      imshow("median filter with 3x3 mask", medianaxa)
      imshow("median filter with 5x5 mask", medianaxa)
      waitKey(0)












def 						A_					(						lowercase_	,  lowercase_			)				->List[Any]:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		1
 while b > 0:
  if b & 1:
   res *= a

  a *= a
  b >>= 1

 return res





def 						A_					(						lowercase_	,  lowercase_	,  lowercase_			)				->Any:







 """simple docstring"""

 SCREAMING_SNAKE_CASE				    =		1
 while b > 0:
  if b & 1:
   SCREAMING_SNAKE_CASE				    =		((res % c) * (a % c)) % c

  a *= a
  b >>= 1

 return res




