To the $2$D vectors $h, w, d$,

we want to add components $H, W, D$ normal to the image plane such that the sums are orthogonal in $3$D:
$$ 0=h\cdot d + HD = h\cdot w + HW = w\cdot d + WD$$
where $h\cdot d,\, h\cdot w$ and $w\cdot d$ are $2$D inner products. Then
$$ W^2 = -\frac{w\cdot d \quad h\cdot w}{d\cdot h}$$ $$H^2 = -\frac{h\cdot d \quad h\cdot w}{w\cdot d}$$
$$D^2 = -\frac{w\cdot d \quad h\cdot d}{w\cdot h}$$
The aspect ratio is
$$\frac{\sqrt {W^2 + \lVert w\lVert ^2}}{\sqrt {H^2 + \lVert h\lVert ^2}}$$
The above assumes that the $3$D sign is projected normally onto the image, but the camera is close so there is some perspective. I think you would get a better approximation by taking $w$ to be the average of the top and bottom edge vectors, etc.