Dependency-free perspective (keystone) correction for photographed documents, in about 60 lines of JavaScript: solve a homography from the four corners of the page, then warp with an inverse map and ...