





from cva import destroyAllWindows, imread, imshow, waitKey



def 		A_				(     _lowerCAmelCase     )						-> int:
 # getting number of pixels in the image
 UpperCamelCase	,    UpperCamelCase	:					List[str]       	=   img.shape[0], img.shape[1]

 # converting each pixel's color to its negative
 for i in range(_lowerCAmelCase     ):
  for j in range(_lowerCAmelCase     ):
   UpperCamelCase	:					Tuple       	=   [255, 255, 255] - img[i][j]

 return img


if __name__ == "__main__":
    # read original image
    __lowerCamelCase       :     Any   =     imread("""image_data/lena.jpg""", 1)

    # convert to its negative
    __lowerCamelCase       :     Optional[int]   =     convert_to_negative(img)

    # show result image
    imshow("""negative of original image""", img)
    waitKey(0)
    destroyAllWindows()







def 		A_				(     _lowerCAmelCase     )						-> str:
 UpperCamelCase	:					Optional[int]       	=   int(_lowerCAmelCase     )
 if decimal in (0, 1):  # Exit cases for the recursion
  return str(_lowerCAmelCase     )
 UpperCamelCase	,    UpperCamelCase	:					Dict       	=   divmod(_lowerCAmelCase							,   2     )
 return binary_recursive(_lowerCAmelCase     ) + str(_lowerCAmelCase     )



def 		A_				(     _lowerCAmelCase     )						-> str:
 UpperCamelCase	:					Tuple       	=   str(_lowerCAmelCase     ).strip()
 if not number:
  raise ValueError("No input value was provided"     )
 UpperCamelCase	:					Optional[int]       	=   "-" if number.startswith("-"     ) else ""
 UpperCamelCase	:					Any       	=   number.lstrip("-"     )
 if not number.isnumeric():
  raise ValueError("Input value is not an integer"     )
 return F"""{negative}0b{binary_recursive(int(_lowerCAmelCase     )     )}"""


if __name__ == "__main__":
    from doctest import testmod

    testmod()
