VeryPDF Black Border Removal 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 Black Border Removal SDK (API) allows the automatic black border detection and removal in monochrome or gray-scale images. The black border is produced in the images acquired by scanners when paper size is smaller than scanning area or in images acquired from microfilm, microfiches and aperture-cards. Removing the border from the images is a very important pre-processing step that improves the compression rate, reducing file size, and the visualization aspect.
VeryPDF Black Border Removal SDK allows user to remove black borders from monochrome images, gray-scale images and in color images!
The following is a C# example source code to remove black borders from scanned 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 -removeshortline 3 -removelongline 0 \"" + 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 -removeborder \"" + strInFile + "\" \"" + strOutFile + "\"";
strReturn = strReturn + VeryPDFCom.PaperTools(strCmd);
If you encounter any problem with VeryPDF Black Border Removal SDK, please feel free to let us know.
------------------------------------------------------
Questions:
I scanned some books and randomly there are pages with a black border because of skewing in different sides of the page (probably because the page was not cut straight).
What i would like to do is either:
1.Automatically Color the black borders in white
2.Automatically Cut the black borders
I've attached an example showing the problem that I have.
Customer
------------------------------------------------------
You can use VeryPDF Black Border Removal SDK to remove black borders from your scanned image file, please look at following modified image, the black borders were removed from this image file,
VeryPDF