Suppose I have a 240x180 camera with the following distortion co-efficients,
$$k_1 = -0.138592767408$$ $$k_2=0.0933736664192$$ $$k_3=0.0$$ $$p_1=k_4=-0.000335586987532$$ $$p_2=k_5=0.000173720158228$$
The camera center is given to be
$$u_0 = 129.924663379$$ $$v_0 = 99.1864303447$$
And the distortion formulae are
$$r^2=(u-u_0)^2+(v-v_0)^2$$
$$ \begin{align} \begin{bmatrix} u_d\\ v_d \end{bmatrix} = & (1+k_1r^2+k_2r^4+k_3r^6) \begin{bmatrix} u-u_0\\ v-v_0 \end{bmatrix} + \\ & \begin{bmatrix} 2k_4(u-u_0)(v-v_0)+k_5(r^2+2(u-u_0)^2)\\ k_4(r^2+2(v-v_0)^2+2k_5(u-u_0)(v-v_0) \end{bmatrix} + \begin{bmatrix} u_0\\ v_0 \end{bmatrix} \end{align} $$
In the above formulae, $p_1=k_4$ and $p_2=k_5$, $u$ and $v$ are the undistorted co-ordinates and $u_d$, $v_d$ the corresponding distorted ones.
My understanding of the undistorted co-ordinates is that it is a mapping of every undistorted co-ordinate to a distorted one. Therefore, the ranges of both undistorted and distorted co-ordinates should be between (0-240, 0-180). However, going by the above formula, I get extremely high numbers for distorted co-ordinates if I input undistorted co-ordinates in the range(0-240, 0-180) which goes against this understanding. Have I done something wrong here?