

"""simple docstring"""






import numpy as np
from cva import COLOR_BGR2GRAY, cvtColor, imread
from numpy import array, uinta
from PIL import Image

from digital_image_processing import change_contrast as cc
from digital_image_processing import convert_to_negative as cn
from digital_image_processing import sepia as sp
from digital_image_processing.dithering import burkes as bs
from digital_image_processing.edge_detection import canny
from digital_image_processing.filters import convolve as conv
from digital_image_processing.filters import gaussian_filter as gg
from digital_image_processing.filters import local_binary_pattern as lbp
from digital_image_processing.filters import median_filter as med
from digital_image_processing.filters import sobel_filter as sob
from digital_image_processing.resize import resize as rs

snake_case_   :   List[Any]        =       imread(r"""digital_image_processing/image_data/lena_small.jpg""")
snake_case_   :   Tuple        =       cvtColor(img, COLOR_BGR2GRAY)



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   Tuple      =				cn.convert_to_negative(_lowercase	)
					# assert negative_img array for at least one True
					assert negative_img.any()



def   lowercase_	(    ):




					'''simple docstring'''






					with Image.open("digital_image_processing/image_data/lena_small.jpg"	) as img:
										# Work around assertion for response
										assert str(cc.change_contrast(_lowercase							,      1_10	)	).startswith(
										    "<PIL.Image.Image image mode=RGB size=100x100 at"	)



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   Optional[int]      =				canny.gen_gaussian_kernel(9							,      sigma=1.4	)
					# Assert ambiguous array
					assert resp.all()



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   List[str]      =				imread("digital_image_processing/image_data/lena_small.jpg"							,      0	)
					# assert ambiguous array for all == True
					assert canny_img.all()
					UpperCAmelCase			:   List[str]      =				canny.canny(_lowercase	)
					# assert canny array for at least one True
					assert canny_array.any()



def   lowercase_	(    ):




					'''simple docstring'''






					assert gg.gaussian_filter(_lowercase							,      5							,      sigma=0.9	).all()



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   Union[str, Any]      =				array([[0.2_5, 0.5, 0.2_5], [0.5, -3, 0.5], [0.2_5, 0.5, 0.2_5]]	)
					UpperCAmelCase			:   Dict      =				conv.img_convolve(_lowercase							,      _lowercase	).astype(_lowercase	)
					assert res.any()



def   lowercase_	(    ):




					'''simple docstring'''






					assert med.median_filter(_lowercase							,      3	).any()



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase      ,							UpperCAmelCase			:   List[str]      =				sob.sobel_filter(_lowercase	)
					assert grad.any() and theta.any()



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   Tuple      =				sp.make_sepia(_lowercase							,      20	)
					assert sepia.all()



def   lowercase_	(    _lowercase       :		str = "digital_image_processing/image_data/lena_small.jpg"	):




					'''simple docstring'''






					UpperCAmelCase			:   Union[str, Any]      =				bs.Burkes(imread(_lowercase							,      1	)							,      1_20	)
					burkes.process()
					assert burkes.output_img.any()



def   lowercase_	(    _lowercase       :		str = "digital_image_processing/image_data/lena_small.jpg"							,      ):




					'''simple docstring'''






					UpperCAmelCase			:   List[str]      =				rs.NearestNeighbour(imread(_lowercase							,      1	)							,      4_00							,      2_00	)
					nn.process()
					assert nn.output.any()




def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   str      =				"digital_image_processing/image_data/lena.jpg"

					# Reading the image and converting it to grayscale.
					UpperCAmelCase			:   str      =				imread(_lowercase							,      0	)

					# Test for get_neighbors_pixel function() return not None
					UpperCAmelCase			:   Dict      =				0
					UpperCAmelCase			:   int      =				0
					UpperCAmelCase			:   Union[str, Any]      =				image[x_coordinate][y_coordinate]

					UpperCAmelCase			:   Tuple      =				lbp.get_neighbors_pixel(
					    _lowercase							,      _lowercase							,      _lowercase							,      _lowercase	)

					assert neighbors_pixels is not None

					# Test for local_binary_pattern function()
					# Create a numpy array as the same height and width of read image
					UpperCAmelCase			:   Union[str, Any]      =				np.zeros((image.shape[0], image.shape[1])	)

					# Iterating through the image and calculating the local binary pattern value
					# for each pixel.
					for i in range(0							,      image.shape[0]	):
										for j in range(0							,      image.shape[1]	):
															UpperCAmelCase			:   Dict      =				lbp.local_binary_value(_lowercase							,      _lowercase							,      _lowercase	)

					assert lbp_image.any()





"""simple docstring"""






from functools import reduce

snake_case_   :   List[Any]        =       (
    """73167176531330624919225119674426574742355349194934"""
    """96983520312774506326239578318016984801869478851843"""
    """85861560789112949495459501737958331952853208805511"""
    """12540698747158523863050715693290963295227443043557"""
    """66896648950445244523161731856403098711121722383113"""
    """62229893423380308135336276614282806444486645238749"""
    """30358907296290491560440772390713810515859307960866"""
    """70172427121883998797908792274921901699720888093776"""
    """65727333001053367881220235421809751254540594752243"""
    """52584907711670556013604839586446706324415722155397"""
    """53697817977846174064955149290862569321978468622482"""
    """83972241375657056057490261407972968652414535100474"""
    """82166370484403199890008895243450658541227588666881"""
    """16427171479924442928230863465674813919123162824586"""
    """17866458359124566529476545682848912883142607690042"""
    """24219022671055626321111109370544217506941658960408"""
    """07198403850962455444362981230987879927244284909188"""
    """84580156166097919133875499200524063689912560717606"""
    """05886116467109405077541002256983155200055935729725"""
    """71636269561882670428252483600823257530420752963450"""
)



def   lowercase_	(    _lowercase       :		str = N	):




					'''simple docstring'''






					return max(
					    # mypy cannot properly interpret reduce
					    int(reduce(lambda _lowercase							,      _lowercase	: str(int(_lowercase	) * int(_lowercase	)	)							,      n[i : i + 13]	)	)
					    for i in range(len(_lowercase	) - 12	)	)


if __name__ == "__main__":
	print(f'''{solution() = }''')


