如何从扫描中提取图像。如何在图像中查找图像?
我制作了一个扫描仪程序,可以使用 WIA 从扫描仪 ADF 中扫描图片。它工作正常,但我也希望能够从平板扫描多个图像。
我如何判断图像在平板上的位置?我需要知道在哪里裁剪扫描图像,但不知道图像位于扫描图像中的位置,我无法裁剪它。
我已经搜索过谷歌,但我找到的所有内容都是为了比较图像,或者查看该图像是否存在于另一张图像等中。这当然不是我想要的。我只是希望能够找到平板中任何和所有图像的位置,以便我可以循环浏览并单独保存每个图像。
该程序是用c#编写的。
I made a scanner program that scans pictures from my scanner ADF using WIA. It works fine but I want to be able to do multiple images scanned from the flatbed as well.
How do I tell where an image is on the flatbed though? I need to know where to crop the scanned image, but without knowing where the images are located in the scanned image, I can't crop it.
I have searched google but everything I'm finding is for comparing an image, or seeing if the image exists in another image and such. That's of course not what I'm looking for. I just want to be able to find the location of any and all image/s in the flatbed so I can loop through and save each one individually.
The program is written in c#.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
算法:
可以使用边缘检测器构建一个过滤器,该过滤器将从一组不重叠的矩形中选择单个图像。
我将采取以下方法:使用边缘检测器获取边缘列表。将它们过滤成相交并形成循环的边集,并且该循环中的边数为 4。清除另一个循环内发生的任何循环。您可能还想删除质量较低的边缘(您正在寻找矩形的直线,因此您想要的边缘应该很容易发现)。
然后你有一个图像边框循环列表,因此你可以进行一些基本处理(双线性仿射 blit)来转换任何未对齐并将其输出到文件。
可能的库:
我会查看 opencv.net,http://code.google.com/p/opencvdotnet/< /a> .
Algorithm:
It is possible to construct a filter using edge detectors that will select individual images from a set of non-overlapping rectangles.
I would take the following approach: Obtain a list of edges with an edge detector. Filter those into sets of edges that intersect and form a loop and the count of edges in that loop is 4. Purge any loops that occur inside another loop. You may also want to remove edges that have a low quality (you're looking for the straight lines of rectangles, so the edges you want should be easy to spot).
Then you have a list of loops of borders of images, so you can do some basic processing (bilinear affine blit) to convert out any misalignment and output them to file.
Possible Library:
I'd look at opencv.net, http://code.google.com/p/opencvdotnet/ .