Text Detection using Deep Learning
This repository implements a pretrained Character Region Awareness For Text detection (CRAFT) [1] model in MATLAB(r).
Creator: MathWorks Development
Requirements
- MATLAB R2022a or later
- Deep Learning Toolbox(tm)
- Computer Vision Toolbox(tm)
- Computer Vision Toolbox(tm) Model for Text Detection
Note: Previous MATLAB release users can use this branch to download the pretrained models.
Overview
This repository implements text detection in images using CRAFT deep learning model with VGG-16 as backbone. The network is trained on various scene text detection datasets with text in English, Korean, Italian, French, Arabic, German and Bangla (Indian).
CRAFT uses a convolutional neural network to produce two outputs, region score, and affinity score. The region score localizes individual characters in the image, and the affinity score groups each character into a single instance. The character-level region awareness mechanism helps in detecting texts of various shapes such as long, curved, and arbitrarily shaped texts.
Getting Started
detectTextCRAFT - Detect texts in images by using CRAFT deep learning model
Detect Text Using Pretrained CRAFT
Note: This functionality requires Deep Learning Toolbox(tm) and the Computer Vision Toolbox(tm) Model for Text Detection. You can install the Computer Vision Toolbox Model for Text Detection from Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.
% Read test image.
orgImg = imread('businessCard.png');
% Perform text detection
bboxes = detectTextCRAFT(orgImg);
% Visualize results
outImg = insertShape(orgImg,"rectangle",bboxes,LineWidth=3);
figure; imshow(outImg);