A tensor-based algorithm for high-order graph matching