Instead of manually constructing the translation matrix M and calling cv2.warpAffine, you can simply make a call to the translate function of imutils. To translate an image in OpenCV you need to supply the (x, y)-shift, denoted as (t x, t y) to construct the translation matrix M:Īnd from there, you would need to apply the cv2.warpAffine function. Translation is the shifting of an image in either the x or y direction. ![]() Let’s go ahead and take a look at what we can do with the imutils package. ![]() My imutils package: A series of OpenCV convenience functions To install the the imutils library, just issue the following command: $ pip install imutils This package assumes that you already have NumPy and OpenCV installed (along with matplotlib, if you intend on using the opencv2matplotlib function). In the future we will (probably, depending on feedback in the comments section) be performing a detailed code review of each of the functions in the imutils package, but for the time being, take a look at the rest of this blog post to see the functionality included in imutils, then be sure to install it on your own system! Installing You can start by choosing your own datasets or using our PyimageSearch’s assorted library of useful datasets.īring data in any of 40+ formats to Roboflow, train using any state-of-the-art model architectures, deploy across multiple platforms (API, NVIDIA, browser, iOS, etc), and connect to applications or 3rd party tools. Sign up or Log in to your Roboflow account to access state of the art dataset libaries and revolutionize your computer vision pipeline. Roboflow has free tools for each stage of the computer vision pipeline that will streamline your workflows and supercharge your productivity. It allows users to explore how these functions can simplify common tasks in image processing. This package includes a series of OpenCV + convenience functions that perform basics tasks such as translation, rotation, resizing, and skeletonization.Ī diverse image dataset is beneficial for testing the convenience functions in the imutils package. I use this package nearly every single day when working on computer vision and image processing problems. It makes downloading, installing, and managing Python libraries and packages a breeze.Īnd with all that said, I have pushed my own personal imutils package online. PyPI, the Python Package Index repository is a wonderful thing. ![]() Contributing to the open source community.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |