Drawing borders around an image using OpenCV

OpenCVPythonServer Side ProgrammingProgramming

In this program, we will draw borders around an image. We will use the copyMakeBorder() method in the openCV library. This function takes various parameters like image, top, bottom, left, right border values.

Algorithm

Step 1: Import cv2.
Step 3: Dall the cv2.copymakeborder() method.
Step 4: Display the output.

Example Code

import cv2

cv2.imshow('Border', image)