大卫·迪·格洛里亚
弗兰兹·格洛德的巨大贡献
在任意分辨率的RGB或灰度图像上渲染RGB文本!
用法:
out=rendertext(目标、文本、颜色、位置、模式1、模式2)
目标…MxNx3或MxN矩阵
文本…字符串(不支持换行)万博1manbetx
颜色向量的形式为[RGB]0-255
位置…位置(右,c)
可选参数:(默认值为'ovr','left')
模式1…“ovr”覆盖,“bnd”在图像上混合文本
模式2。。。文本对齐“左”、“中”或“右”。
出来具有相同大小的目标
示例(生成上面的sceenshot):
in=imread('football.jpg');
out=rendertext(在“覆盖模式”中,[0,255,0],[1,1]);
out=rendertext(out,'BLEND mode',[255 0 255],[30,1],'bnd','left');
out=rendertext(out,'left',[00255],[101150],'ovr','left');
out=rendertext(out,'mid',[00255],[130150],'ovr','mid');
out=rendertext(out,'right',[00255],[160150],'ovr','right');
imshow(out)
玩得开心(并给予表扬)!
引用为
戴维德·迪·格洛里亚(2021年)。在RGB或灰度图像上渲染RGB文本(//www.tianjin-qmedu.com/matlabcentral/fileexchange/26940-render-rgb-text-over-rgb-or-grayscale-image),MATLAB中心文件交换.