VeryPDF Deskew SDK can be downloaded from following web page,
https://www.verypdf.com/app/papertools/try-and-buy.html
https://www.verypdf.com/dl2.php/papertoolssdk.zip
VeryPDF Deskew SDK (API) allows the automatic skew detection and correction in scanned or faxed images. The skew is the inevitable slope present in the images acquired by scanners using an ADF (automatic document feeder) or received by fax. Straightening the images is a very important pre-processing step for improving the compression rate, the visualization aspect, the line-removal and the accuracy using ICR/OCR.
While other libraries usually allow users to deskew only monochrome images, VeryPDF Deskew SDK allows you to deskew both gray-scale and color images!
Using interpolation in skew correction, the aliasing due to the rotation is minimized and really perfect images are obtained (as rotating the paper!).
You can use following C# source code to deskew image files,
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
System.Type VeryPDFType = System.Type.GetTypeFromProgID("VeryPDF.PaperToolsCom");
VeryPDF.PaperToolsCom VeryPDFCom = (VeryPDF.PaperToolsCom)System.Activator.CreateInstance(VeryPDFType);
string appFolder = Path.GetDirectoryName(Application.ExecutablePath);
string strFolder = Directory.GetParent(appFolder).FullName;
string strReturn = "";
int nFileIndex = 0;
VeryPDFCom.EnableDebugLog(true);
string strInFile = strFolder + "\\sample\\test_table_ocr.tif";
string strOutFile = strFolder + "\\sample\\output\\_output_" + nFileIndex.ToString() + ".png";
string strCmd = "-$ XXXXXXXXXXXXXXXXXX -deskew \"" + strInFile + "\" \"" + strOutFile + "\"";
strReturn = strReturn + VeryPDFCom.PaperTools(strCmd);
string strInFile = strFolder + "\\sample\\test_table_ocr.tif";
string strOutFile = strFolder + "\\sample\\output\\_output_" + nFileIndex.ToString() + ".png";
string strCmd = "-$ XXXXXXXXXXXXXXXXXX -deskew2 \"" + strInFile + "\" \"" + strOutFile + "\"";
strReturn = strReturn + VeryPDFCom.PaperTools(strCmd);
If you encounter any problem with VeryPDF Deskew SDK, please feel free to let us know.