deskewDocumentImage install opencv. alter the code char *filePath = "/www/ocr/cap2/"; you can use the 2.png 3.png 4.png test.