Use a Hough transform on the edge detection to get the right lines (you only want the longest, straightest ones). Then apply the affine transform back.
It gets harder if the notebook doesn't lie flat, though.
The limited selection is even worse than the price. I vastly prefer Moleskine's soft cover notebooks, and these are apparently only available in hard cover. Then again, aside from "disaster recovery", the flatbed scanner I already use to scan notebook pages probably works better than the iPad's camera even with special deskew logic anyway.
$25/notepad is way of the charts for the types of notes and sketches that I actually need a notepad for.