Add text to an image

버전 1.0.1 (9.02 KB) 작성자: Josep Llobet
Put text into the corner of an image in order to make their presentation better.
다운로드 수: 46
업데이트 날짜: 2023/7/11

라이선스 보기

Hi there,
convert_text_to_image is a function that put text into the corner of an image in order to makes their presentation better.
The main idea is put a text plus a data in the corner of the image, with the option of tuneate their scale. Inputs:
imatge_ficar_text - the main image. This can be in different formats
text_introduir - the text to introduce. If you don't want to put text, just put "".
dades_introduir - the data to introduce. If you don't want to put numbers, just put "".
escala_opci - if you want to scale the dimensions of the letters. Eye with do not put a too-much scale.
As ouput is the image.
This function works with the neat function text2im.m, Convert text to an image, developed by Tobias Kiessling(Tboias Kiessling 2021). This function I modificate just the first part because gave me an error.
Reference
Tobias Kiessling (2021). Convert Text to an image (https://www.mathworks.com/matlabcentral/fileexchange/19896-convert-text-to-an-image), MATLAB Central File Exchange. Retrieved August 6, 2021.
As code example:
I_celeg_raw = imread('http://www.news.wisc.edu/newsphotos/images/Kimble_worm_c_elegans2_02.jpg');
I_celeg_BW = rangefilt(I_celeg); I_celeg_BW = imbinarize(I_celeg_BW); SE = strel("disk", 8); I_celeg_BW = imclose(I_celeg_BW, SE); I_celeg_BW = imfill(I_celeg_BW, "holes");
imshow(I_celeg_BW)
[sfMaskBurn_new] = add_text_to_image(I_celeg_BW, "This is the text, and could be numbers: ", 1234);
imshow(sfMaskBurn_new)
[sfMaskBurn_new] = add_text_to_image(I_celeg_BW, "This is the text, and could be numbers: ", "", 2);
imshow(sfMaskBurn_new)
Thank you for reading, I hope it will be useful.
PS: I am working in image process of C.elegans, if anyone would like to share content in private I would be glad of discuss that.

인용 양식

Josep Llobet (2026). Add text to an image (https://kr.mathworks.com/matlabcentral/fileexchange/97207-add-text-to-an-image), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2021a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
버전 게시됨 릴리스 정보
1.0.1

asdf

1.0.0