Fisheye warping

Stéfan van der Walt stefan at sun.ac.za
Thu May 3 18:11:55 EDT 2012


Hi all,

After yesterday's post on warping, another teaser:

http://mentat.za.net/refer/lena_warp.png

From:

def fisheye(xy):
    center = np.mean(xy, axis=0)
    c = xy - center
    r = np.sqrt(np.sum(c**2, axis=1))
    theta = np.arctan2(c[:, 1], c[:, 0])

    r = 0.87 * np.exp(r**(1/2.5) / 1.75)

    return np.column_stack((
        r * np.cos(theta), r * np.sin(theta)
        )) + center


Stéfan



More information about the scikit-image mailing list