Different histogram comparison methods can be used to calculate the distance between histograms. These are as follows:
- Intersection method:
In Python, this is expressed as follows:
minima = np.minimum(test_hist,train_hist)intersection = np.true_divide(np.sum(minima),np.sum(train_hist))
- Chi-Square method:
- Euclidean method:
- City Block method:
- Bhattacharya method:
- Wasserstein method:
- Given and , here, ...