Convert a input image to histogram, then match it to precomputed histograms.