






from cva import destroyAllWindows, imread, imshow, waitKey






def     _snake_case    (__lowercase):
   # getting number of pixels in the image
   UpperCamelCase_		,      UpperCamelCase_									=     img.shape[0], img.shape[1]

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

   return img


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

 # convert to its negative
 snake_case__      :	Dict       	=      convert_to_negative(img)

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













def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase):
   return not any(
       neighbour == 1 and colored_vertices[i] == color
       for i, neighbour in enumerate(__lowercase))






def     _snake_case    (__lowercase    ,      __lowercase    ,      __lowercase    ,      __lowercase):

   # Base Case
   if index == len(__lowercase):
      return True

   # Recursive Step
   for i in range(__lowercase):
      if valid_coloring(graph[index]    ,      __lowercase    ,      __lowercase):
         # Color current vertex
         UpperCamelCase_									=     i
         # Validate coloring
         if util_color(__lowercase    ,      __lowercase    ,      __lowercase    ,      index + 1):
            return True
         # Backtrack
         UpperCamelCase_									=     -1
   return False






def     _snake_case    (__lowercase    ,      __lowercase):
   UpperCamelCase_									=     [-1] * len(__lowercase)

   if util_color(__lowercase    ,      __lowercase    ,      __lowercase    ,      0):
      return colored_vertices

   return []





