cpbd

Calculate the sharpness of an image with the CPBD metric


Keywords
sharpness, metric, blur, cumulative, probability, no-reference, objective, perceptual, blur-detection, cumulative-probability, image-quality
Licenses
GPL-3.0+/OML
Install
pip install cpbd==1.0.7

Documentation

About

CPBD is a perceptual-based no-reference objective image sharpness metric based on the cumulative probability of blur detection developed at the Image, Video and Usability Laboratory of Arizona State University.

[The metric] is based on the study of human blur perception for varying contrast values. The metric utilizes a probabilistic model to estimate the probability of detecting blur at each edge in the image, and then the information is pooled by computing the cumulative probability of blur detection (CPBD).

This software is a Python port of the reference MATLAB implementation. To approximate the behaviour of MATLAB's proprietary implementation of the Sobel operator, it uses an implementation inspired by GNU Octave.

References

CPBD is described in detail in the following papers:

Installation

$ pip install -r requirements.txt

Usage

In [1]: import cpbd

In [2]: from scipy import ndimage

In [3]: input_image = ndimage.imread('/tmp/LIVE_Images_GBlur/img4.bmp', mode='L')

In [4]: cpbd.compute(input_image)
Out[4]: 0.75343203230148048

Performance

The following graph visualizes the accuracy of this port in comparison with the reference implementation when tested on the images of the LIVE database:

Performance on LIVE database