~~NOTOC~~ ====== Homework 06 - Panorama ====== In this homework, we will create a cylindrical image out of the set of images made by a camera while (approximately) preserving the camera projection center. This cylindrical image is also called panorama (originates from Greek, combining "pan" (πᾶν), meaning "all," and "horama" (ὅραμα), meaning "view" or "sight"). The mathematical description of panorama can be found {{courses:gvg:labs:panorama.pdf|here}}. ==== Input Images ==== Consider the images were captured with the following EXIF info (focal length is in milimeters): ^ Tag ^ Name ^ Value ^ | 0xa002 | ExifImageWidth | 2400 | | 0xa003 | ExifImageHeight | 1800 | | 0xa20e | FocalPlaneXResolution | 2160000/225 | | 0xa20f | FocalPlaneYResolution | 1611200/168 | | 0xa210 | FocalPlaneResolutionUnit | inch | | 0x920a | FocalLength | 7400/1000 | The images were then resized. | 07 | 06 | 05 | **04 - reference** | 03 | 02 | 01 | |{{http://cw.felk.cvut.cz/brute/data/ae/release/2020l_gvg/gvg_ae/data/bridge/bridge_07.jpg?direct&90|bridge_07.jpg}}|{{http://cw.felk.cvut.cz/brute/data/ae/release/2020l_gvg/gvg_ae/data/bridge/bridge_06.jpg?direct&90|bridge_06.jpg}}|{{http://cw.felk.cvut.cz/brute/data/ae/release/2020l_gvg/gvg_ae/data/bridge/bridge_05.jpg?direct&90|bridge_05.jpg}}| {{http://cw.felk.cvut.cz/brute/data/ae/release/2020l_gvg/gvg_ae/data/bridge/bridge_04.jpg?direct&90|bridge_04.jpg}} |{{http://cw.felk.cvut.cz/brute/data/ae/release/2020l_gvg/gvg_ae/data/bridge/bridge_03.jpg?direct&90|bridge_03.jpg}}|{{http://cw.felk.cvut.cz/brute/data/ae/release/2020l_gvg/gvg_ae/data/bridge/bridge_02.jpg?direct&90|bridge_02.jpg}}|{{http://cw.felk.cvut.cz/brute/data/ae/release/2020l_gvg/gvg_ae/data/bridge/bridge_01.jpg?direct&90|bridge_01.jpg}}| ==== Steps ==== - Download the images above. - Download point correspondences between every pair of adjacent images (10 matches each) from the upload system (InputData). The correspondences is stored in a single array (cell matrix in matlab), such that for image pair ''i-j'', the points in the image ''i'' are in ''U[i-1,j-1]'' (python) or ''U{i,j}'' (matlab) and in the image ''j'' are in ''U[j-1,i-1]'' or ''U{j,i}''. - Find homographies ''H_ij'' for every pair of adjacent images by the same method (optimizing 4 over 10) as in HW-05; use your ''u2h_optim'' function for each homography. - Draw graph of transfer errors, sorted from lower to higher, of all neighboring pairs into a single image. Use different colour for every image pair, export as ''06_errors.pdf''. - Compute homographies ''H_i4'' for every i ∈ <1,7> that maps the images above into the reference image 04 (thus ''H_44'' is identity). Also construct inverse homographies ''H_4i''. - Plot the image borders of the images 02 to 06 transformed by appropriate homography to the image plane of the image 04. Export as ''06_borders.pdf''. - Construct a projective panoramic image from the images 03, 04, and 05, in the image plane of the image 04. Save as ''06_panorama.png''. - Construct calibration matrix ''K'' using the actual image size and the original EXIF. All the images share the same calibration. Store it in ''06_data.mat'' - Establish a transformation between each image plane and the coordinate system of the cylinder. - Plot the image borders of all the images mapped onto the cylinder (''06_borders_c.pdf''). - Construct a panoramic image from all the images mapped onto the cylinder (''06_panorama_c.png''). ^ Example plot of errors ^ | {{courses:gvg:labs:06_errors.png|}} | ^ Example of image borders (origin not shifted) ^^ | {{courses:gvg:labs:06_borders.png|}} | {{courses:gvg:labs:06_borders_c.png|}} | ^ Example of projective panorama (images 3-4-5) ^ | {{courses:gvg:labs:07_panorama.jpg|}} | ^ Example of cylindrical panorama (all images) ^ | {{courses:gvg:labs:07_panorama_c.jpg|}} | ==== Upload ==== Upload an archive consisting of: - ''06_data.mat'' - ''06_histograms.pdf'' - ''06_borders.pdf'' - ''06_panorama.png'' - ''06_borders_c.pdf'' - ''06_panorama_c.png'' - ''hw06.m'' or ''hw06.py'' script solving the task, and any other files needed by the script