
"""simple docstring"""






from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like
def    UpperCamelCase						(					UpperCAmelCase ,   UpperCAmelCase=3     )						->int:

   """simple docstring"""



   a_						   =     int(mask / 2     )
   # copy image size
   a_						   =     zeros_like(UpperCAmelCase     )
   for i in range(UpperCAmelCase ,   gray_img.shape[0] - bd     ):
      for j in range(UpperCAmelCase ,   gray_img.shape[1] - bd     ):
         # get mask according with mask
         a_						   =     ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]     )
         # calculate mask median
         a_						   =     sort(UpperCAmelCase     )[inta(divide((multiply(UpperCAmelCase ,   UpperCAmelCase     )) ,   2     ) + 1     )]
         a_						   =     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)

"""simple docstring"""






from collections import namedtuple

UpperCamelCase_						   =   namedtuple('from_to', 'from_ to')

UpperCamelCase_						   =   {
    'atm': from_to(1, 1),
    'pascal': from_to(0.0_00_00_98, 101325),
    'bar': from_to(0.98_69_23, 1.0_13_25),
    'kilopascal': from_to(0.00_98_69_23, 1_01.3_25),
    'megapascal': from_to(9.8_69_23, 0.10_13_25),
    'psi': from_to(0.06_80_46, 14.69_59),
    'inHg': from_to(0.0_33_42_11, 29.92_13),
    'torr': from_to(0.00_13_15_79, 760),
}
def    UpperCamelCase						(					UpperCAmelCase ,   UpperCAmelCase ,   UpperCAmelCase     )						->float:

   """simple docstring"""



   if from_type not in PRESSURE_CONVERSION:
      raise ValueError(
          F'''Invalid \'from_type\' value: {from_type!r}  Supported values are:\n'''
          + ", ".join(UpperCAmelCase     )     )
   if to_type not in PRESSURE_CONVERSION:
      raise ValueError(
          F'''Invalid \'to_type\' value: {to_type!r}.  Supported values are:\n'''
          + ", ".join(UpperCAmelCase     )     )
   return (
       value * PRESSURE_CONVERSION[from_type].from_ * PRESSURE_CONVERSION[to_type].to
   )


if __name__ == "__main__":
      import doctest

      doctest.testmod()