Shape recognition via Wasserstein distance