Skip to main content

Python package for Grayness Index

Project description

Grayness Index

Unofficial Python implementation of the paper named "On Finding Gray Pixels".

Disclaimer:

You may copy, distribute and modify the software provided that modifications are described and licensed for free under LGPL. Derivatives works (including modifications or anything statically linked to the library) can only be redistributed under LGPL, but applications that use the library don't have to be.

Installation

pip install grayness-index-python

Basic Usage

import numpy as np
import math
from scipy.io import loadmat

from grayness_index import GraynessIndex

gi = GraynessIndex()
mat = loadmat("imgs/exampleimg.mat")
gt = mat["gt"]
input_im = mat["input_im"]  # np.ndarray with shape H x W x 3.
pred_illum = gi.apply(input_im)
error = np.arccos(pred_illum @ gt.transpose()) * 180 / math.pi
log.info(f"Error: {error}")

References

Official MatLab Code

To cite the original paper:

@inproceedings{qian2019cvpr,
  title={On Finding Gray Pixels},
  author={Qian, Yanlin and K{\"a}m{\"a}r{\"a}inen, Joni-Kristian and Nikkanen, Jarno and Matas, Jiri},
  booktitle={IEEE International Conference of Computer Vision and Pattern Recognition},
  year={2019}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grayness-index-python-0.0.3.tar.gz (17.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

grayness_index_python-0.0.3-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

grayness_index_python-0.0.3-py2.py3-none-any.whl (17.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file grayness-index-python-0.0.3.tar.gz.

File metadata

  • Download URL: grayness-index-python-0.0.3.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.6

File hashes

Hashes for grayness-index-python-0.0.3.tar.gz
Algorithm Hash digest
SHA256 87d8cac2eeb2acf0a3876a08dcc063084cd9a4d8826acc1ffea6d6d3c4fcc52b
MD5 69c04dd6907009b858d3d79ae47719a9
BLAKE2b-256 f67d87c247e22a4348912dcbfaa8d17652511a86c81626b421301c429a128019

See more details on using hashes here.

File details

Details for the file grayness_index_python-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for grayness_index_python-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4a31a5bf20d841d9a2b6f8753a8151090e459c27a7046f207ba3e967e75f3792
MD5 3a6669baa49d829b9f1f6dc4030915db
BLAKE2b-256 12868cf779ffe2b6387631d9126d37868b10e7ec5d3635bb3757c045acea8ec9

See more details on using hashes here.

File details

Details for the file grayness_index_python-0.0.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for grayness_index_python-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ba77f79a737c2336f7e7b99b5248c4f5d73db756d9ae39793123146a143ec493
MD5 68f9928e993847181cbffe606fec3d5e
BLAKE2b-256 2ba607e85a9e5eb61785c4f4d8953eb6c6f7296bca4a5c923d46dd502b89504d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page