Use OpenCV to extract image crops using homography and feature matching
Project description
=========
imagecrop
=========
Image extraction using a template. Uses homography and feature matching,
storing results in a SQLite database for faster reprocessing.
Usage
=====
.. code-block:: python
from image_extract.extract import Extracter
ex = Extracter()
ex.crop_images(image_directory, crop_template, file_extension[, match_points])
Successful crops are extracted to a directory called ``successful_crops``,
directly underneath ``image_directory``. Each template used creates a subdirectory, named after its
MD5:
.. code::
image_directory
- img1.jpg
- …
- imgn.jpg
- successful_crops
- 2a1bdab44c5e81af34f47f3395a3da7e
- img1_cropped.jpg
The optional ``match_points`` argument controls the number of matching points which must
be detected in order for a match to occur. It is set to 30 by default.
Summaries
---------
Call ``ex.summary(path)`` to see information on extracted crops for a given directory.
Deleting Extracted Crops
------------------------
Call ``ex.delete(path[, template_md5])`` to delete extracted crops for a given template.
If no template MD5 value is given, all extracted crops in that directory are removed.
Accuracy
========
For best results, the template image should be of the same (or similar) resolution
as the image from which the crop is to be extracted.
imagecrop
=========
Image extraction using a template. Uses homography and feature matching,
storing results in a SQLite database for faster reprocessing.
Usage
=====
.. code-block:: python
from image_extract.extract import Extracter
ex = Extracter()
ex.crop_images(image_directory, crop_template, file_extension[, match_points])
Successful crops are extracted to a directory called ``successful_crops``,
directly underneath ``image_directory``. Each template used creates a subdirectory, named after its
MD5:
.. code::
image_directory
- img1.jpg
- …
- imgn.jpg
- successful_crops
- 2a1bdab44c5e81af34f47f3395a3da7e
- img1_cropped.jpg
The optional ``match_points`` argument controls the number of matching points which must
be detected in order for a match to occur. It is set to 30 by default.
Summaries
---------
Call ``ex.summary(path)`` to see information on extracted crops for a given directory.
Deleting Extracted Crops
------------------------
Call ``ex.delete(path[, template_md5])`` to delete extracted crops for a given template.
If no template MD5 value is given, all extracted crops in that directory are removed.
Accuracy
========
For best results, the template image should be of the same (or similar) resolution
as the image from which the crop is to be extracted.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for imagecrop-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe36ed3a7b850cd1a1c882c59c25a5cb2f58518ace713f37fc573fc4ef2ad4ce |
|
MD5 | 1990ad720d0ca430b3b8f362fefc11c3 |
|
BLAKE2b-256 | 36a89e193a63caa751edccbbaf33bec0c022de82e5e960a8af9a0edfc0f56f86 |