The cvcopymakeborder () function can copy an image and create a boundary to slightly increase the image size. Then, the image boundary is automatically filled in various ways. When bordertype = ipl_border_replicate, rows and columns of the original image edge are copied to the edge of the large image. When bordertype = ipl_border_constant, there is a black border with pixel width.
Bytes --------------------------------------------------------------------------------------------------
Copymakeborder
Copy the image and create the border.
void cvCopyMakeBorder( const CvArr* src, CvArr* dst, CvPoint offset, int bordertype, CvScalar value=cvScalarAll(0) );
-
SRC
-
Enter the image.
-
DST
-
Output image.
-
Offset
-
Input the coordinates of the upper left corner of the rectangle (or the lower left corner if the lower left corner is the origin) of the output image to be copied ). The rectangle size must match the ROI of the original image size.
-
Bordertype
-
The border type of the original image rectangle that has been copied:
-
Ipl_border_constant-the filling boundary is a fixed value, which is specified by the last parameter of the function. Ipl_border_replicate-use the downlink or left and right columns to copy and fill the boundary. (Ipl_border_reflect and ipl_border_wrap are currently not supported ).
-
Value
-
If the boundary type is ipl_border_constant, This is the boundary pixel value.
The cvcopymakeborder function copies the input two-dimensional array to the output array and creates a boundary of the specified type around the copy area. A function can be used to simulate different types of boundaries embedded in a specified algorithm implementation. For example, like most other filtering functions in opencv, some morphological functions use the copy boundary type, but users may need to have zero boundary or fill in the boundary of 1 or 255.
Bytes --------------------------------------------------------------------------------------------------
/* Code */
#include
Bytes --------------------------------------------------------------------------------------------------
/* Result */
Source image
Filtering for one pixel boder
Flitering for no boder