DrawBox

Draw a hollow box in the image.

 

Function call:

[out_img1]=vsg('DrawBox',in_img1,p1,p2,col,thickness);

 

Arguments:

in_img1 input image, can be 3 channel RGB, single channel greyscale, or binary image.

p1 - top left corner of the box to be drawn, including this pixel. Should be specified as a 2 vector e.g. [100;100].

p2 - bottom right corner of the box to be drawn, including this pixel. Should be specified as a 2 vector e.g. [100;100].

col - the colour of the box to be drawn. This should be specified as a 3-vector e.g. [50;100;200].

thickness - the thickness of the line used to draw the box, specified as an integer number of pixels.

 

Description:

[out_img1]=vsg('DrawBox',in_img1,p1,p2,col,thickness) – out_img1 is an image of the same dimensions and number of colour planes as the input image, with a box drawn at the specified location, with the specified colour and thickness.

 

Example:

img1 = openimage('lake.jpg');

[out_img1]=vsg('DrawBox',img1,[0,0],[50,50],[255,255,255],1);

figure, image(uint8(out_img1));
Home       Functions       Back