• Stars
    star
    127
  • Rank 281,179 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python-Based Blur Detector using Fast Fourier Transforms

BlurDetection

Blur Detection using Fast Fourier Transforms. A Fast Fourier Transform is applied to the image using the default numpy functions, once this is done the mean value in the transformed image is taken, this is then scaled with respect to the size of the image to compensate for the rippiling effect. This value is then used to threshold the image with larger values being indicative of an in focus image while lower values of blurred images. This algorithm is also capable of generating masks of blurred images within the reason by using SLIC segmentation or the far faster img_fft thresholding and dialation operations. The second method mentioned is now default and can conduct blur detection in real time.

Quick Start

Getting the app to run is pretty easy. This script will not install OpenCV. However to install the rest of the project dependencies and run the demo script use the following commands.

# Clone the repo
git clone https://github.com/WillBrennan/BlurDetection && cd BlurDetection
# Install requirements
sudo pip install numpy scikit-image
# Run the Demonstration
python main.py <image_directory> --display --mask

Usage

Usage of this as a submodule is simple, just clone into your projects directory (or preferably add as a git submodule), and your ready to go. Below is an example code usage. Under some circumstances manual tuning of the threshold value may be required to achieve good results.

import os
import cv2
import numpy
import BlurDetection

img_path = raw_input("Please Enter Image Path: ")
assert os.path.exists(img_path), "img_path does not exists"
img = cv2.imread(img_path)
img_fft, val, blurry = BlurDetection.blur_detector(img)
print "this image {0} blurry".format(["isn't", "is"][blurry])
msk, val = BlurDetection.blur_mask(img)
BlurDetection.scripts.display('img', img)
BlurDetection.scripts.display('msk', msk)
cv2.waitKey(0)

References

Image Partial Blur Detection and Classification

Demonstration

Blur Mask Demo

More Repositories

1

exposure_correction

Implements the exposure correction algorithms presented in Yuan et al's "Automatic Exposure Correction of Consumer Photographs".
Python
35
star
2

image-quality-assessment

MATLAB
12
star
3

Midway-Image-Equalization

C++
4
star
4

MSR_original

Retinex-IPOL
C
3
star
5

ColorConstancy

ColorConstancy matlab
MATLAB
2
star
6

Gaussian

ι«˜ζ–―ζ¨‘η³Šε‚θ€ƒοΌˆη½‘δΈŠθ΅„ζΊοΌ‰
C++
2
star
7

Texture-Features-Based-Image-Retrieval-in-DWT-Domain

we have presented a Content Based Image Retrieval (CBIR) scheme using color, texture and shape feature information. Firstly an input RGB image is converted into YCbCr image and each part of the i.e. Y, Cb and Cr are extracted from it. Afterword, each components are uniformly quantized. Then BDIP and BVLC are computed over quantized Y-component on block size of 2Γ—2 and receive respective BDIP and BVLC image. Then on these two received image 3-level dwt is implemented and on each sub band some statistical parameters are evaluated to form a part of a feature vector. Now, on extracted quantized Cb and Cr components, 2-level dwt is performed and on each sub band some statistical parameters are calculated and this form second part of the feature vector. Now both parts are concatenated to form final feature vector. To proof that our system is adequate to retrieve good results, we have tested our scheme on benchmark database Coral-1000 . Same processed has been taken place for all the images present in the database and on the basis of the similarity measurement Top-20 results are retrieved and stored and the results are quite satisfying.
MATLAB
2
star
8

-color_histogram

MATLAB
1
star
9

imagequality

MATLAB
1
star
10

ImageQualityDetection

C++
1
star
11

image-contrast-enhancement

In this project we applied algorithms to improve image contrast using MATLAB.
MATLAB
1
star
12

gimp_retinex

C
1
star
13

RetinexCPP

C++
1
star