A fast and accurate approach for computing the dimensions of boxes from single perspective images