Skip to main content

Image blurring routines

Project description

#Pyblur ##Python image blurring routines. Pyblur is a collection of simple image blurring routines.<br> It supports Gaussian, Disk, Box, and Linear Motion Blur Kernels as well as the Point Spread Functions used in [Convolutional Neural Networks for Direct Text Deblurring](http://www.fit.vutbr.cz/~ihradis/CNN-Deblur/).<br> Functions receive a PIL image as input, and return another as output.<br> Kernel sizes can either be specified as input, or randomized.<br> Finally, there’s a RandomizedBlur function that applies a random type of blurring kernel with a random width/strength.

pypi: [https://pypi.python.org/pypi?:action=display&name=pyblur&version=0.2.3](https://pypi.python.org/pypi?:action=display&name=pyblur&version=0.2.3)

##Installation >From Pip: pip install pyblur`<br> Or alternatively `git clone this repo and run locally

##Usage

from pyblur import *

###Gaussian Blur Blurs image using a Gaussian Kernel

blurred = GaussianBlur(img, bandwidth)

Randomized kernel bandwidth (between 0.5 and 3.5)

blurred = GaussianBlur_random(img)

###Defocus (Disk) Blur Blurs image using a Disk Kernel

blurred = DefocusBlur(img, kernelsize)

Randomized kernel size (between 3 and 9)

blurred = DefocusBlur_random(img)

###Box Blur Blurs image using a Box Kernel

blurred = BoxBlur(img, kernelsize)

Randomized kernel size (between 3 and 9)

blurred = BoxBlur_random(img)

###Linear Motion Blur Blurs image using a Line Kernel

blurred = LinearMotionBlur(img, dim, angle, linetype)

####Parameters * dim Kernel Size: {3,5,7,9} <br> * angle Angle of the line of motion. Will be floored to the closest one available for the given kernel size. <br> * linetype = {left, right, full} Controls whether the blur kernel will be applied in full or only the left/right halves of it. <br>

Randomized kernel size, angle, and line type

blurred = LinearMotionBlur_random(img)

### PSF Blur Blurs image using one of the Point Spread Functions (Kernels) used in:<br> [Convolutional Neural Networks for Direct Text Deblurring](http://www.fit.vutbr.cz/~ihradis/CNN-Deblur/)

blurred = PsfBlur(img, psfid)

####Parameters * psfid Id of the Point Spread Function to apply [0, 99] <br>

Randomized kernel size, angle, and line type

blurred = PsfBlur_random(img)

###Random Blur Randomly applies one of the supported blur types, with a randomized bandwidth/strenght.

blurred = RandomizedBlur(img)

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

pyblur-0.2.3.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

pyblur-0.2.3-py2-none-any.whl (28.4 kB view details)

Uploaded Python 2

File details

Details for the file pyblur-0.2.3.tar.gz.

File metadata

  • Download URL: pyblur-0.2.3.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyblur-0.2.3.tar.gz
Algorithm Hash digest
SHA256 589675c062728222623d3be9b423608882753e95245db5f2926cb2656613793f
MD5 5f627dc979ac286aba709ea002f01bdc
BLAKE2b-256 07234e51d5c2c3150cbcf05635dd9c1a038b1730a2dfd6bd4a922dae2a7f3b20

See more details on using hashes here.

File details

Details for the file pyblur-0.2.3-py2-none-any.whl.

File metadata

File hashes

Hashes for pyblur-0.2.3-py2-none-any.whl
Algorithm Hash digest
SHA256 e5df746bb7acf7a6e15cfc4c655fb0a44a30bcf85117b0549fcfd83e8dd5bcd8
MD5 783382ca1f4ed17d44aba1f5107cee48
BLAKE2b-256 1c05df42ee5171512b659fbfe7b80f4fb3765c2b06616d6d2833fa7534093581

See more details on using hashes here.

Supported by

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