Microscopy Image Browser  1.233
All Classes Files Functions Variables Pages
rendertext.m File Reference

Render RGB text over RGB or grayscale images by Davide Di Gloria with the great contribution of Franz-Gerold Url. More...

Functions

function out = rendertext (target, text, color, pos, mode1, mode2)
 Render RGB text over RGB or grayscale images by Davide Di Gloria with the great contribution of Franz-Gerold Url. More...
 

Detailed Description

Render RGB text over RGB or grayscale images by Davide Di Gloria with the great contribution of Franz-Gerold Url.

Function Documentation

function out = rendertext (   target,
  text,
  color,
  pos,
  mode1,
  mode2 
)

Render RGB text over RGB or grayscale images by Davide Di Gloria with the great contribution of Franz-Gerold Url.

Parameters
targetMxNx3 or MxN matrix (grayscale will be converted to RGB)
textstring (NO LINE FEED SUPPORT)
colorvector in the form [r g b] 0-255
posposition (r,c)
mode1[optional] ovr to overwrite, bnd to blend text over image; default is ovr
mode2[optional] text aligment left, mid or right; default is right
Return values
outoutput, has the same size of target

Example:

in=imread('football.jpg');
out=rendertext(in,'OVERWRITE mode',[0 255 0], [1, 1]);
out=rendertext(out,'BLEND mode',[255 0 255], [30, 1], 'bnd', 'left');
out=rendertext(out,'left',[0 0 255], [101, 150], 'ovr', 'left');
out=rendertext(out,'mid',[0 0 255], [130, 150], 'ovr', 'mid');
out=rendertext(out,'right',[0 0 255], [160, 150], 'ovr', 'right');
imshow(out);