![]() ![]() All configuration parameters we’ll need for this project are contained inside config.json. We’ll be overlaying the “sunglasses” and “Deal With It” text on input image with these assets.ĭue to the number of configurable parameters, I decided to create a JSON configuration file (1) making it easier to edit parameters, and (2) requiring fewer command line arguments. assets/ : This folder contains our face detector, facial landmark detector and all images + associated masks. ![]() I’ve provided a selection of images of me but feel free to add your own. images/ : Our example input images that we wish to create the animated “Deal With it” GIF for.Project structure Figure 2: Our OpenCV GIF generator project structure consists of two directories, a config file, and a single Python script. You can install imutils on your system or virtual environment by using pip: $ pip install imutils Much of my blog posts and book/course content take advantage of my handy package of image processing convenience functions called imutils. Or if you’re on macOS, you may utilize HomeBrew: $ brew install imagemagick To install ImageMagick on Ubuntu (or Raspbian) simply use apt: $ sudo apt-get install imagemagick Using ImageMagick we can generate GIF images via a set of input images as well. What about batch color adjustments or adjusting the spatial dimensions of an entire image dataset in a single command? There’s no point in writing multiple lines of Python to use OpenCV for that. Have multiple images you’d like to turn into PDF slides? That’s easy.ĭo you have a need to draw polygons, lines, and other shapes? Go for it. Want to turn a PNG/JPG into a PDF with a single command? No problem. ImageMagick is a cross-platform command line based tool providing quite a bit of image processing functionality. If you aren’t familiar with ImageMagick, you should be. Be sure to follow one of my OpenCV installation guides if you do not have OpenCV installed on your system.ĭlib will be utilized for detecting facial landmarks, enabling us to find the two eyes of a face and lower the sunglasses on top of them. OpenCV will be used for face detection and basic image processing. Prerequisites and dependencies Figure 1: To create GIFs with OpenCV we’ll be taking advantage of OpenCV, dlib, and ImageMagick. Once we understand the project structure we’ll review (1) our configuration file, and (2) our Python script responsible for creating GIFs with OpenCV.įinally, we’ll take a look at the results of our OpenCV GIF creator by building a meme generator for the popular “Deal With It” meme. In the first part of the tutorial, we’ll discuss the prerequisites and dependencies for this project, including how to properly configure your development environment.įrom there we’ll review the project/directory structure for our OpenCV GIF creator. In today’s blog post, we are going to create animated GIFs with OpenCV, dlib, and the ImageMagick toolbox. Looking for the source code to this post? Jump Right To The Downloads Section Creating GIFs with OpenCV To learn how to generate GIFs and memes with OpenCV, just keep reading! ![]() ![]() Today’s tutorial is meant to be fun, jovial, and entertaining - all while teaching you valuableĬomputer vision skills that are used in the real world.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |