copymakebordercv

Copies given image, handle into R with a border around it.

Syntax

R = copymakebordercv(handle, top, bottom, left, right, type)

R = copymakebordercv(handle, top, bottom, left, right, 0, color)

Inputs

handle
Handle of the image from a imreadcv command.
Type: integer
top
Height of the border on top of the image in pixels.
Type: integer
bottom
Height of the border at the bottom of the image in pixels.
Type: integer
left
Width of the border to the left of the image in pixels.
Type: integer
right
Width of the border to the right of the image in pixels.
Type: integer
type
Border type. If a border type of 0 is used, a color can be specified to set the color of the border.
0
Type cv::BORDER_CONSTANT. A color can be specified to set the border color.
1
Type cv::BORDER_REPLICATE
2
Type cv::BORDER_REFLECT
3
Type cv::BORDER_WRAP
4
Type cv::BORDER_REFLECT_101
16
Type cv::BORDER_ISOLATED
Type: integer
color
Optional 3-element vector of integers representing red, green blue (RGB) colors, if type is 0. Black will be the default color if nothing is specified with type.
Type: vector
thickness
Optional parameter specifying the thickness of the line drawn on handle. Default value of thickness is 1.
Type: integer

Outputs

R
Handle to the ComputerVision data of the new image created. This handle can be used when accessing other functions in the ComputerVision library.
Type: integer

Example

Add a red border to an image :

handle = imreadcv('1.jpg');
R = copymakebordercv(handle, 2, 2, 2, 2, 0, [255 0 0]);


Figure 1. Input image


Figure 2. Output image