Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matlab-deep-learning/Seven-Segment-Digit-Recognition
Seven Segment Digit Recognition in MATLAB
https://github.com/matlab-deep-learning/Seven-Segment-Digit-Recognition
computer-vision deep-learning industrial-automation matlab matlab-deep-learning ocr ocr-recognition pretrained-models seven-segment seven-segments-display text-detection text-detection-recognition
Last synced: 3 months ago
JSON representation
Seven Segment Digit Recognition in MATLAB
- Host: GitHub
- URL: https://github.com/matlab-deep-learning/Seven-Segment-Digit-Recognition
- Owner: matlab-deep-learning
- License: other
- Created: 2021-11-16T06:51:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-24T10:33:51.000Z (10 months ago)
- Last Synced: 2024-07-27T14:32:18.636Z (4 months ago)
- Topics: computer-vision, deep-learning, industrial-automation, matlab, matlab-deep-learning, ocr, ocr-recognition, pretrained-models, seven-segment, seven-segments-display, text-detection, text-detection-recognition
- Homepage: https://www.mathworks.com/products/deep-learning.html
- Size: 66.4 KB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- MATLAB-Deep-Learning-Model-Hub - Seven Segment Digit Recognition - deep-learning/Seven-Segment-Digit-Recognition) |![](Images/7segment.png)| (Text Detection and Recognition <a name="textdetection"/> / Robotics)
README
# Seven Segment Digit Recognition
This repository implements seven segment digit recognition in MATLAB®.
[![Open in MATLAB Online](https://www.mathworks.com/images/responsive/global/open-in-matlab-online.svg)](https://matlab.mathworks.com/open/github/v1?repo=matlab-deep-learning/Seven-Segment-Digit-Recognition)
**Creator**: MathWorks Development
Requirements
------------- MATLAB R2022b or later
- Deep Learning Toolbox™
- Computer Vision Toolbox™
- Computer Vision Toolbox™ Model for Text DetectionNote: Previous MATLAB release users can use [this](https://github.com/matlab-deep-learning/Seven-Segment-Digit-Recognition/tree/previous) branch to download the pretrained models.
Overview
--------This repository implements seven segment digit recognition using two steps. The first step detects the location of image text using [detectTextCRAFT](https://in.mathworks.com/help/vision/ref/detecttextcraft.html) function that requires Deep Learning Toolbox™ and Computer Vision Toolbox™ Model for Text Detection. The second stage uses the [OCR](https://in.mathworks.com/help/vision/ref/ocr.html) function from the Computer Vision Toolbox™ to recognize the digits.
The two-step approach helps improve OCR by only processing image regions that contains text. This is useful in industrial automation applications where the digital displays are often surrounded by other objects and background content that can hinder the performance of OCR.
Recognize Seven Segment Digits
---------------------------------------```
% Read image.
orgImg = imread('sevenSeg.png');
% Detect seven segment digits.
bboxes = detectTextCRAFT(orgImg);% Binarizing the image before using OCR for better results.
I = rgb2gray(orgImg);
BW = imbinarize(I, 'adaptive');
BW = ~BW;
% Recognize seven segment digit using ocr.
output = ocr(BW,bboxes,Model="seven-segment");
% Display results.
recognizedWords = cat(1,output(:).Words);
Iocr = insertObjectAnnotation(orgImg, 'rectangle',bboxes,recognizedWords);
figure; imshow(Iocr);
```**Note:** To improve OCR results, see [Troubleshoot ocr Function Results](https://in.mathworks.com/help/vision/ug/troubleshoot-ocr-function-results.html).
References
---------------------------------------
[1] Baek, Y., Lee, B., Han, D., Yun, S. and Lee, H., 2019. Character region awareness for text detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (pp. 9365-9374).Copyright 2021-2024 The MathWorks, Inc.