poly-crop


Namepoly-crop JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryPython library for cropping polygons in images
upload_time2024-05-03 18:04:19
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords image processing crop polygon
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Poly_Crop
poly_crop is a Python library for cropping polygons in images.

## Installation
You can install poly_crop via pip:

```python
pip install poly_crop
```
## Usage
### Crop Function
The `crop` function is used to crop a polygonal region from an image.

```python
from poly_crop import crop as pc

# Example usage
image_path = "path/to/your/image.jpg"
image = cv2.imread(image_path)
vertices = [(100, 100), (175, 50), (300, 100), (175, 150), (170, 100)]

cropped_image = pc.crop(image, vertices, resize=False)
```
### Preview Function
The `preview` function is used to draw a preview of a polygonal region on an image.

```python
from poly_crop import preview as pc

# Example usage
image_path = "path/to/your/image.jpg"
image = cv2.imread(image_path)
vertices = [(100, 100), (175, 50), (300, 100), (175, 150), (170, 100)]

preview_image = pc.preview(image, vertices, colour=(255, 0, 0), width=2)
```

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "poly-crop",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "image, processing, crop, polygon",
    "author": null,
    "author_email": "Elias Jensen <ejkonge@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/ef/1a/f150a6234549791f6c8cb9168984f0d6be67c9953808ad7904a50f9ba9ea/poly_crop-0.4.0.tar.gz",
    "platform": null,
    "description": "# Poly_Crop\r\npoly_crop is a Python library for cropping polygons in images.\r\n\r\n## Installation\r\nYou can install poly_crop via pip:\r\n\r\n```python\r\npip install poly_crop\r\n```\r\n## Usage\r\n### Crop Function\r\nThe `crop` function is used to crop a polygonal region from an image.\r\n\r\n```python\r\nfrom poly_crop import crop as pc\r\n\r\n# Example usage\r\nimage_path = \"path/to/your/image.jpg\"\r\nimage = cv2.imread(image_path)\r\nvertices = [(100, 100), (175, 50), (300, 100), (175, 150), (170, 100)]\r\n\r\ncropped_image = pc.crop(image, vertices, resize=False)\r\n```\r\n### Preview Function\r\nThe `preview` function is used to draw a preview of a polygonal region on an image.\r\n\r\n```python\r\nfrom poly_crop import preview as pc\r\n\r\n# Example usage\r\nimage_path = \"path/to/your/image.jpg\"\r\nimage = cv2.imread(image_path)\r\nvertices = [(100, 100), (175, 50), (300, 100), (175, 150), (170, 100)]\r\n\r\npreview_image = pc.preview(image, vertices, colour=(255, 0, 0), width=2)\r\n```\r\n\r\n## License\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python library for cropping polygons in images",
    "version": "0.4.0",
    "project_urls": null,
    "split_keywords": [
        "image",
        " processing",
        " crop",
        " polygon"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d5c0d9246f896a9615c7f817f0aa6e03b583b7e77896b3eb42f91259c741600",
                "md5": "c9aedf616f83e51b196a0cbf383ce32b",
                "sha256": "b8ff6034638399924f2f087612f5b8d74353a0c226337c18732fa10cc69d2a7a"
            },
            "downloads": -1,
            "filename": "poly_crop-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c9aedf616f83e51b196a0cbf383ce32b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3564,
            "upload_time": "2024-05-03T18:04:17",
            "upload_time_iso_8601": "2024-05-03T18:04:17.993994Z",
            "url": "https://files.pythonhosted.org/packages/9d/5c/0d9246f896a9615c7f817f0aa6e03b583b7e77896b3eb42f91259c741600/poly_crop-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef1af150a6234549791f6c8cb9168984f0d6be67c9953808ad7904a50f9ba9ea",
                "md5": "3b109e17d34772ef6baee96a4b15c22e",
                "sha256": "3d473db8c6eed04700f2dbf58a9f3ab55303ffa727ae161c6af0881f6236a651"
            },
            "downloads": -1,
            "filename": "poly_crop-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3b109e17d34772ef6baee96a4b15c22e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3284,
            "upload_time": "2024-05-03T18:04:19",
            "upload_time_iso_8601": "2024-05-03T18:04:19.627461Z",
            "url": "https://files.pythonhosted.org/packages/ef/1a/f150a6234549791f6c8cb9168984f0d6be67c9953808ad7904a50f9ba9ea/poly_crop-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-03 18:04:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "poly-crop"
}
        
Elapsed time: 0.26883s