主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

文本检测和识别

使用图像特征检测和描述、深度学习和 OCR 来检测与识别文本

检测和识别图像中的文本是在计算机视觉应用中执行的一项常见任务。例如,您可以从行驶的车辆中捕获道路场景的视频,识别所捕获场景中的路标,并提醒驾驶员注意这些符号。

您可以将检测和识别合并为一个两步过程,其中,第一步是找到包含文本的区域,而第二步是识别区域中的文本。

Input image showing an accessible parking sign, connected to a detector, which outputs an image with predicted bounding boxes overlaid on the sign text, connected to a recognizer that outputs a list of the words recognized on the sign.

文本检测算法使用局部图像特征、机器学习或深度学习来定位或分割图像中的文本。Computer Vision Toolbox™ 中的示例说明如何使用斑点分析、最大稳定极值区域 (MSER) 特征检测器和文本检测字符区域感知 (CRAFT) 深度学习模型进行文本检测。

您一旦检测到文本,文本识别模型就会基于机器学习或深度学习处理文本区域以返回预测的文本。ocr 函数使用预训练的语言模型来识别多种语言的文本。您还可以使用 trainOCR 函数来训练自定义语言模型。有关详细信息,请参阅Getting Started with OCR

App

图像标注器为计算机视觉应用标注图像

函数

全部展开

ocrRecognize text using optical character recognition
ocrTextStore OCR results
visionSupportPackagesStart Installer to download, install, or uninstall Computer Vision Toolbox data
trainOCRTrain OCR model to recognize text in image (自 R2023a 起)
evaluateOCREvaluate OCR results against ground truth (自 R2023a 起)
ocrMetricsStore OCR quality metrics (自 R2023a 起)
ocrTrainingOptionsOptions for training OCR model (自 R2023a 起)
ocrTrainingDataCreate training data for OCR from ground truth (自 R2023a 起)
quantizeOCRQuantize OCR model (自 R2023a 起)
detectTextCRAFTDetect texts in images by using CRAFT deep learning model (自 R2022a 起)
detectMSERFeaturesDetect MSER features
vision.BlobAnalysisProperties of connected regions
extractHOGFeaturesExtract histogram of oriented gradients (HOG) features

主题

快速入门

精选示例