




import numpy as np
from PIL import Image







def       _a (		SCREAMING_SNAKE_CASE_				:							Optional[int]	):
					__lowerCAmelCase							  =			rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2]
					return 0.29_89 * r + 0.58_70 * g + 0.11_40 * b







def       _a (		SCREAMING_SNAKE_CASE_				:							Any	):
					return (gray > 1_27) & (gray <= 2_55)







def       _a (		SCREAMING_SNAKE_CASE_				:							Tuple , SCREAMING_SNAKE_CASE_				:							Optional[int]	):
					__lowerCAmelCase							  =			np.zeros_like(SCREAMING_SNAKE_CASE_	)
					__lowerCAmelCase							  =			np.zeros(
					    (image.shape[0] + kernel.shape[0] - 1, image.shape[1] + kernel.shape[1] - 1)	)

					# Copy image to padded image
					__lowerCAmelCase							  =			image

					# Iterate over image & apply kernel
					for x in range(image.shape[1]	):
										for y in range(image.shape[0]	):
															__lowerCAmelCase							  =			(
															    kernel * image_padded[y : y + kernel.shape[0], x : x + kernel.shape[1]]
															).sum()
															__lowerCAmelCase							  =			int(summation == 5	)
					return output


# kernel to be applied
UpperCamelCase__            =     np.array([[0, 1, 0], [1, 1, 1], [0, 1, 0]])

if __name__ == "__main__":
					# read original image
					UpperCamelCase__            =     np.array(Image.open(R"""..\image_data\lena.jpg"""))
					# Apply erosion operation to a binary image
					UpperCamelCase__            =     erosion(grayabinary(rgbagray(image)), structuring_element)
					# Save the output image
					UpperCamelCase__            =     Image.fromarray(output).convert("""RGB""")
					pil_img.save("""result_erosion.png""")










def    snake_case   (				A		,  A     )				->				int:




	'''simple docstring'''


	if a < b:
		return gcd(A		,  A     )
	if a % b == 0:
		return b
	return gcd(A		,  a % b     )






def    snake_case   (				A		,  A		,  A     )				->				int:




	'''simple docstring'''


	if y == 0:
		return 1
	lowerCamelCase_				:						int				  =				power(A		,  y // 2		,  A     ) % mod
	lowerCamelCase_				:						List[Any]				  =				(temp * temp) % mod
	if y % 2 == 1:
		lowerCamelCase_				:						str				  =				(temp * x) % mod
	return temp






def    snake_case   (				A     )				->				bool:




	'''simple docstring'''


	lowerCamelCase_				:						Union[str, Any]				  =				2
	while b < n:
		if gcd(A		,  A     ) == 1 and power(A		,  n - 1		,  A     ) != 1:
			return False
		b += 1
	return True


if __name__ == "__main__":
							UpperCamelCase__						=		int(input('Enter number: ').strip())
							if is_carmichael_number(number):
														print(F'{number} is a Carmichael Number.')
							else:
														print(F'{number} is not a Carmichael Number.')
