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.1.tar.gz (15.3 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.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grayness-index-python-0.0.1.tar.gz
  • Upload date:
  • Size: 15.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.1.tar.gz
Algorithm Hash digest
SHA256 63f136991719bdde323efaa364249667d32a6764bbe30adf7570a0fccbbf59d8
MD5 bb5ca5ed51b787cf2e4de72fdba73ddc
BLAKE2b-256 0fbf79d0f2cdaf9057ab54a53385cc1c828278a22987aeb41385b2312afd6a02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grayness_index_python-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 08182789f5e96946da94a39dad821116f5f02cfe045fd8258c619607796426a1
MD5 42b0ac22ba46de013d612c7d037fa373
BLAKE2b-256 edbb8bac2c24c28c2b021e247b99ac0ec7ec84a65d45abc298f18874c5b8f9b4

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