https://github.com/michalkielan/colorscope
Tool for debugging colors
https://github.com/michalkielan/colorscope
colorspace opencv opencv-python python
Last synced: 2 months ago
JSON representation
Tool for debugging colors
- Host: GitHub
- URL: https://github.com/michalkielan/colorscope
- Owner: michalkielan
- License: gpl-3.0
- Created: 2019-01-16T23:27:14.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-07T18:09:12.000Z (over 6 years ago)
- Last Synced: 2025-03-28T20:37:30.378Z (7 months ago)
- Topics: colorspace, opencv, opencv-python, python
- Language: Python
- Homepage:
- Size: 1.7 MB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ColorScope [](https://travis-ci.org/michalkielan/ColorScope) [](https://ci.appveyor.com/project/michalkielan/colorscope/branch/master) [](https://coveralls.io/github/michalkielan/ColorScope?branch=master)

Tool for analyze the image quality
## Requirements
* python-opencv
* matplotlib
* scikit-image```
$ sudo pip install opencv-python matplotlib scikit-image
```## Usage
Output format supported: `rgb`, `yuv`, `hsv`, `hls````
$ ./colorscope.py -i image.jpeg -out_fmt=rgb
R G B
23 24 232
255 255 255
...
```Raw input images
```
$ ./colorscope.py -i image.yuv -pix_fmt=nv21 -s 640x480 -out_fmt=rgb
```Measure and plot data
```
$ ./colorscope.py -i reference.jpeg -out_fmt=hls -o ref.json
$ ./colorscope.py -i capture.jpeg -out_fmt=hls -o cap.json
$ ./colorscope.py -gen ref.json cap.json
```# Quality metrics
Compare of two images quality using PSNR and SSIM metric for multichannel
```
$ ./colorscope.py -cp metrics reference_image_dir ref_pixel_format ref_video_size capture_image_dir cap_pixel_format cap_video_size
```
For non raw images video size and pixel format can be ommited
```
$ ./colorscope.py -scp 0 ssim reference.jpg capture.jpg
$ ./colorscope.py -scp 0 psnr reference.jpg capture.jpg
```Multichannel examples:
```
$ ./colorscope.py -cp ssim reference.yuv nv12 1920x1080 capture.yuv nv12 1920x1080
$ ./colorscope.py -cp ssim reference.jpg capture.jpg
$ ./colorscope.py -cp psnr reference.jpg capture.jpg
```Compare of two images quality using PSNR and SSIM metric for single channel
```
$ ./colorscope.py -scp metrics channel_number reference_image_dir ref__pxl_format ref_video_size capture_image_dir cap_pxl_format cap_video_size
```
Channel should be given accordingly to openCV color representation:
For BGR (typical way openCV stores RGB)
* blue 0
* green 1
* red 2For YUV:
* Y 0
* U 1
* V 2Single channel examples
```
$ ./colorscope.py -scp ssim 0 reference.yuv nv12 1920x1080 capture.yuv nv12 1920x1080
$ ./colorscope.py -scp psnr 2 reference.jpg capture.jpg
```