High resolution non-rigid dense matching based on optimized sampling