Write a python script/function, that undistorts lines extracted from the image, and the image itself, using known radial distortion parameters. Images and lines are here. The camera uses equi-angular radial distortionmodel. The parameters are:
im_center = [ 676, 503 ]
f = 456
import numpy as np
import matplotlib.pyplot as plt
import scipy.io as sio
im1 = plt.imread( 'data/rd/01.png')
im2 = plt.imread( 'data/rd/02.png')
plt.imshow( im1, cmap='gray' )
lines = sio.loadmat( 'data/rd/lines.mat')
lines = lines['lines'][0]
for l in lines:
plt.plot( l[0], l[1] )
%run task_rd