opencv-pg


Nameopencv-pg JSON
Version 1.0.2 PyPI version JSON
download
home_page
SummaryQt6 GUI Application for realtime exploration of OpenCV functions
upload_time2023-08-19 06:43:15
maintainer
docs_urlNone
author
requires_python>=3.7
license
keywords opencv cv2 cv computer vision
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenCV Playground
The OpenCV Playground is a Qt6 application that brings together improved documentation alongside OpenCV functions with the ability to explore the effects of function parameters on an image in real time.

It also comes with a custom `Pipeline Launcher` that allows you to build and interact with your own sequence of image transformations along with custom build functions.

Full documentation can be found on [Read the Docs](https://opencv-pg.readthedocs.io/en/latest/).

## Demo
<a href="https://drive.google.com/uc?export=view&id=1i4jmCHebu1_ognIwj2n4vtpCaT8BHWGI"><img src="https://media.giphy.com/media/GQj3aod8oKoxpJ4sC3/giphy.gif" style="width: 500px; height: auto;" /></a>


## Installation
Currently tested with python 3.8.10/3.10.0 and opencv-contrib-python-headless 4.8.0.76 on an M1 Mac.

From PyPi:

```shell
pip install opencv-pg
```

From Github Repo:

```shell
pip install git+https://github.com/opencv-pg/opencv-pg
```

### Note for Linux Users
**NOTE:** I no longer have access to anything but a Mac (as of `1.0.2`), so I can't confirm if the below still stands. It did in `1.0.1`.

On Ubuntu 16.04 (others currently untested), there may be missing links to xcb related shared objects.

tldr;

```shell
sudo apt-get install --reinstall libxcb-xinerama0
```
------

**Digging Deeper**

If you see errors about xcb, you can perform the following to help troubleshoot. In your terminal, make the following export:

```shell
export QT_DEBUG_PLUGINS=1
```

Run opencvpg again and validate the output. The final lines will likely mention details about files not found. Likely `libxcb-xinerama.so.0`.

Run the following:

```shell
cd your_venv/lib/pythonX.X/site-packages/PySide2/Qt/plugins/platforms/
ldd libqxcb.so | grep "not found"
```

This will print any missing links. In our case, `libxcb-xinerama.so.0` showed up a couple times. Reinstalling the package as follows resolved the issue:

```shell
sudo apt-get install --reinstall libxcb-xinerama0
```

Once it’s working, you may want to disable that `QT_DEBUG_PLUGINS` env variable so it doesn’t throw extra garbage in your output.

## Usage
### Playground
To launch the OpenCV Playground with:
* The built-in image:

```shell
opencvpg
```

* An image of your choice:

```shell
opencvpg --image <path-to-image.png>
```

* Without the documentation window:

```shell
opencvpg --no-docs
```

### Custom Pipeline
The following is an example of building a custom Pipeline.

```python
from opencv_pg import Pipeline, Window, launch_pipeline
from opencv_pg import support_transforms as supt
from opencv_pg import transforms as tf

if __name__ == '__main__':
    my_image = '/path/to/image.png'

    # Creates two windows
    pipeline = Pipeline([
        Window([
            supt.LoadImage(my_image),
            supt.CvtColor(),
            tf.InRange(),
            supt.BitwiseAnd(),
        ]),
        Window([
            tf.Canny(),
        ]),
    ])

    launch_pipeline(pipeline)
```

Then run the file.

## Development
### Installation
To install in development mode:

```shell
git clone https://github.com/opencv-pg/opencv-pg
pip install -e opencv-pg/[dev]
```

### Running Tests
```shell
cd tests
pytest
```

### Generating Docs
* Go into the top level `docs` directory
* run `sphinx-apidoc -f -o source/ ../src/opencv_pg`
* run `make html`

Output will be in the `docs/build/html/` directory.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "opencv-pg",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "opencv,cv2,cv,computer vision",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c7/5b/27bc2c98ff80daf6e8ccf24aeab683d7bccb3755e4522c5ebaf676f630ce/opencv_pg-1.0.2.tar.gz",
    "platform": null,
    "description": "# OpenCV Playground\nThe OpenCV Playground is a Qt6 application that brings together improved documentation alongside OpenCV functions with the ability to explore the effects of function parameters on an image in real time.\n\nIt also comes with a custom `Pipeline Launcher` that allows you to build and interact with your own sequence of image transformations along with custom build functions.\n\nFull documentation can be found on [Read the Docs](https://opencv-pg.readthedocs.io/en/latest/).\n\n## Demo\n<a href=\"https://drive.google.com/uc?export=view&id=1i4jmCHebu1_ognIwj2n4vtpCaT8BHWGI\"><img src=\"https://media.giphy.com/media/GQj3aod8oKoxpJ4sC3/giphy.gif\" style=\"width: 500px; height: auto;\" /></a>\n\n\n## Installation\nCurrently tested with python 3.8.10/3.10.0 and opencv-contrib-python-headless 4.8.0.76 on an M1 Mac.\n\nFrom PyPi:\n\n```shell\npip install opencv-pg\n```\n\nFrom Github Repo:\n\n```shell\npip install git+https://github.com/opencv-pg/opencv-pg\n```\n\n### Note for Linux Users\n**NOTE:** I no longer have access to anything but a Mac (as of `1.0.2`), so I can't confirm if the below still stands. It did in `1.0.1`.\n\nOn Ubuntu 16.04 (others currently untested), there may be missing links to xcb related shared objects.\n\ntldr;\n\n```shell\nsudo apt-get install --reinstall libxcb-xinerama0\n```\n------\n\n**Digging Deeper**\n\nIf you see errors about xcb, you can perform the following to help troubleshoot. In your terminal, make the following export:\n\n```shell\nexport QT_DEBUG_PLUGINS=1\n```\n\nRun opencvpg again and validate the output. The final lines will likely mention details about files not found. Likely `libxcb-xinerama.so.0`.\n\nRun the following:\n\n```shell\ncd your_venv/lib/pythonX.X/site-packages/PySide2/Qt/plugins/platforms/\nldd libqxcb.so | grep \"not found\"\n```\n\nThis will print any missing links. In our case, `libxcb-xinerama.so.0` showed up a couple times. Reinstalling the package as follows resolved the issue:\n\n```shell\nsudo apt-get install --reinstall libxcb-xinerama0\n```\n\nOnce it\u2019s working, you may want to disable that `QT_DEBUG_PLUGINS` env variable so it doesn\u2019t throw extra garbage in your output.\n\n## Usage\n### Playground\nTo launch the OpenCV Playground with:\n* The built-in image:\n\n```shell\nopencvpg\n```\n\n* An image of your choice:\n\n```shell\nopencvpg --image <path-to-image.png>\n```\n\n* Without the documentation window:\n\n```shell\nopencvpg --no-docs\n```\n\n### Custom Pipeline\nThe following is an example of building a custom Pipeline.\n\n```python\nfrom opencv_pg import Pipeline, Window, launch_pipeline\nfrom opencv_pg import support_transforms as supt\nfrom opencv_pg import transforms as tf\n\nif __name__ == '__main__':\n    my_image = '/path/to/image.png'\n\n    # Creates two windows\n    pipeline = Pipeline([\n        Window([\n            supt.LoadImage(my_image),\n            supt.CvtColor(),\n            tf.InRange(),\n            supt.BitwiseAnd(),\n        ]),\n        Window([\n            tf.Canny(),\n        ]),\n    ])\n\n    launch_pipeline(pipeline)\n```\n\nThen run the file.\n\n## Development\n### Installation\nTo install in development mode:\n\n```shell\ngit clone https://github.com/opencv-pg/opencv-pg\npip install -e opencv-pg/[dev]\n```\n\n### Running Tests\n```shell\ncd tests\npytest\n```\n\n### Generating Docs\n* Go into the top level `docs` directory\n* run `sphinx-apidoc -f -o source/ ../src/opencv_pg`\n* run `make html`\n\nOutput will be in the `docs/build/html/` directory.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Qt6 GUI Application for realtime exploration of OpenCV functions",
    "version": "1.0.2",
    "project_urls": {
        "Changelog": "https://github.com/opencv-pg/opencv-pg/blob/master/CHANGELOG.md",
        "Documentation": "https://opencv-pg.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/opencv-pg/opencv-pg",
        "Repository": "https://github.com/opencv-pg/opencv-pg"
    },
    "split_keywords": [
        "opencv",
        "cv2",
        "cv",
        "computer vision"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c83c26b5cb889d721b510495dbe302009bae7981db77aa45ab387f6ce0dbaa80",
                "md5": "c0396a322bd1228af8de10d748697970",
                "sha256": "4f966a8abfa8acceb871e3eb4b07d94b53b9a59eb4f09d74fe8333bd9c1f8849"
            },
            "downloads": -1,
            "filename": "opencv_pg-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c0396a322bd1228af8de10d748697970",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6432108,
            "upload_time": "2023-08-19T06:43:09",
            "upload_time_iso_8601": "2023-08-19T06:43:09.372095Z",
            "url": "https://files.pythonhosted.org/packages/c8/3c/26b5cb889d721b510495dbe302009bae7981db77aa45ab387f6ce0dbaa80/opencv_pg-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c75b27bc2c98ff80daf6e8ccf24aeab683d7bccb3755e4522c5ebaf676f630ce",
                "md5": "6caf0237ba16aa31da506dce10b6e87d",
                "sha256": "f09919d92dc775d0f3e5b1b024a64edefd8b5dd301c588a88d424b088ba79805"
            },
            "downloads": -1,
            "filename": "opencv_pg-1.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6caf0237ba16aa31da506dce10b6e87d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 6271111,
            "upload_time": "2023-08-19T06:43:15",
            "upload_time_iso_8601": "2023-08-19T06:43:15.593560Z",
            "url": "https://files.pythonhosted.org/packages/c7/5b/27bc2c98ff80daf6e8ccf24aeab683d7bccb3755e4522c5ebaf676f630ce/opencv_pg-1.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-19 06:43:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "opencv-pg",
    "github_project": "opencv-pg",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "opencv-pg"
}
        
Elapsed time: 0.10927s