DrawLine

Draw a line in the image.

 

function call:

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

 

Arguments:

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

p1 – first coordinate of the line to be drawn. Should be specified as a 2 vector e.g. [100;100].

p2 – second coordinate of the line to be drawn. Should be specified as a 2 vector e.g. [100;100].

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

thickness - the thickness of the line used to be drawn, specified as an integer number of pixels.

 

Description:

[out_img1]=vsg('DrawLine',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 line drawn between the specified coordinates with the specified colour and thickness.

 

Example:

img1 = openimage('lake.jpg');

[out_img1]=vsg('DrawLine',img1,[10,50],[50,50],[255,0,0],2);

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