Starting from:

$35

Project #2 Image Panoramas


CSE 473/573 - Computer Vision and Image Processing

Project #2

1 Image Panoramas (100pts + 15pt Bonus)
The goal of this task is to experiment with image stitching methods. Given a set of photos, your
program should be able to stitch them into a panoramic photo (as shown in Figure 1). There are
no restrictions regarding the method you use to stitch photos into a panoramic photo.
For this project, you can assume the following:
• Your code will need to be able to stitch together anywhere from 2-5 image and you will not
know that in advance.
• You can assume that IF an image is to be part of the panorama, it will overlap at least one
other image and by at least 20%.
• Images that do not overlap with any other image can be ignored.
• Images will overlap with at most one other image.
• You are only expected to produce one panorama. For example, if images 1 and 2 overlap, and
3 and 4 overlap, but there is not overlap between 1,2 and 3,4 producing either composite/-
panorama is fine.
Please keep in mind:
• You will have to determine the spatial arrangement of the images automatically, they can be
presented to your code in any order.
• Although the Figure below shows horizontal panoramas, you five images can be stitched
together in any way.
• While some of the most modern techniques may use a spherical projection for better panoramas, you are free to assume that basic 2D Planer transformations are sufficient for this project.
1
CSE 473/573 Project #2 4 Mar. 2020
Bonus - UB 360◦ Panoramas
To get the 15 bonus points, you can take up to 9 photos that can be stitched together to form a
360◦ horizontal panorama such as the one in Figure 2. The images you take should demonstrate
something of value to you about UB life. This could be at an event, something on campus, a road
trip, etc, but have something UB related in the scene. You must then take your program and stitch
them into a panoramic photo. The overlapped region between any 2 of the photos you take should
not exceed 50%. See below for an example of the 360 degree panoramas stitching.
Page 2 of 4
CSE 473/573 Project #2 4 Mar. 2020
Finally, we will print/submit the best ones for display in the department and/or website.
2 Submission Guidelines
You should follow the following guidelines:
• The code and photos are stored in a single file whose extension is “zip”.
• The code you provide should be stored in a folder named “src”
• The photos you take for the bonus should be stored in a directory “ubdata”
• The photos you take for the bonus named “ub*.jpg”. where * is a single digit 1-9 (the images
can be stored in any order).
• After changing the working directory into the folder that contains your code, the grader should
able to run your program to stitch the photos in either of the datasets using the command
“python stitch.py [data directory]”.
• The program should read ALL jpg files in the data directory and stitch them together.
• The panoramic photo your program creates should be saved to the same directory as the data
and be called “panorama.jpg”
3 Software Restrictions
• Any Python Standard Library could be used.
• Any API provided by Numpy or Scipy could be used.
• Any API provided by OpenCV could be used, except “cv2.findHomography()” and APIs that
have “stitch”, “Stitch”, “match” or “Match” in their names or functionality, e.g., “cv2.BFMatcher()”
and “cv2.Stitcher.create()”.
• If you decide to use SIFT, please note it has been patented and it has been removed from
OpenCV3, but it is included in OpenCV2.
• This should be obvious, but you may NOT copy or plagiarize code from online discussion
boards, websites, archives, etc for processing your images.
4 Hints for installing openCV
4.1 OpenCV SIFT Link
You might find the following link helpful if you plan to use SIFT feature from OpenCV API.
https://docs.opencv.org/3.4.2/d5/d3c/classcv_1_1xfeatures2d_1_1SIFT.html
Page 3 of 4
CSE 473/573 Project #2 4 Mar. 2020
4.2 Installation
The latest version of OpenCV no longer include this API in its standard package and fees might
apply if you want to use it. The older version OpenCV still includes it. Below is few steps that can
help you get the older compatible version.
• Remove installed opencv (Skip this step if you don’t have it installed)
$ pip u n i n s t a l l opencv−python
• Install opencv 3.4.2.17
$ pip i n s t a l l opencv−python ==3.4.2.17
• Install opencv contribution library 3.4.2.17
$ pip i n s t a l l opencv−co n t ri b−python ==3.4.2.17
OpenCV(3.4.2.17) has been tested and it does provide fully functional API like
cv2 . xf e a t u r e s 2 d . S IFT c r ea t e ( )
Note: You may need administrative privilege to execute the installation on your machine.
5 Submission Instructions
Submit must online to UBLearns (ublearns.buffalo.edu) AND Autograder (autograder.cse.buffalo.edu)
Page 4 of 4

More products