필터 지우기
필터 지우기

How to replace text in an image using the same font size?

조회 수: 2 (최근 30일)
Ala Abu Alkheir
Ala Abu Alkheir 2018년 6월 11일
답변: Prajit T R 2018년 6월 14일
I am building a function to read text from images (using OCR), auto-correct it, and then place the auto-corrected text in the same location of the original text. I want the placed text to occupy the same box as the original text. InserText allows me to specify the FontSize and the AnchorPoint, but not the surrounding box. So, my question is this: Is there a way to place a text in an image by specifying a bounding box (e.g., using the format [x y width height])?

답변 (1개)

Prajit T R
Prajit T R 2018년 6월 14일
Hi Ala Abu
This MATLAB Answers link discusses this:
I think 'insertText' does allow you to control the properties of the surrounding box as well. In the documentation page of 'insertText': https://www.mathworks.com/help/vision/ref/inserttext.html there is an example which demonstrates this:
RGB = insertText(I,position,text_str,'FontSize',18,'BoxColor',...
box_color,'BoxOpacity',0.4,'TextColor','white');
Hope this helps
Prajit

카테고리

Help CenterFile Exchange에서 Text Analytics Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by