ibex-1d


Nameibex-1d JSON
Version 1.3.2 PyPI version JSON
download
home_page
SummaryImage 1D Barcode EXtractor - Detect and Extract 1D Barcode(s) in Photographs
upload_time2023-02-01 13:50:12
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2022 Ben Souchet 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 NON INFRINGEMENT. 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 opencv computer-vision barcode detection extraction roi image-recognition
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # IBEX 1D : Image 1D Barcode EXtractor

### Detect 1D Barcode(s) in Photographs, Extract & Straighten them!

A `Python 3` command line script to detect & extract barcode(s) in images, using **OpenCV** and **NumPy**.

<p align="center">
  <img alt="Example of barcode extraction" src="https://user-images.githubusercontent.com/17025808/212469506-80761d45-934e-4c25-aeac-b591c0607fa3.png" width="600">
</p>

## Install

### Via PIP

```sh
pip3 install ibex-1d
```
And for update to latest version use:
```sh
pip3 install --upgrade ibex-1d
```

### Via Source Code

Download the [latest release](https://github.com/BenSouchet/ibex_1d/releases) or clone/download this repository.

## Usage
If you installed the package (via `pip3`) you can either import the package in your project:
```python
import ibex_1d

image_path = "/Users/bensouchet/Desktop/IMG_3212.png"
settings = ibex_1d.Settings()
settings.use_adaptive_threshold = True

barcode_extract = ibex_1d.ImageBarcodeExtract1D(settings)
results = barcode_extract.find_barcodes([image_path])
```
Or use it as a script directly in you terminal:
```sh
ibex_1d -i ~/Desktop/IMG_3212.png
```

If you download a release or clone the repository, to use it as a script:
```sh
python3 ibex_1d.py -i ~/Desktop/IMG_3212.png
```

## Results

If you called **IBEX 1D** via your terminal (as a script), the barcode images extracted will be saved into a newly created folder inside a folder `./results/`, if nothing has been generated please check the log(s) in your terminal.

Otherwise if you called the function `find_barcodes` you will received a python list of `ibex_1d.Result` instances, this class store info about the execution (like execution status, message, debug steps) and the barcode(s) image(s) extracted for each image path passed to the function.

## Multiple images

You can pass one or more images/photographs to the script like this:
```sh
ibex_1d -i ~/Desktop/IMG_3205.png ./object_12.jpg ~/Documents/photo_0345.jpeg
```
Inside the corresponding result sub-folder, extracted barcodes will be named `barcode_001.png`, `barcode_002.png`, `barcode_003.png`, ...

## Incorrect result ?
If the barcode hasn't been extracted (or the resulting barcode image isn't good) this can be due to the OTSU threshold method.
You can try using the script with the argument `-a` (or `--adaptive-threshold`):
```sh
ibex_1d -i ~/Desktop/IMG_3205.png -a
```
This threshold method isn't set as default because it's slower than OTSU.

## Debug

You can visualize some steps of the sheet detection.
For the script call you need to add the argument `-d` or `--debug` to the command:
```sh
ibex_1d -i ~/Documents/product_03.jpeg -d
```
if you imported the package, you need to enable the `save_detection_steps` in the settings instance like this:
```python
settings = Settings()
settings.save_detection_steps = True

barcode_extract = ImageBarcodeExtract1D(settings)
results = barcode_extract.find_barcodes(images_paths)
```
This will add debug/steps images into the result sub-folders.

## Errors / Warnings

In case of an error you should see a formatted log message in your terminal telling you exactly what is the issue.
If the script crash or something don't work you can open an issue [here](https://github.com/BenSouchet/ibex_1d/issues).

## Author / Maintainer

