Most of us are familiar with image processing, not in formal terms of image processing but we all edit our pictures and post them on social media. 💖
Here I am going to show some interesting ways of doing image processing that we normally do every day using OpenCV and python.
What I am going to demonstrate specifically?
- Creating a custom image using OpenCV 😍✨
- Cropping pictures and pasting them ( We do that every day, don’t we while making memes 😂😂 )
- Making a collage of 2 pictures
So let's get going ✌💥
Using the above code we can create a smiley face 😊
I have basically used the drawing functions that are available from the OpenCV library in the cv2 module and created the image.
Keep smiling 😊 in your tough times and things will definitely come back to normal and you will achieve all the success in the world 😊✌🙏
🚩 You can get creative and create your own custom image like this. 😉😉
Now I will show you how to crop a face from an image and paste it somewhere ( the thing we mostly do while meme-making 😂😂 )
The Original Image I am going to use is -
Our very favorite Tom and Jerry.😍
Who all got reminded of their childhood memories? 💖🤩
Now using the above code we can crop Tom and Jerry’s faces and swap them also.
Here the face of Tom is cropped and swapped with Jerry’s face.
Here the face of Jerry is cropped and swapped with Tom’s face.
❗ In the above code, only one face swap code will work at a time, that is if you run the code for pasting Tom’s face on top of Jerry’s face then the other won’t work, and vice-versa. You need to then run the codes separately. I have given the codes together here. ❗
Now I will be creating a collage of Tom and Jerry ( after all they were the best of buddies 💖 )
This way I have performed few fun experiments with OpenCV and NumPy. 💖
You can find all the codes and images that I used here from the below GitHub link —
Experimenting with opencv. Contribute to iamrahulsil/opencv-numpy-image development by creating an account on GitHub.
A lot more things can be done using OpenCV and NumPy but for now this much.✌
I hope you liked this article.💖
Would definitely like to hear your views on this and feedbacks so that I can improve on those points in future articles. 🙌 Comment your views below.
You can also check my LinkedIn profile and connect with me.
Follow me on medium as I will come up with articles on various technologies like Cloud Computing, DevOps, Automation, and their integration.
Rahul Sil - Certified Kubernetes Application Developer ( CKAD ) - ARTH - The School of Technologies…
Hello everyone, I am Rahul Sil, a technology enthusiast. I love playing with technology and to try out various…
That’s all for now. Thank You !! 😊✌