Basic Image Processing
Task 04 π¨π»βπ» Summer Program 2021
Task Description π
π Task 4.1 β π Create image by yourself Using Python Code
π Task 4.2 β π Take 2 image crop some part of both image and swap it.
π Task 4.3 β π Take 2 image and combine it to form single image. For example collage
Before starting, let us know about the two important libraries which are going to be used in the following codes.
NumPy: It is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
OpenCV: It is a library of Python bindings designed to solve computer vision problems. All the OpenCV array structures are converted to and from Numpy arrays.
Task 4.1
To make a simple image using python, weβre going to use the following code:
Output:
Task 4.2
There are two images which is to be cropped and to swap their faces. The images are:
To crop and swap their faces, the code given below is written where the dimensions of each image is set in such a way that is cropped exactly from the place where the faces are. Those dimensions are taken manually by hit & trial method to chose the pixels for cropping the image.
Output:
Task 4.3
Now combining the same two images that was taken before and making it into a single image.
The following code is implemented to achieve the output.
Output:
GitHub Repo: https://github.com/AwaisJunaid/Summer2021/tree/main/Task%204
Team : Summer_6_14
Mohammed Adnan
Prattipati Sri Raviteja
Saami Abdul Samad
Mohammed Awais Ahmed