Skip to main content

Python package to remove spike in 2D images

Project description

Build Coverage PyPI Status Version Python License

Python package to remove spikes in 2D images

Desciption

The spikes in 2D-images correspond to high-energy pixels generated by cosmic rays, sensor noise or dead pixels. They use to have values very different from the rest of their neighboor.

To find them, we use a moving box (5×5 pixels by default) on the image and we compare the mean/median of this sub-image to the central pixel. If the value is n (3 by default) times larger than the observed standard deviation we use the median value a the surrounding pixels (8 pixels by default) to replace the spike.

Install

With pip:

$ pip install despike

With the source files:

$ git clone https://github.com/seignovert/despike.git
$ cd despike ; python setup.py install

Usage

>>> import despike

>>> despike.spikes(img) # Search the location of spikes in the image

>>> despike.clean(img) # Clean the image from spikes

An example can be find in this Jupyter NoteBook.

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

despike-0.1.0.tar.gz (158.0 kB view details)

Uploaded Source

Built Distribution

despike-0.1.0-py2.py3-none-any.whl (4.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file despike-0.1.0.tar.gz.

File metadata

  • Download URL: despike-0.1.0.tar.gz
  • Upload date:
  • Size: 158.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for despike-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9494cabb363a56079cb165334f4ac58c882dea3390a92ed5fed65324c81a0411
MD5 3f6cdbf08cd19d8b3104f28aa1e74098
BLAKE2b-256 5428766de846bf9e6439a89fd92315a3ae6daa6a44a805c934e8a9f2d22780c6

See more details on using hashes here.

File details

Details for the file despike-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for despike-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4af58ce95b86ce9d04538d5b47300897204f77eb0071b2962ff30e8b3ffa563b
MD5 3588e886f4991b6b295af92f3bfa0afc
BLAKE2b-256 5575ba6e0f05487970068be3ec018f12eeafd13d381ee462048db0460cadcc63

See more details on using hashes here.

Supported by

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