




import math
import os

import cva
import numpy as np

a_ 		=  255.0




def        __SCREAMING_SNAKE_CASE (	lowercase_       ,  lowercase_   )							->						float:

    """simple docstring"""


    __UpperCamelCase			=    np.mean((original - contrast) ** 2   )
    if mse == 0:
        return 1_00

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




def        __SCREAMING_SNAKE_CASE (	)							->						None:

    """simple docstring"""


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

    __UpperCamelCase			=    cva.imread(os.path.join(lowercase_       ,  '''image_data/PSNR-example-base.png'''   )   )
    __UpperCamelCase			=    cva.imread(
        os.path.join(lowercase_       ,  '''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(lowercase_       ,  lowercase_   )} dB"   )

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


if __name__ == "__main__":
 main()








from __future__ import annotations


def  A			(   lowercase       ,			lowercase					)  ->    int:
		'''simple docstring'''

		UpperCamelCase      ,    UpperCamelCase            =	0, len(lowercase					) - 1
		while start_ind <= end_ind:
				if array[start_ind] == search_item:
						return start_ind
				elif array[end_ind] == search_item:
						return end_ind
				else:
						start_ind += 1
						end_ind -= 1
    # returns -1 if search_item is not found in array
		return -1


if __name__ == "__main__":
					print(double_linear_search(list(range(100)), 40))
