Distance measurement with machine vision software