Code covered by the BSD License  

Highlights from
Embed Text and Graphics in an Image

Be the first to rate this file! 15 Downloads (last 30 days) File Size: 4.15 KB File ID: #38721
image thumbnail

Embed Text and Graphics in an Image

by Brett Shoelson

 

12 Nov 2012

Burn or embed text and graphics in an image.

| Watch this File

File Information
Description

Use insertInImage to embed, or burn, any text or graphics item into an image. You can specify, using a cell array of parameter-value pairs (PVs), or using a structure, any valid properties of the specified object to insert. ALL ITEMS MUST BE SPECIFIED IN PIXEL COORDINATES, and must not extend beyond the edges of the image!
 
SYNTAX: IMGOUT = insertInImage(IMGIN,INSERTIONCOMMAND,PVs)
 
INPUTS:
BASEIMAGE: an image, or a handle to an image (or parent object containing an image), in which the object is to be embedded. (The image need not be displayed, unless a handle is provided.)
 
INSERTIONCOMMAND: text, rectangle, line, ellipse, etc. to embed in the image. Internally, insertInImage calls FEVAL; anything that works inside an feval command will workhere. For example, you can insert the string 'TESTING' at [x,y] = [20,30] using feval( @() text('TESTING',20,30]), so the insertionCommand for this would be:
@() text('TESTING',20,30).
 
TEXT:
@() text(x,y,string)
 
RECTANGLE:
@() rectangle('position',[x y w h])
  
LINE:
@() line(x,y)
 
PVs (OPTIONAL): Cell array or structure of any parameter-value pairs valid for the TYPE of object you wish to insert.(Note that this _may_ include a 'position' parameter, which will overwrite any position set with the insertion command. For example, when you insert a string, PVs can be any Parameter-Value pairs valid for TEXT objects. (See 'Text Properties' for details.)
  
OUTPUTS:
IMGOUT: output RGB image of the same class as imgin, with embedded text or graphic item(s).

(Thet lines, text, and circles are burned in the image herewith.)

Acknowledgements

Create Button Label inspired this file.

Required Products Image Processing Toolbox
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File  
Everyone's Tags
burn graphics, burn text, embed graphics, embed text, image, image processing
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us