author: Rich Baird
Project description
ImageSegmenter
This Python package provides a class ImageSegmenter
for annotating images with bounding boxes using various image processing techniques.
Table of Contents
Background
Image segmentation and annotation is a crucial part of any machine learning project that deals with images. The ImageSegmenter
class provided in this package simplifies this process. It uses various image processing techniques like morphological operations, thresholding, and channel selection to help generate accurate bounding boxes. It also includes the ability to visualize the results, save the annotations, and apply various filters.
Installation
The ImageSegmenter
package requires:
- OpenCV
- NumPy
- Matplotlib
- VOCWriter (For saving annotations)
To install these dependencies, you can use pip:
pip install opencv-python numpy matplotlib voc-writer
To use the ImageSegmenter
class, simply include it in your Python script:
from image_segmenter import ImageSegmenter
Usage
Here's an example usage of the ImageSegmenter
class:
from image_segmenter import ImageSegmenter
# Instantiate the ImageSegmenter
annotator = ImageSegmenter()
# Read an image
image = annotator.read_image('path_to_image')
# Convert to grayscale
image_gray = annotator.select_colorsp(image, 'gray')
# Apply thresholding
thresholded = annotator.threshold(image_gray)
# Apply morphological operations
morphed = annotator.morph_op(thresholded, 'open')
# Find contours
bboxes = annotator.get_bboxes(morphed)
# Visualize the results #
#########################
# draw bounding boxes
annotated = annotator.draw_bboxes(image, bboxes)
# show the image
annotator.display_image(image, annotated)
#########################
# Save the annotations
annotator.save_annotations('path_to_save_annotations', image, bboxes)
TODO
- Write tests
- add multi-label support
- add support for other image formats
- add support for other image processing techniques
- add support for other annotation formats
Special Thanks
A special thanks to Kukil, the author of this guide from which these methods were generated
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for image_segmenter-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 812e2d6b021d2502ad032579c220d931c8cfa4e4c20c78dae4bf099a7504d777 |
|
MD5 | 4ee67f41fd909e46869a93ce4e7af1db |
|
BLAKE2b-256 | 7e41b53b2c7131d4f8116fe8c6497343b6c6d230cd8f6e21e02e5ae4ed6e1149 |