Extract text from an image

Hi, I want to extract text from this image. I used colour thresholder app to extract text of same colour but in this case the texts are of different colours. Could somebody please help? Thanks!

回答 (1 件)

Ayush
Ayush 2024 年 3 月 14 日
編集済み: Dyuman Joshi 2024 年 3 月 15 日

0 投票

Hey Merin,
I understand you are looking to extract text from the given image.
You can use the "ocr" function in the following way to achieve this in MATLAB:
img = imread("thumbnail_5.jpg");
imshow(img)
ocrResults = ocr(img)
ocrResults =
ocrText with properties: Text: 'xfMV Press, Contr) Adit↵↵Stats↵- Pressure Support↵↵1↵| Nebulizer↵↵_ patient↵↵ ↵↵ ↵↵ ↵↵' CharacterBoundingBoxes: [86×4 double] CharacterConfidences: [86×1 single] Words: {16×1 cell} WordBoundingBoxes: [16×4 double] WordConfidences: [16×1 single] TextLines: {9×1 cell} TextLineBoundingBoxes: [9×4 double] TextLineConfidences: [9×1 single]
ocrResults.Text
ans =
'xfMV Press, Contr) Adit Stats - Pressure Support 1 | Nebulizer _ patient '
The variable "ocrResults" will contain all the text extracted from the image.
For further details on the "ocr" function,you can refer the MathWorks documentation page at: https://in.mathworks.com/help/vision/ref/ocrtext.html
Hope this helps!

3 件のコメント

Dyuman Joshi
Dyuman Joshi 2024 年 3 月 15 日
@Ayush, as you can see in my edit above to your answer, ocrText does not work as expected i.e. it does not provide all the text. Nor is the text read in a structured manner.
Ayush
Ayush 2024 年 3 月 15 日
In that case, knowing what exact text needs to be extracted from the image might be more helpful.
Merin
Merin 2024 年 3 月 15 日
@Ayush I wanted to extract all the numerical data along with reading name.
For example
Ppeak 33
Pmean 21
PEEP 9
ans so on...

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeConvert Image Type についてさらに検索

質問済み:

2024 年 2 月 21 日

コメント済み:

2024 年 3 月 15 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by