Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/waikato-datamining/simple-image-debayer
Simple image debayering with OpenCV.
https://github.com/waikato-datamining/simple-image-debayer
debayering image-debayering image-processing opencv python3
Last synced: 23 days ago
JSON representation
Simple image debayering with OpenCV.
- Host: GitHub
- URL: https://github.com/waikato-datamining/simple-image-debayer
- Owner: waikato-datamining
- License: mit
- Created: 2020-05-24T22:26:38.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-04-22T04:54:14.000Z (8 months ago)
- Last Synced: 2024-11-29T18:24:52.524Z (27 days ago)
- Topics: debayering, image-debayering, image-processing, opencv, python3
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 5
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
# simple-image-debayer
Simple library for debayering images with OpenCV.See the Wikipedia article on the [Bayer filter](https://en.wikipedia.org/wiki/Bayer_filter)
for more information.## Installation
```commandline
pip install simple-image-debayer
```## Usage
### Command-line
You can use the `sid-debayer` command-line tool for debayering directories:
```
usage: sid-debayer [-h] -i DIR [-I EXT] [-r] [-o DIR] [-O EXT] [-c PROFILE]
[-p NUM] [-e] [-d] [-v] [-n]Debayers images in a directory.
optional arguments:
-h, --help show this help message and exit
-i DIR, --input_dir DIR
the directory to process (default: None)
-I EXT, --input_ext EXT
the extension to look for in the input directory
(default: bmp)
-r, --recursive whether to look for images recursively (default:
False)
-o DIR, --output_dir DIR
the directory to store the debayered images in;
performs in-place debayering if not specified
(default: None)
-O EXT, --output_ext EXT
the extension to use for the generated images
(default: jpg)
-c PROFILE, --color_profile PROFILE
the OpenCV color profile to use for debayering
(cv2.COLOR_BAYER_*) (default: COLOR_BAYER_BG2BGR)
-p NUM, --progress_interval NUM
the interval of processed images to output progress
information in the console (default: 100)
-e, --ignore_errors whether to ignore any errors and keep debayering
(default: False)
-d, --delete whether to delete the input file after successfully
debayering it (default: False)
-v, --verbose whether to output directories being processed
(default: False)
-n, --dry_run whether to perform a dry-run; --verbose should be used
in conjunction with this flag (default: False)
```### Python
Of course, the tool can be used as a Python library as well.
The module `sid.debayer` contains the following methods among others:
* `debayer_dir` - for debayering a directory (that is the main routine)
* `debayer_file` - for debayering a single file
* `debayer_image` - for debayering an in-memory image (in/out: `ndarray`)
* `read_image` - reads a bayered image into memory (out: `ndarray`)
* `write_image` - writes a debayered image to disk (in: `ndarray`)
* `eval_color_profile` - turns the color profile string (e.g., `COLOR_BAYER_BG2BGR`) into an integer constant
(e.g., `cv2.COLOR_BAYER_BG2BGR`)