# Introduction

From [Rubner (2000)][2], we know that EMD is a good way to compare 2 images :
> Comparisons with other dissimilarity measures show that the EMD matches perceptual dissimilarity better.

In [Datta (2006)][1] they consider a "perfectly colored" image, where each part of the RGB space is uniformly used.
They they use EMD to compare any image's color distribution with this "perfect" (or uniform) distribution.

This is what they called the colorfulness measure. This measure tells you how "colored" is an image.

Today i want to implement it in JS, using node-opencv.

# Prerequisites

You will need to make node-opencv work on your local machine, so havind, opencv, node, npm.

## Histograms calculation

[1] http://infolab.stanford.edu/~wangz/project/imsearch/Aesthetics/ECCV06/datta.pdf
[2] https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/rubner-jcviu-00.pdf
