The following image is the result of rectifying curled / folded document from images taken by iPhone 4S camera. I used this app (DocScan) for the the experiment and shared the results with you: Detect the boundary Rectify it Its amazing! You can try it with different samples by yourself. The app is free to download.