**IBEX 1D** has been created and is currently maintained by [Ben Souchet](https://github.com/BenSouchet).

## Licenses

The code present in this repository is under [MIT license](https://github.com/BenSouchet/ibex_1d/blob/main/LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ibex-1d",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Ben Souchet <contact@bensouchet.dev>",
    "keywords": "opencv,computer-vision,barcode,detection,extraction,roi,image-recognition",
    "author": "",
    "author_email": "Ben Souchet <contact@bensouchet.dev>",
    "download_url": "https://files.pythonhosted.org/packages/b1/5a/5201e0acd2a356f1856361c76e20573c88e02ba438ea006196b7c30f0ea3/ibex_1d-1.3.2.tar.gz",
    "platform": null,
    "description": "# IBEX 1D : Image 1D Barcode EXtractor\n\n### Detect 1D Barcode(s) in Photographs, Extract & Straighten them!\n\nA `Python 3` command line script to detect & extract barcode(s) in images, using **OpenCV** and **NumPy**.\n\n<p align=\"center\">\n  <img alt=\"Example of barcode extraction\" src=\"https://user-images.githubusercontent.com/17025808/212469506-80761d45-934e-4c25-aeac-b591c0607fa3.png\" width=\"600\">\n</p>\n\n## Install\n\n### Via PIP\n\n```sh\npip3 install ibex-1d\n```\nAnd for update to latest version use:\n```sh\npip3 install --upgrade ibex-1d\n```\n\n### Via Source Code\n\nDownload the [latest release](https://github.com/BenSouchet/ibex_1d/releases) or clone/download this repository.\n\n## Usage\nIf you installed the package (via `pip3`) you can either import the package in your project:\n```python\nimport ibex_1d\n\nimage_path = \"/Users/bensouchet/Desktop/IMG_3212.png\"\nsettings = ibex_1d.Settings()\nsettings.use_adaptive_threshold = True\n\nbarcode_extract = ibex_1d.ImageBarcodeExtract1D(settings)\nresults = barcode_extract.find_barcodes([image_path])\n```\nOr use it as a script directly in you terminal:\n```sh\nibex_1d -i ~/Desktop/IMG_3212.png\n```\n\nIf you download a release or clone the repository, to use it as a script:\n```sh\npython3 ibex_1d.py -i ~/Desktop/IMG_3212.png\n```\n\n## Results\n\nIf you called **IBEX 1D** via your terminal (as a script), the barcode images extracted will be saved into a newly created folder inside a folder `./results/`, if nothing has been generated please check the log(s) in your terminal.\n\nOtherwise if you called the function `find_barcodes` you will received a python list of `ibex_1d.Result` instances, this class store info about the execution (like execution status, message, debug steps) and the barcode(s) image(s) extracted for each image path passed to the function.\n\n## Multiple images\n\nYou can pass one or more images/photographs to the script like this:\n```sh\nibex_1d -i ~/Desktop/IMG_3205.png ./object_12.jpg ~/Documents/photo_0345.jpeg\n```\nInside the corresponding result sub-folder, extracted barcodes will be named `barcode_001.png`, `barcode_002.png`, `barcode_003.png`, ...\n\n## Incorrect result ?\nIf the barcode hasn't been extracted (or the resulting barcode image isn't good) this can be due to the OTSU threshold method.\nYou can try using the script with the argument `-a` (or `--adaptive-threshold`):\n```sh\nibex_1d -i ~/Desktop/IMG_3205.png -a\n```\nThis threshold method isn't set as default because it's slower than OTSU.\n\n## Debug\n\nYou can visualize some steps of the sheet detection.\nFor the script call you need to add the argument `-d` or `--debug` to the command:\n```sh\nibex_1d -i ~/Documents/product_03.jpeg -d\n```\nif you imported the package, you need to enable the `save_detection_steps` in the settings instance like this:\n```python\nsettings = Settings()\nsettings.save_detection_steps = True\n\nbarcode_extract = ImageBarcodeExtract1D(settings)\nresults = barcode_extract.find_barcodes(images_paths)\n```\nThis will add debug/steps images into the result sub-folders.\n\n## Errors / Warnings\n\nIn case of an error you should see a formatted log message in your terminal telling you exactly what is the issue.\nIf the script crash or something don't work you can open an issue [here](https://github.com/BenSouchet/ibex_1d/issues).\n\n## Author / Maintainer\n\n**IBEX 1D** has been created and is currently maintained by [Ben Souchet](https://github.com/BenSouchet).\n\n## Licenses\n\nThe code present in this repository is under [MIT license](https://github.com/BenSouchet/ibex_1d/blob/main/LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2022 Ben Souchet  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 NON INFRINGEMENT. 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. ",
    "summary": "Image 1D Barcode EXtractor - Detect and Extract 1D Barcode(s) in Photographs",
    "version": "1.3.2",
    "split_keywords": [
        "opencv",
        "computer-vision",
        "barcode",
        "detection",
        "extraction",
        "roi",
        "image-recognition"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9651186c848a9dd6276c181c82f2dad09f22d7d69a2758d9eb8649dbc8ed2ebe",
                "md5": "7c139a280e688c0fbdd593cc8e0416a5",
                "sha256": "892c437b4609db709bc83760f331177efaab732a9412090d2ff16c74a407ce41"
            },
            "downloads": -1,
            "filename": "ibex_1d-1.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c139a280e688c0fbdd593cc8e0416a5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 14665,
            "upload_time": "2023-02-01T13:50:11",
            "upload_time_iso_8601": "2023-02-01T13:50:11.656522Z",
            "url": "https://files.pythonhosted.org/packages/96/51/186c848a9dd6276c181c82f2dad09f22d7d69a2758d9eb8649dbc8ed2ebe/ibex_1d-1.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b15a5201e0acd2a356f1856361c76e20573c88e02ba438ea006196b7c30f0ea3",
                "md5": "9871c9014cf6369e138c88be2d856a55",
                "sha256": "e093f1b56a120e1db285be1dacf2dee4eea74ae997928410204f425a7e4046b9"
            },
            "downloads": -1,
            "filename": "ibex_1d-1.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "9871c9014cf6369e138c88be2d856a55",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14392,
            "upload_time": "2023-02-01T13:50:12",
            "upload_time_iso_8601": "2023-02-01T13:50:12.723676Z",
            "url": "https://files.pythonhosted.org/packages/b1/5a/5201e0acd2a356f1856361c76e20573c88e02ba438ea006196b7c30f0ea3/ibex_1d-1.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-01 13:50:12",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "ibex-1d"
}
        
Elapsed time: 0.08222s