




"""simple docstring"""





from math import cos, sin

def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						snake_case__							:       Any				      =       float(lowerCamelCase		)
						return [[scaling_factor * int(x == y		) for x in range(2		)] for y in range(2		)]

def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						snake_case__      ,						snake_case__							:       str				      =       cos(lowerCamelCase		), sin(lowerCamelCase		)
						return [[c, -s], [s, c]]

def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						snake_case__      ,						snake_case__							:       List[Any]				      =       cos(lowerCamelCase		), sin(lowerCamelCase		)
						snake_case__							:       Optional[Any]				      =       c * s
						return [[c * c, cs], [cs, s * s]]

def 		lowerCAmelCase				(			lowerCamelCase		):
						'''simple docstring'''


						snake_case__      ,						snake_case__							:       Any				      =       cos(lowerCamelCase		), sin(lowerCamelCase		)
						snake_case__							:       List[Any]				      =       c * s
						return [[2 * c - 1, 2 * cs], [2 * cs, 2 * s - 1]]


print(f"""    {scaling(5) = }""")
print(f"""  {rotation(45) = }""")
print(f"""{projection(45) = }""")

print(f"""{reflection(45) = }""")








"""simple docstring"""





import math
import os

import cva
import numpy as np

_lowercase						   =     2_55.0

def 		lowerCAmelCase				(			lowerCamelCase   ,      lowerCamelCase		):
						'''simple docstring'''


						snake_case__							:       Tuple				      =       np.mean((original - contrast) ** 2		)
						if mse == 0:
												return 100

						return 20 * math.logaa(PIXEL_MAX / math.sqrt(lowerCamelCase		)		)

def 		lowerCAmelCase				(			):
						'''simple docstring'''


						snake_case__							:       Any				      =       os.path.dirname(os.path.realpath(lowerCamelCase		)		)
						# Loading images (original image and compressed image)
						snake_case__							:       Any				      =       cva.imread(os.path.join(lowerCamelCase   ,      '''image_data/original_image.png'''		)		)
						snake_case__							:       Any				      =       cva.imread(os.path.join(lowerCamelCase   ,      '''image_data/compressed_image.png'''		)   ,      1		)

						snake_case__							:       Optional[Any]				      =       cva.imread(os.path.join(lowerCamelCase   ,      '''image_data/PSNR-example-base.png'''		)		)
						snake_case__							:       Tuple				      =       cva.imread(
						    os.path.join(lowerCamelCase   ,      '''image_data/PSNR-example-comp-10.jpg'''		)   ,      1		)

						# Value expected: 29.73dB
						print('''-- First Test --'''		)
						print(f'''PSNR value is {peak_signal_to_noise_ratio(lowerCamelCase   ,      lowerCamelCase		)} dB'''		)

						# # Value expected: 31.53dB (Wikipedia Example)
						print('''\n-- Second Test --'''		)
						print(f'''PSNR value is {peak_signal_to_noise_ratio(lowerCamelCase   ,      lowerCamelCase		)} dB'''		)


if __name__ == "__main__":
							main()


