Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
105 lines (88 sloc) 3.36 KB

Open Computer Vision

This MLHub package provides a quick introduction to the functionalities of the Open Computer Vision toolkit.

Currently it only demonstrates the measuring of blurriness of images through the blurry command.

Visit the github repository for more details:


  • To install mlhub (Ubuntu 18.04 LTS)
$ pip3 install mlhub
  • To install and configure the demo:
$ ml install gjwgit/opencv
$ ml configure opencv

Determine an Image's Blurriness

The variance of the Laplacian approach to calculating a measure of blurriness convolves the input image with the Laplacian operator and computes the variance 😄. The default threshold for blurriness is 100 so that any image with a measure less than 100 is regarded as blurry. The larger the measure the sharper the image.

For reference see

Assess the blurriness of a folder of images:

$ for f in *.{png,jpg}; do echo -n "$f "; ml blurry opencv $f; done
street_img1.png Okay 610
street_img2.png Okay 481
street_img3.jpg Blurry 64
street_img4.jpg Okay 903
street_img5.jpg Blurry 91
street_img6.jpg Blurry 71
street_img7.jpg Blurry 75
street_img8.jpg Blurry 60
street_img9.jpg Blurry 93

Some specific examples:

$ ml blurry opencv
Okay 5670

$ ml blurry opencv
Okay 1303

$ ml blurry opencv
Okay 951

$ ml blurry opencv
Okay 374

$ ml blurry opencv
Okay 170

$ ml blurry opencv
Okay 167

$ ml blurry opencv
Blurry 68

$ ml blurry opencv
Blurry 43

The algorithm is not perfect, or is it just the choice of the threshold. Perhaps 150 is a better threshold?

$ ml blurry opencv
Okay 119
You can’t perform that action at this time.