如何使用摄像头进行自动裁剪文档识别图像?如何使用、摄像头、图像、文档

2023-09-05 06:55:16 作者:春风达不到冰河的彼岸

我希望为裁剪文件如凸轮扫描仪的应用程序。

i want to make a an application like a cam scanner for cropping a document.

但我需要一个像我的两个图像相同的功能。

But i need same functionality like my two images..

首先捕获的图像通过摄像头。

First Images shown image captured by camera..

二图像识别这样的拍摄图像的部分。

Second image recognize a captured image part like this..

我研究越来越多,但没有得到任何出来放话,我问这里如果,任何一个做过告诉我..

i research more and more but not getting any out put so, i ask here if,any one done this tell me..

感谢

推荐答案

我认为你的问题是检测扫描的对象。

I assume your problem is to detect the object to scan.

目标检测机制,例如模式匹配或特征检测不会给你带来你要找的,你不知道究竟是要扫描的对象的结果。

Object detection mechanisms like pattern matching or feature detection won't bring you the results you are looking for as you don't know what exactly is the object you are scanning.

基本上您搜索的图片矩形对象。

Basically you search for a rectangular object in the picture.

一个基本的方法,这可能是因为以下几点:

A basic approach to this could be as following:

运行canny边缘检测图像。它可以帮助在此之前,以图像模糊一点。物体的边缘应清晰可见。

Run a canny edge detector on the image. It could help to blur the image a bit before doing this. The edges of the object should be clearly visible.

现在你要做一个Hough变换找到的图片行。

Now you want to do a Hough transform to find lines in the picture.

搜索周围90度的角度相互线。问题是要找到合适的人。也许这是足够使用最接近于合理地平行于它们的图像的帧的所有行。

Search for lines with an angle around 90deg to each other. The problem would be to find the right ones. Maybe it is enough to use the lines closest to the frame of the picture that are reasonably parallel to them.

找到交叉点来定义对象的边缘。

Find the intersecting points to define the edges of your object.

至少,这应该给你一个提示,其中进一步研究。

At least this should give you a hint where to research further.

由于在这样的应用程序进一步的步骤,你将不得不计算点的投影,并做了仿射变换的对象。

As further steps in such an app you will have to calculate the projection of the points and do a affine transform of the object.

我希望这有助于。

在写这一切,我发现这一职务。该应帮你很多东西。

After writing all this i found this post. It should help you lot.

由于我的回答OpenCV的目标,你必须使用OpenCV库。 为了做到这一点,你需要安装 Android原生开发套件(NDK)。 有关于如何使用OpenCV的在Android上的 OpenCV的Andr​​oid版页一些很好的教程。

As my answer targets OpenCV you have to use the OpenCV library. In Order to do this, you need to install the Android Native Development Kit (NDK). There are some good tutorials on how to use OpenCV on Android on the OpenCV for Android page.

有一点要记住的是,Java包装几乎每个函数调用本地方法。这花费大量的时间。所以,你想你的结果返回给Java部分之前做尽可能多的在您的本地code。

One thing to keep in mind is that almost each function of the Java wrapper calls a native method. That costs lots of time. So you want to do as much as possible in your native code before returning your results to the Java part.

 
精彩推荐
图片推荐