Shelf coordinates:

Extrinsic Transform:

R = \begin{bmatrix} 1 & 0 & 0\\ 0 & \cos{(\theta)} & \sin{(\theta)}\\ 0 & -\sin{(\theta)} & \cos{(\theta)} \end{bmatrix}
t = \begin{bmatrix} 0\\ - H_c \cos{(\theta)}\\ H_c \sin{(\theta)} \end{bmatrix}

For \(p = [x,y,z]\) we have on the camera coordinates:

Rp + t = \left[x, \cos{(\theta)} (y-H_c) + \sin{(\theta)} z, \sin{(\theta)} (H_c-y) + \cos{(\theta)} z \right]^T

Camera intrinsic parameters:

K = \begin{bmatrix} f_x & 0 & c_x\\ 0 & f_y & c_y\\ 0 & 0 & 1 \end{bmatrix}
  • \(f_x\) and \(f_y\) are focal length for each direction.
  • \((c_x, c_y)\) are the center of the image plane.

If \(p_c = Rp + t =: \left[ x_c, y_c, z_c \right]^T\) then the point in the image plane is:

u = \left[f_x \frac{x_c}{z_c} + c_x, f_y \frac{y_c}{z_c} + c_y\right]

Suppose \(p_{tf}\) and \(p_{bf}\) are the top and bottom points for the first row object.

  • They have the same \(x\) and \(z\) coordinates;
  • \(y_{bf} = 0, y_{tf} = H_o =\) "height of the object";
  • Call \(z = d = \) "distance between camera and the first object.

The distance on the \(y\) coordinate in the image plane is given by:

\Delta u_y = f_y \left( \frac{ d \sin{(\theta)} - \cos{(\theta)}(H_c - H_o) }{ d\cos{(\theta)} + \sin{(\theta)}(H_c - H_o)} - \frac{ d \sin{(\theta)} - \cos{(\theta)}H_c }{ d\cos{(\theta)} + \sin{(\theta)}H_c} \right)
= \frac{f_y H_o d}{\sin{(\theta)}^2 H_c (H_c- H_o) + \sin{(\theta)}\cos{(\theta)}d(2H_c - H_o) + \cos{(\theta)}^2 d^2}

Case 1: first row

 

Suppose \(p_{f}\) and \(p_{b}\) are the front and back points for the last row object.

  • They have the same \(x\) and \(y\) coordinates;
  • \(y_{b} = y_{f} = H_o =\) "height of the object";
  • Call \(z_f = D \) "distance between camera and the last object, and \(z_b = D + W_o \) (from width).

The distance on the \(y\) coordinate in the image plane is given by:

\Delta u_y = f_y \left( \frac{ (D+W_o) \sin{(\theta)} - \cos{(\theta)}(H_c - H_o) }{ (D+W_o)\cos{(\theta)} + \sin{(\theta)}(H_c - H_o)} - \frac{ D \sin{(\theta)} - \cos{(\theta)}(H_c - H_o) }{ D\cos{(\theta)} + \sin{(\theta)}(H_c - H_o)} \right)
= \frac{f_y (H_c - H_o) W_o}{\sin{(\theta)}^2 (H_c- H_o)^2 + \sin{(\theta)}\cos{(\theta)}(2D+W_o)(H_c - H_o) + \cos{(\theta)}^2 D(D+W_o)}

Case 2: last row (no inclination)