Home

Awesome

This software package detects shadows from single images by using an approach described in the following paper:

J.-F. Lalonde, A. A. Efros, and S. G. Narasimhan, "Detecting ground shadows in outdoor consumer photographs," presented at the European Conference on Computer Vision, 2010.

Please cite this paper if you use this code in your work.

Getting started

  1. Install the required packages (see below), and compile them;

  2. From the mycode directory, run:

    $ setPath
    $ demoShadowDetection
    
  3. The results should appear as they are computed. Enjoy!

Changing the input image

If you want to make it work on your own image, here's what you should do:

  1. Copy your image in the img directory (should have .jpg extension);

  2. Change the imgName variable with the new filename (leave the .jpg extension out);

  3. If you want to detect shadows on the ground only:

    3.1 Compute the ground probability map (e.g. with Geometric Context, see below); 3.2 Save the ground probability map as variable groundProb in a .mat file; 3.1 Copy the .mat file containing the variable groundProb in the img directory; 3.2 Rename the file to <image name as in step 2>-groundProb.mat.

  4. Watch the output while the program is running to make sure there are no errors or warnings;

  5. That's it!

Requirements

Required 3rd-party software not included in this package

If you put these 3rd-party packages in a pathUtils folder in the same base folder as the shadowDetection, they should be picked up automatically by setPath.

Make sure you follow the respective instructions to install those packages.

Required 3rd-party software included in this package

In addition, this code uses the following freely-available matlab code:

Compilation

Check within each of the following directories and make sure you compile the .mex files. They are required for this software to run:

Optional 3rd-party software not included in this package

Tuning the parameters

There are a few parameters you might want to fiddle with in order to tune the results to your liking.

News