Skip to main content

detects and analyzes shapes in images using parallel processing.

pip install multiprocshapefinder

Tested against Python 3.11 / Windows 10

Advantages:

Parallel Processing:

The module utilizes parallel processing (cpus parameter) to speed up the shape detection process, which can be advantageous for analyzing multiple images simultaneously.

Flexible Input:

It accepts images in various formats, providing flexibility in the source of the images.

Caching:

The option to use caching (usecache) can save time on the same images.

Visualization:

The module provides a function (draw_results) for visualizing the detected shapes on the original images, making it easier for users to interpret and verify the results.

Configurability:

The module exposes various parameters, such as Canny edge detection thresholds and contour approximation factors, allowing users to fine-tune the shape detection process based on their requirements.

# Importing functions from the multiprocshapefinder module
from multiprocshapefinder import find_all_shapes, draw_results

# List of image URLs to be processed
images = [
    r"https://raw.githubusercontent.com/hansalemaos/screenshots/main/findshapes_1.png",
]  # accepts almost all formats (url/path/buffer/base64/np/PIL) - https://github.com/hansalemaos/a_cv_imwrite_imread_plus

# Calling find_all_shapes function to detect and analyze shapes in the given images
df = find_all_shapes(
    images,
    threshold1=10,
    threshold2=90,
    approxPolyDPvar=0.01,
    cpus=5,  # Number of CPU cores to use for parallel processing
    chunks=1,  # Number of chunks to split the image processing into
    print_stderr=True,  # Print error messages to stderr
    print_stdout=False,  # Do not print standard output messages
    usecache=True,  # Use caching for intermediate results
)

# Printing the resulting DataFrame containing shape information
print(df)

# Calling draw_results function to visualize the detected shapes on the original image
draw_results(
    df,
    images[0],  # Using the first image in the list - filter the DF (df.loc) if len(images)>1
    min_area=5,  # Minimum area threshold for shapes to be considered
    shapes=("rectangle", "triangle", "circle", "pentagon", "hexagon", "oval"),  # Shapes to be visualized
    cv2show=True,  # Display the result using OpenCV
)

Metadata

Release files for multiprocshapefinder 0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multiprocshapefinder 0.12
File Size Uploaded Provenance Actions
multiprocshapefinder-0.12.tar.gz 59.9 kB Without provenance Details for multiprocshapefinder-0.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for multiprocshapefinder 0.12
File Interpreter ABI Platform Actions
multiprocshapefinder-0.12-py3-none-any.whl Python 3 none any Details for multiprocshapefinder-0.12-py3-none-any.whl

Total release size: 120.3 kB

Release files / multiprocshapefinder-0.12.tar.gz

Download URL multiprocshapefinder-0.12.tar.gz
Size 59.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7fe2a715e3d328e6b881e64e483e07b8f996af0f0294a8b1302021ddec0b0593
BLAKE2b-256 checksum
How to use checksums
febfa17c6e22b771bebd68a16dc85009d3df5be9cf05096b193169181dd636e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / multiprocshapefinder-0.12-py3-none-any.whl

Download URL multiprocshapefinder-0.12-py3-none-any.whl
Size 60.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7046907a477191be0844dbd646595d6934f62c93a31ab9e4aae2d7693c3aaf7
BLAKE2b-256 checksum
How to use checksums
0003287d519f7f7c0487093ffec7bb39480787e2c9d61b0e936c01de7da6d47b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for multiprocshapefinder 0.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.12 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page