FillBox

Draw a filled box in the image.

 

function call:

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

 

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].

 

Description:

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

 

Example:

img1 = openimage('lake.jpg');

[out_img1]=vsg('FillBox',img1,[10,10],[50,50],[255,255,255]);

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