Problem 1: Currently the app checks present frame, and if page is detected, it captures the next frame which can lead to page not being detected.
Solutions: Only once the edges have stabilised(don't keep changing), click the photo. OR Capture the current frame in the app
Points to be noted: Take image from top-down view Try and preserve the structure of the page(no crumpling, folding)