Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import numpy as np
- img = cv2.imread('captcha1.jpg')
- phase = -0.8 * np.pi
- omega = 2.0 * np.pi / img.shape[1]
- amp = 15.0
- x = np.arange(img.shape[1], dtype=np.float32)
- y = np.arange(img.shape[0], dtype=np.float32)
- xx, yy = np.meshgrid(x, y)
- u = 0.0
- v = np.sin(phase + xx * omega) * amp
- corr = cv2.remap(img, xx + u, yy + v, cv2.INTER_LINEAR)
- cv2.imshow('in', img)
- cv2.imshow('out', corr)
- cv2.waitKey()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement