PyShapes:A Shape detection module for Python
PyShapes is a python package that allows to detect and extract the basic shapes(polygons and circles) present in an image. It also has some in-built attributes and functions to get basic information and perform basic operations on those shapes.
This module uses Python OpenCV as dependency
Installation
Installation is very simple through pip
For pip
pip install PyShapes
For pip3
pip3 install PyShapes
Usage
Importing the package
from PyShapes import *
Creating PyShape objects(Note : Object creation must be on PyShape class !)
shapes = PyShape("C:\\path\\to\\image")
Useful functions in PyShape -
-
Getting all the shapes detected in an image :
shapes_dictionary = shapes.get_all_shapes()Gets all the shapes in the image and returns a dictionary !
-
Displaying the shapes detected by providing coloured boundaries to them in original image :
shapes.show_shapes()Creates the coloured boundaries on top of the original image and displays the shape names along with the indexes
-
Getting the coordinates of the corners of a particular shape :
numpy_array = shapes.get_corners("name of shape", index_of_shape)Returns the coordinates of the corners of the shape in form of a numpy array
Returns None if there is no shape with that name/index
-
Getting the area of a particular shape :
area_of_shape = shapes.get_area("name of shape", index_of_shape)Returns the area of a particular shape in pixel2 units; return type : double
Returns -1 if there is no shape with that name/index
-
Finally, don't forget to close the running object !
shapes.close()Closes the object and the binded dependencies
About
The source is in the PyShape.py file.
Created By Richeek. Copyright 2020
Metadata
Release files for PyShapes 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyShapes-1.1.4.tar.gz | 4.2 kB | Without provenance | Details for PyShapes-1.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PyShapes-1.1.4-py3-none-any.whl | Python 3 | none | any | Details for PyShapes-1.1.4-py3-none-any.whl |
Total release size: 9.5 kB
Release files / PyShapes-1.1.4.tar.gz
| Download URL | PyShapes-1.1.4.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dde2d7b8832774e5a75997cfab7737fbc337e6e445f31d23797fee2e6b019d3c
|
|
BLAKE2b-256 checksum How to use checksums |
0cfe29f18dbfd5d1aa5e55ee8b0de79e1049cb83b5f413ddab32435ee82fca95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
|
Release files / PyShapes-1.1.4-py3-none-any.whl
| Download URL | PyShapes-1.1.4-py3-none-any.whl |
|---|---|
| Size | 5.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bbc17e12a0ef44f430dfea2cfe2af27ce33c6e3a2ee819778bef2878797390b
|
|
BLAKE2b-256 checksum How to use checksums |
6c1dc04417b7effe242d750b43d957e648464ac3fc145a18665da8b9a6673950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9
|
Security for PyShapes 1.1.4
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.