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

Uploaded Python 3

File details

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

File metadata

  • Download URL: grayness-index-python-0.0.2.tar.gz
  • Upload date:
  • Size: 15.4 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.2.tar.gz
Algorithm Hash digest
SHA256 2b04a80b28ec25b68d580db47ded4b582a63ad67c077cee05a67477e767cb502
MD5 1a46b5839bdb240f21e4692893f53136
BLAKE2b-256 b80c15d469a3b156034f213f5ccc91eb046dd111cb1f4a383edfc40799e72518

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grayness_index_python-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 042d7342bd5e5ddf0acd21f44f46ac4a0b53b0cca1075f1bbd28913e52f6fa86
MD5 b5ca31af27f2a6dce89ce69b61a15e24
BLAKE2b-256 6dad7dc7cd413e128828d696d5edc0dcfc73c8bfd627c4753e01c52e9adac735

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