






'''simple docstring'''





from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like
def __UpperCAmelCase (			A			:	Optional[Any]	,   A			:	Union[str, Any]=3						)  -> Optional[Any]:
			UpperCAmelCase_     :   Union[str, Any]       =   int(mask / 2						)
			# copy image size
			UpperCAmelCase_     :   str       =   zeros_like(A						)
			for i in range(A	,   gray_img.shape[0] - bd						):
						for j in range(A	,   gray_img.shape[1] - bd						):
									# get mask according with mask
									UpperCAmelCase_     :   Optional[int]       =   ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]						)
									# calculate mask median
									UpperCAmelCase_     :   Any       =   sort(A						)[inta(divide((multiply(A	,   A						))	,   2						) + 1						)]
									UpperCAmelCase_     :   List[str]       =   median
			return median_img


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

						# get values with two different mask size
						_UpperCamelCase		:		Any								=			median_filter(gray, 3)
						_UpperCamelCase		:		Union[str, Any]								=			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'''





def __UpperCAmelCase (			)  -> Optional[Any]:
			UpperCAmelCase_     :   Union[str, Any]       =   1

			while True:
						if (
						    sorted(str(A						)						)
						    == sorted(str(2 * i						)						)
						    == sorted(str(3 * i						)						)
						    == sorted(str(4 * i						)						)
						    == sorted(str(5 * i						)						)
						    == sorted(str(6 * i						)						)
						):
									return i

						i += 1


if __name__ == "__main__":
						print(solution())


