



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







def    lowerCAmelCase_  (lowerCAmelCase__:		Tuple		,	lowerCAmelCase__:		str=3     ):





			"""simple docstring"""


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


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

	# get values with two different mask size
	a			:     List[Any]     = median_filter(gray, 3)
	a			:     str     = median_filter(gray, 5)

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











import numpy as np







def    lowerCAmelCase_  (lowerCAmelCase__:		Optional[Any]     ):





			"""simple docstring"""


			UpperCAmelCase_:		Optional[int]       			=    np.exp(lowerCAmelCase__     )

			# Add up the all the exponentials
			UpperCAmelCase_:		Tuple       			=    np.sum(lowerCAmelCase__     )

			# Divide every exponent by the sum of all exponents
			UpperCAmelCase_:		str       			=    exponent_vector / sum_of_exponents

			return softmax_vector


if __name__ == "__main__":
	print(softmax((0,)))






