Copies the source 2D array into interior of destination array and makes a border of the specified type around the copied area. The function is useful when one needs to emulate border type that is different from the one embedded into a specific algorithm implementation. For example, morphological functions, as well as most of other filtering functions in OpenCV, internally use replication border type, while the user may need zero border or a border, filled with 1's or 255's

C# | Visual Basic | Visual C++ |
public static void cvCopyMakeBorder( IntPtr src, IntPtr dst, Point offset, BORDER_TYPE bordertype, MCvScalar value )
Public Shared Sub cvCopyMakeBorder ( _ src As IntPtr, _ dst As IntPtr, _ offset As Point, _ bordertype As BORDER_TYPE, _ value As MCvScalar _ )
public: static void cvCopyMakeBorder( IntPtr src, IntPtr dst, Point offset, BORDER_TYPE bordertype, MCvScalar value )

- src (IntPtr)
- The source image
- dst (IntPtr)
- The destination image
- offset (Point)
- Coordinates of the top-left corner (or bottom-left in case of images with bottom-left origin) of the destination image rectangle where the source image (or its ROI) is copied. Size of the rectangle matches the source image size/ROI size
- bordertype (BORDER_TYPE)
- Type of the border to create around the copied source image rectangle
- value (MCvScalar)
- Value of the border pixels if bordertype=CONSTANT