扫描图像后自动裁剪 [英] Auto Crop after scanning an image
问题描述
我正在开发一个基于Web的Java应用程序.我的要求是将扫描仪产生的图像裁剪为实际扫描文档的尺寸.我正在使用Asprise JTwain作为sdk,以使扫描仪与程序对接.
I am developing a web based java application. My requirement is to crop the image produced by a scanner into the size of the actual scanned document. I am using Asprise JTwain as the sdk to interface the scanner with the program.
推荐答案
您可以先通过检查扫描仪的用户界面或使用TWAIN示例应用程序来检查TWAIN驱动程序是否支持自动边框检测.
You may first check if your TWAIN driver supports automatic border detection by checking the user interface of your scanner or using TWAIN sample application.
如果是这样,则可以协商ICAP_AUTOMATICBORDERDETECTION TWAIN功能,或使用JTwain的相应方法/属性来打开该功能.
If so, you can negotiate the ICAP_AUTOMATICBORDERDETECTION TWAIN capapbility or use the corresponding method/property of JTwain to turn on the feature.
TWAIN示例应用程序和TWAIN规范可以在这里获取: http://www.twain.org/scannerdriverdevelopers/specification-and-tools.html
TWAIN sample app and TWAIN specification can be got here: http://www.twain.org/scannerdriverdevelopers/specification-and-tools.html
如果驱动程序不支持该功能,则可以使用OCR实现自动裁剪.
If your driver doesn't support the feature, you can use OCR to achieve auto crop.
这篇关于扫描图像后自动裁剪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!