移动 - 从相机扫描文本,无需拍照

时间:2016-02-11 01:56:38

标签: android ios qr-code augmented-reality scanning

是否有已知的API或方法扫描来自卡片的文本而不实际手动保存(和上传)图片? (iOS和Android)

然后我需要知道该API是否可以确定相机内应该扫描的选框。

我想要一种类似于QR扫描仪或增强现实应用程序的行为。用户只需指示相机并执行操作。

我在文本中打印了带有兑换码的卡片,包括QR在内需要更改当前的卡片生产。

文字位于白框内,可以更方便地识别:  redeem code

2 个答案:

答案 0 :(得分:1)

您可以尝试:https://github.com/gali8/Tesseract-OCR-iOS

用法:

    // Specify the image Tesseract should recognize on
tesseract.image = [[UIImage imageNamed:@"image_sample.jpg"] g8_blackAndWhite];

// Optional: Limit the area of the image Tesseract should recognize on to a rectangle
tesseract.rect = CGRectMake(20, 20, 100, 100);

// Optional: Limit recognition time with a few seconds
tesseract.maximumRecognitionTime = 2.0;

// Start the recognition
[tesseract recognize];

答案 1 :(得分:1)

在iOS上,您可以将CIDetector与AVCaptureSession一起使用。它可用于处理捕获会话输出缓冲区,因为它们从摄像机进入,无需拍照并提供文本扫描。

对于文本检测,使用带有CIDetectorTypeText的CIDetector将返回可能包含文本的区域,但您必须对光学字符识别执行其他处理。

您也可以将OpenCV用于非开箱即用的解决方案。