Lens distortion right? BoofCV does undistort on contours for speed throughout its codebase. Here's an abstract way to compute the transform. In this case it's converting it from pixels to pixels. You could use normalized image coordinates too.
LensDistortionNarrowFOV narrow = LensDistortionFactory.narrow(intrinsics);
Point2Transform2_F32 undistortPixelToPixel = narrow.undistort_F32(/* input pixel */ true, /* output pixels */ true);
undistortPixelToPixel.compute(distorted.x, distorty.y, undistorted);
"Now, now my good man, this is no time for making enemies." — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.