Take account of multi-channel matrices when comparing histograms

Ensure that all channels are considered when comparing multi-channel histograms