Fix some issues from pyblur
Project description
Pyblur (Renamed as blurlab
)
IMPORTANT: The package now is renamed as blurlab
.
##Python image blurring routines.
Pyblur is a collection of simple image blurring routines.
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.
Functions receive a PIL image as input, and return another as output.
Kernel sizes can either be specified as input, or randomized.
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
Installation
From Pip: pip install blurlab
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}angle
Angle of the line of motion. Will be floored to the closest one available for the given kernel size.linetype = {left, right, full}
Controls whether the blur kernel will be applied in full or only the left/right halves of it.
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:
Convolutional Neural Networks for Direct Text Deblurring
blurred = PsfBlur(img, psfid)
Parameters
psfid
Id of the Point Spread Function to apply [0, 99]
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
File details
Details for the file blurlab-0.4.tar.gz
.
File metadata
- Download URL: blurlab-0.4.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/1.5.0 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0c92c49426112eeadda2487d5b5aabe507b842f610b1b1dc9d3f5222d0c22b4 |
|
MD5 | 2d6d98d92c258c8688f2650f015dd7b5 |
|
BLAKE2b-256 | 3f33a858f2ce4b84ff25cf6a8a017c4902c14463284c84ff2cfcd4f34a2f5b76 |