Ground-truth evaluation results
===============================

This directory contains synthetic images which we decomposited using our approach,
to compare the results against the original ground-truth layers. Each image has a
a two-color gradient as background and a circle with a random semi-transparent
gradient as foreground.

We considered the following 12 cases:
  [2 stops, 3 stops] x [linear, radial] x [general, constant, white]

Here, 'general' means that the gradient is completely random: all colors, opacities
and offsets are random for all stops of the gradient (though the first and last stops
are fixed at 0 and 1, respectively); 'constant' fixes the color of all stops, but
still maintains with random opacities and stop positions; 'white' fixes the constant
color to white. We apply these constraints when generating the images and also when
decompositing them.


RESULTS

For each of the 12 cases, we generated 20 images and decomposited them.
You can find the individual results in sub-directories of this directory,
and they are summarized as HTML tables in this directory.

Not that our assumptions (see Section 4.1 and 'Limitations' in Section 5) are often
satisfied for two-stop linear gradients, but failure cases are more frequent for radial
and multi-stop gradients as more iso-contours are susceptible to be missed.


STATISTICS

In addition, we computed some statistics for each case, which are included as CSV files.
We computed the columns as follows:

  image RMSE      - we compared the input image to the fitted foreground composited over the estimated background
  fitting energy  - the energy of Equation 8 divided by the number of pixels along the boundary
  background RMSE - ground-truth background compared to the estimated background
  foreground RMSE - ground-truth foreground compared to the estimated foreground
  
We implemented RMSE as follows (using NumPy):
  np.sqrt(np.mean(np.power(a.astype(np.float64) - b.astype(np.float64), 2)))

Each CSV file further contains four rows at the bottom with minimum, mean, maximum and
standard deviation across all columns. These rows can be used to easily find the best
and worst examples, and to to gauge the robustness of approach for each case.


FILES

For each example, we include the following files:

  [ inputs ]
  ..._input.png           - input image
  ..._mask.bmp            - input mask 
  ..._mask-vectorized.svg - vectorized mask using Potrace (automatically generated from mask.bmp)

  [ ground truth ]
  ..._BG-GT.png           - ground-truth background layer
  ..._FG-GT.png           - ground-truth foreground layer
  ..._gradient-GT.txt     - text-based definition of foreground gradient

  [ our results ]
  ..._BG-fitted.png       - estimated background layer using our approach
  ..._FG-fitted.png       - estimated foreground layer using our approach
  ..._gradient-fitted.txt - ... the same in text-based format
  ..._FG-fitted.svg       - ... and inserted into the mask SVG above (final vector layer)
