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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

grayness_index_python-0.0.4-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.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for grayness_index_python-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fdf8fe5e145bebde41685ea4b04e9a221b9749f9ed9e9dc473ebfe788c77e243
MD5 ff97d19444936027cae37b22cc251d1c
BLAKE2b-256 a4cf5df72819f2259dd6de5bd0af6378a58820771edc70fc3ad1401cad45eb74

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