How to create light tunnel transformation image

This takes cv.remap and some geometry.

You have trouble because you tried to draw lines. You wouldn't even need remap for that.

im = cv.imread("d1LU6.png")
(h,w) = im.shape[:2]

# some definitions
center = np.array([w/2, h/2])
radius = h / 5

i,j = np.mgrid[0:h, 0:w]
xymap = np.dstack([j,i]).astype(np.float32) # "identity" map

# coordinates relative to center
coords = (xymap - center)
# distance to center
dist = np.linalg.norm(coords, axis=2)
# touch only what's outside of the circle
mask = (dist >= radius)
# project onto circle (calculate unit vectors, move onto circle, then back to top-left origin)
xymap[mask] = coords[mask] / dist[mask,None] * radius + center

out = cv.remap(im, map1=xymap, map2=None, interpolation=cv.INTER_LINEAR)
# imshow(out)

out