Image processing is an interesting field in today’s era of Artificial Intelligence and Machine Learning. We can see the applications of image processing in our day-to-day life, like whenever we apply filter over any image (selfie) or when we want to apply some effect like blurring the image, etc.
In this article, we will discuss how to add borders to an image using Python. Python provides a module called OpenCV that can be used for the same. So before adding borders let’s see a small introdcution about OpenCV.
OpenCV (Open Source Computer Vision Library)
- It is an open-source library.
- Designed to solve Computer Vision problems.
- It makes use of a highly optimized library for numerical operations which is Numpy along with MATLAB style syntax.
To add borders to the images OpenCV has a package copyMakeBorder which helps to make a border around the image.
Parameters of copyMakeBorder:
- value=color of border
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course