GithubHelp home page GithubHelp logo

cteckwee / defocus_segmentation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xinario/defocus_segmentation

0.0 0.0 0.0 2.17 MB

LBP-based segmentation of defocus blur

MATLAB 54.01% C 26.74% C++ 11.36% Python 7.90%

defocus_segmentation's Introduction


LBP-Based Segmentation of Defocus Blur

Update2:

Add a python implementation to compute the sharpness metric.

Update1:

The blur maps for the 1000 images in the blur segmentation dataset produced by our algorithm can be found here for easy comparison.

This repo provides the code to reproduce our defocus segmentaion results in our paper.

How to use

Prerequistites

  • Matlab 2016a

If you want to try out the python script, you need

  • Python 3
  • Opencv 3 (pip install opencv-python)

Getting Started

  • Clone this repo:
git clone [email protected]:xinario/defocus_segmentation.git
  • In Matlab, change your project directiory to <your download path>/defocus_segmentation then run demo.m

  • Note that matlab implementation was used by default to compute the proposed sharpness metric. But you can also switch to .mex code to gain some speed boost. The sharpness metric implementation in .mex code was based on integral image and can run in real time on a single core cpu.

Compute the LBP-based sharpness measure using the mex version.

1. Install [mexopencv](https://github.com/kyamagu/mexopencv)

2. Copy lbpSharpness.cpp to <your mexopencv folder>/src/+cv 

3. Run mexopencv.make() in Matlab command line to compile the provided function.

4. Comment out line 14 and uncomment line 18, 19 in localSharpScoreLBP.m, then you are good to go.

All the results reported in the paper were produced by the mex verison of LBP-based sharpness.
  • To use python script
python lbpSharpness.py --input ./images/out_of_focus0080.JPG

Citations

If you find it useful and are using the code/model/dataset provided here in a publication, please cite our paper:

Yi, Xin, and Mark Eramian. "LBP-based segmentation of defocus blur." IEEE transactions on image processing 25.4 (2016): 1626-1638.

Acknowlegements

The alpha matting code comes from Levin, 2006:

A. Levin D. Lischinski and Y. Weiss. A Closed Form Solution to Natural Image Matting. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), June 2006, New York.

The multi-scale inference code was adopted form Jianping Shi, 2014:

Jianping Shi, Li Xu, Jiaya Jia. Discriminative Blur Detection Features. IEEE Conference on Computer Vision and Pattern Recognition, 2014.

defocus_segmentation's People

Contributors

xinario avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.