Added routine to convert to/from cv and cv2 image formats as library.