Size functions as complete invariants for image recognition