리매핑 Remapping
- 원래 이미지의 점들을 다른 좌표로 옮겨주는 것
src = cv.imread('basketball.webp')
height, width = src.shape[:2]
mapy, mapx = np.indices((height, width),dtype=np.float32)
mapx = width - mapx - 1
mapy = height - mapy - 1
dst = cv.remap(src, mapx, mapy, cv.INTER_LINEAR)
극좌표계로 변환
mapy, mapx = np.indices((height, width), dtype=np.float32)
center_x, center_y = width // 2, height // 2
norm_mapx = (mapx - center_x) / (width // 2)
norm_mapy = (mapy - center_y) / (height // 2)
r, theta = cv.cartToPolar(norm_mapx, norm_mapy)

볼록 오목 변환
exp = 1.5
scale = 1
r[r < scale] = r[r < scale] ** exp
norm_mapx, norm_mapy = cv.polarToCart(r, theta)
mapx = norm_mapx * (width // 2) + center_x
mapy = norm_mapy * (height // 2) + center_y
dst = cv.remap(src, mapx, mapy, cv.INTER_LINEAR)