u1
in the first image and u2
in the second. The corners should also correspond between the images (this is not used for calibration but later).
vp1
and vp2
(four points each) for the first and the second image, respectively.
07_vp1.pdf
and 07_vp2.pdf
. Then show each figure zoomed such that the image is clearly visible and export as 07_vp1_zoom.pdf
, 07_vp2_zoom.pdf
.
K
from three vanishing points. From the four available v.p. pairs (two in each image), select three pairs.
angle
(should be acute) between the square and the rectangle (the mean value of four computed angles).
K
to compute thee pose of calibrated camera w.r.t. the black square using P3P. Compute camera centers C1
, C2
, and rotations R1
, R2
(both images). Chose one corner of the square as origin and consider the square sides having the unit length.
07_box_wire1.pdf
, 07_box_wire2.pdf
.
07_box_wire3.pdf
and whole sequence as 07_seq_wire.avi
.
07_box_tx.png
(imwrite, not pdf) and the sequence as 07_seq_tx.avi
.
u1
, u2
, vp1
, vp2
, K
, angle
, C1
, C2
, R1
, R2
into 07_data.mat
. All points are euclidean column vectors, the (acute) angle is in radians, and K(3,3)=1
.
Let <latex>R_1</latex>, <latex>C_1</latex> is the first camera pose and <latex>R_2</latex>, <latex>C_2</latex> is the second camera pose. Let <latex>\lambda</latex> be the interpolation parameter taking value from 0 (meaning the first camera) to 1 (meaning the second camera). Then use following
<latex> C = (1-\lambda) C_1 + \lambda C_2 </latex>
<latex> R = (R_2 R_1^\top)^\lambda R_1 </latex>
Note that we are using matrix power here. Due to numeric accuracy, it is necessary to take only the real part of the result computed in matlab.
Homography from the cube face, projected in the image, to the texture image must be established. The problem concerning if the pixels are inside or outside the face is easily solved in the coordinate system of the texture.
Also visibility must be solved here. The easiest way is to consider each face's normal vector, computed from the sides using the vector product (take care with the sign). Also the direction vector from the camera to some point of the face must be computed. The the face is visible only if the normal vector form an acute angle with the direction vector, i.e. it's cosine (i.e. it's dot product) is positive.
See the help section. If able, please try to compress your sequence by some 'normal' codec (divx, xvid, …) after creating the raw avi from matlab.
Upload an archive consisting of:
07_vp1.pdf
, 07_vp2.pdf
, 07_vp1_zoom.pdf
, 07_vp2_zoom.pdf
07_data.mat
07_box_wire1.pdf
, 07_box_wire2.pdf
, 07_box_wire3.pdf
07_seq_wire.avi
07_box_tx.png
, 07_seq_tx.avi
hw07.m
– your Matlab implementation entry point
any other files required by hw07.m (including data and files from the repository).