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.5.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

grayness_index_python-0.0.5-py2.py3-none-any.whl (14.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file grayness_index_python-0.0.5.tar.gz.

File metadata

  • Download URL: grayness_index_python-0.0.5.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.6

File hashes

Hashes for grayness_index_python-0.0.5.tar.gz
Algorithm Hash digest
SHA256 1b4fa1731d33b6bb551732f0d7f08197f0fd7480f8f0bc7461b9da0d76e0b16a
MD5 8930cdc2b69a722642ec44e734bbf1d7
BLAKE2b-256 bafcf952765b83b95d8c9c0c45a280328431dd57ebfba275867b7efb8ab737af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grayness_index_python-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 da27b1699a25c7b7397f2ce309bf22db8bce83ce22f5208ca0311ecc33f5f449
MD5 cec42317854b55b18d0c6a9b8a3b6df3
BLAKE2b-256 17adbb97ff63504b71ba283b1f3d585668756d249f29c8ed7a26198ed04feba6

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