camera-occlusion


Namecamera-occlusion JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryA library for applying realistic camera occlusion effects like rain and dust for computer vision data augmentation.
upload_time2025-08-16 19:02:45
maintainerNone
docs_urlNone
authorJulian Quick
requires_python>=3.8
licenseMIT License Copyright (c) 2025 Julian Quick Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords computer vision data augmentation image processing rain dust occlusion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Realistic Camera Occlusion Effects for Computer Vision
[![PyPI version](https://img.shields.io/pypi/v/camera-occlusion.svg)](https://pypi.org/project/camera-occlusion/)

This project provides a Python library and tools for applying realistic, parameterized camera occlusion effects like rain and dust to images. It's designed for data augmentation in computer vision tasks, such as training a traffic sign classifier to be more robust against adverse conditions.


![Example noise image](examples/example_noise.png)

## Quick Start
```
pip install camera_occlusion
obscure-image GTSRB_dataset/GTSRB/Final_Training/Images/00000/00000_00000.ppm  out.ppm --effect rain
```

## Features

* **Rain Effect**: Simulates raindrops on a camera lens with distortion, shading, and highlights.
* **Dust Effect**: Simulates fine dust specks, scratches, and semi-transparent grime splotches.
* **PyTorch Integration**: Includes a `Dataset` class for on-the-fly data augmentation during model training.
* **Command-Line Tools**: Apply effects to single images or train a model directly from the command line.

## Installation

1.  **Clone the repository:**
    ```bash
    git clone [https://github.com/your-username/german_signs.git](https://github.com/your-username/german_signs.git)
    cd german_signs
    ```

2.  **Create and activate a virtual environment (recommended):**
    ```bash
    python3 -m venv venv
    source venv/bin/activate
    ```

3.  **Install the required packages:**
    ```bash
    pip install -e .
    ```

## Usage

There are three main ways to use this project:

### 1. As a Python Library

You can easily import and use the `Rain` and `Dust` effect classes in your own scripts.

```python
import imageio.v2 as imageio
from camera_occlusion import Rain

# Load an image
image = imageio.imread("path/to/your/image.jpg")

# Apply a heavy rain effect
heavy_rain = Rain(num_drops=100, radius_range=(4, 8))
augmented_image = heavy_rain(image)

# Save or display the result
imageio.imwrite("rainy_image.jpg", augmented_image)
```

### 2. Gallery Demonstration

To see a gallery of all available effects and presets, run the example script. This will generate a plot showing various levels of rain and dust.

```bash
python examples/run_gallery.py
```

## License

This project is licensed under the MIT License. See the `LICENSE` file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "camera-occlusion",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "computer vision, data augmentation, image processing, rain, dust, occlusion",
    "author": "Julian Quick",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/30/1a/7844b2c260d7549e381b9e8c3dfe1145a904214ca8a96c047f75cf957c1a/camera_occlusion-0.1.1.tar.gz",
    "platform": null,
    "description": "# Realistic Camera Occlusion Effects for Computer Vision\n[![PyPI version](https://img.shields.io/pypi/v/camera-occlusion.svg)](https://pypi.org/project/camera-occlusion/)\n\nThis project provides a Python library and tools for applying realistic, parameterized camera occlusion effects like rain and dust to images. It's designed for data augmentation in computer vision tasks, such as training a traffic sign classifier to be more robust against adverse conditions.\n\n\n![Example noise image](examples/example_noise.png)\n\n## Quick Start\n```\npip install camera_occlusion\nobscure-image GTSRB_dataset/GTSRB/Final_Training/Images/00000/00000_00000.ppm  out.ppm --effect rain\n```\n\n## Features\n\n* **Rain Effect**: Simulates raindrops on a camera lens with distortion, shading, and highlights.\n* **Dust Effect**: Simulates fine dust specks, scratches, and semi-transparent grime splotches.\n* **PyTorch Integration**: Includes a `Dataset` class for on-the-fly data augmentation during model training.\n* **Command-Line Tools**: Apply effects to single images or train a model directly from the command line.\n\n## Installation\n\n1.  **Clone the repository:**\n    ```bash\n    git clone [https://github.com/your-username/german_signs.git](https://github.com/your-username/german_signs.git)\n    cd german_signs\n    ```\n\n2.  **Create and activate a virtual environment (recommended):**\n    ```bash\n    python3 -m venv venv\n    source venv/bin/activate\n    ```\n\n3.  **Install the required packages:**\n    ```bash\n    pip install -e .\n    ```\n\n## Usage\n\nThere are three main ways to use this project:\n\n### 1. As a Python Library\n\nYou can easily import and use the `Rain` and `Dust` effect classes in your own scripts.\n\n```python\nimport imageio.v2 as imageio\nfrom camera_occlusion import Rain\n\n# Load an image\nimage = imageio.imread(\"path/to/your/image.jpg\")\n\n# Apply a heavy rain effect\nheavy_rain = Rain(num_drops=100, radius_range=(4, 8))\naugmented_image = heavy_rain(image)\n\n# Save or display the result\nimageio.imwrite(\"rainy_image.jpg\", augmented_image)\n```\n\n### 2. Gallery Demonstration\n\nTo see a gallery of all available effects and presets, run the example script. This will generate a plot showing various levels of rain and dust.\n\n```bash\npython examples/run_gallery.py\n```\n\n## License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License\n        \n        Copyright (c) 2025 Julian Quick\n        \n        Permission is hereby granted, free of charge, to any person obtaining a copy\n        of this software and associated documentation files (the \"Software\"), to deal\n        in the Software without restriction, including without limitation the rights\n        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n        copies of the Software, and to permit persons to whom the Software is\n        furnished to do so, subject to the following conditions:\n        \n        The above copyright notice and this permission notice shall be included in all\n        copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n        SOFTWARE.\n        ",
    "summary": "A library for applying realistic camera occlusion effects like rain and dust for computer vision data augmentation.",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/your-username/camera-occlusion/issues",
        "Homepage": "https://github.com/your-username/camera-occlusion"
    },
    "split_keywords": [
        "computer vision",
        " data augmentation",
        " image processing",
        " rain",
        " dust",
        " occlusion"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2c1a0d4ac9d709a3fde665163156dcdc20eb60bfdb396c02def0db0cbe3ca4e0",
                "md5": "f16b03737a30af8428c6cdc9c36fbd7f",
                "sha256": "3e5bd1b97e56dfe96ed00f036f04dc8b37340b6d7cfe4a6493a3ba461a1beba6"
            },
            "downloads": -1,
            "filename": "camera_occlusion-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f16b03737a30af8428c6cdc9c36fbd7f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10992,
            "upload_time": "2025-08-16T19:02:44",
            "upload_time_iso_8601": "2025-08-16T19:02:44.562114Z",
            "url": "https://files.pythonhosted.org/packages/2c/1a/0d4ac9d709a3fde665163156dcdc20eb60bfdb396c02def0db0cbe3ca4e0/camera_occlusion-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "301a7844b2c260d7549e381b9e8c3dfe1145a904214ca8a96c047f75cf957c1a",
                "md5": "d3e840e4dadda218434a122b0b35bcba",
                "sha256": "41c2d7387129c5157c6162e075b78329b9b1b494d029a6ed27cfdcfc9789d2e6"
            },
            "downloads": -1,
            "filename": "camera_occlusion-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "d3e840e4dadda218434a122b0b35bcba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 12045,
            "upload_time": "2025-08-16T19:02:45",
            "upload_time_iso_8601": "2025-08-16T19:02:45.872599Z",
            "url": "https://files.pythonhosted.org/packages/30/1a/7844b2c260d7549e381b9e8c3dfe1145a904214ca8a96c047f75cf957c1a/camera_occlusion-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-16 19:02:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "your-username",
    "github_project": "camera-occlusion",
    "github_not_found": true,
    "lcname": "camera-occlusion"
}
        
Elapsed time: 1.06800s