Assignment 2 Creating Panoramas.

Slides:



Advertisements
Similar presentations
Summary of Friday A homography transforms one 3d plane to another 3d plane, under perspective projections. Those planes can be camera imaging planes or.
Advertisements

Interest points CSE P 576 Ali Farhadi Many slides from Steve Seitz, Larry Zitnick.
Mosaics con’t CSE 455, Winter 2010 February 10, 2010.
Announcements Project 2 Out today Sign up for a panorama kit ASAP! –best slots (weekend) go quickly...
Recognising Panoramas
SIFT on GPU ( the slides are not updated for newer versions of SiftGPU ) Changchang Wu 5/8/2007.
Feature extraction: Corners and blobs
Fitting a Model to Data Reading: 15.1,
Automatic Image Alignment (feature-based) : Computational Photography Alexei Efros, CMU, Fall 2006 with a lot of slides stolen from Steve Seitz and.
Image Stitching II Ali Farhadi CSE 455
CS4670: Computer Vision Kavita Bala Lecture 7: Harris Corner Detection.
Feature Matching and RANSAC : Computational Photography Alexei Efros, CMU, Fall 2005 with a lot of slides stolen from Steve Seitz and Rick Szeliski.
Robust fitting Prof. Noah Snavely CS1114
Harris detector Convert image to greyscale Apply Gaussian convolution to blur the image and remove noise Calculate gradient of image in x and y direction.
Mosaics Today’s Readings Szeliski, Ch 5.1, 8.1 StreetView.
Soccer Video Analysis EE 368: Spring 2012 Kevin Cheng.
Computer Vision : CISC 4/689 Going Back a little Cameras.ppt.
Feature extraction: Corners 9300 Harris Corners Pkwy, Charlotte, NC.
Local invariant features 1 Thursday October 3 rd 2013 Neelima Chavali Virginia Tech.
Kylie Gorman WEEK 1-2 REVIEW. CONVERTING AN IMAGE FROM RGB TO HSV AND DISPLAY CHANNELS.
Mosaics part 3 CSE 455, Winter 2010 February 12, 2010.
Making Panoramas. Input: Output: … Input:  A set of images taken from the same optical center.  For this project, the images will also have the same.
A Tutorial on using SIFT Presented by Jimmy Huff (Slightly modified by Josiah Yoder for Winter )
CS654: Digital Image Analysis
Image Stitching II Linda Shapiro CSE 455. RANSAC for Homography Initial Matched Points.
Mosaics Today’s Readings Szeliski and Shum paper (sections 1 and 2, skim the rest) –
Midterm Review. Tuesday, November 3 7:15 – 9:15 p.m. in room 113 Psychology Closed book One 8.5” x 11” sheet of notes on both sides allowed Bring a calculator.
COS 429 PS3: Stitching a Panorama Due November 10 th.
Keypoint extraction: Corners 9300 Harris Corners Pkwy, Charlotte, NC.
Invariant Local Features Image content is transformed into local feature coordinates that are invariant to translation, rotation, scale, and other imaging.
April 21, 2016Introduction to Artificial Intelligence Lecture 22: Computer Vision II 1 Canny Edge Detector The Canny edge detector is a good approximation.
Image Stitching II Linda Shapiro EE/CSE 576.
Interest Points EE/CSE 576 Linda Shapiro.
SIFT paper.
Source: D. Lowe, L. Fei-Fei Recap: edge detection Source: D. Lowe, L. Fei-Fei.
CSE 455 HW 1 Notes.
Lecture 4: Harris corner detection
SIFT on GPU Changchang Wu 5/8/2007.
Assignment 2 Creating Panoramas.
RANSAC and mosaic wrap-up
Homography From Wikipedia In the field of computer vision, any
A special case of calibration
Image Stitching Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi.
Edge Detection The purpose of Edge Detection is to find jumps in the brightness function (of an image) and mark them.
EE 596 Machine Vision HW 6 Assigned: Nov 20, 2013
Assignment 2 Creating Panoramas.
EE/CSE 576 HW 1 Notes.
Idea: projecting images onto a common plane
Image Stitching II Linda Shapiro EE/CSE 576.
Photo by Carl Warner.
Feature Matching and RANSAC
Image Stitching Computer Vision CS 678
EE/CSE 576 HW 1 Notes.
Assignment 2 Creating Panoramas.
Harris detector Convert image to greyscale
Announcements Project 1 Project 2 Vote for your favorite artifacts!
Computational Photography
Img1 img3 img5.
Feature descriptors and matching
Presented by Xu Miao April 20, 2005
Calibration and homographies
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
ECE/CSE 576 HW 1 Notes.
Assignment 2 Creating Panoramas.
CS5760: Computer Vision Lecture 9: RANSAC Noah Snavely
Image Stitching Linda Shapiro ECE/CSE 576.
Image Stitching II Linda Shapiro ECE P 596.
Image Stitching Linda Shapiro ECE P 596.
Presentation transcript:

Assignment 2 Creating Panoramas

Step 1: (10 pts) Implement the Harris corner detector.   Part a.    void GaussianBlurImage(double *image, int w, int h, double sigma) Same as your function for Assignment 1, but the input is a floating point array of size w*h. You can use the full 2D kernel. You can index a pixel (c,r) by image[r*w + c] to go with the rest of the code for this assignment. c r

Step 1: (10 pts) Implement the Harris corner detector.   Part b.      void HarrisCornerDetector(QImage image, double sigma, double thres, CIntPt **cornerPts, int &numCornerPts, QImage &imageDisplay) image is the input image sigma is the standard deviation for the Gaussian thres is the threshold for detection corners cornerPts is an array that will contain the returned corner points numCornerPts is the number of points returned imageDisplay – image returned to display for debugging

Second Moment Matrix or Harris Matrix 2 x 2 matrix of image derivatives smoothed by Gaussian weights. Notation: First compute Ix, Iy, and IxIy as 3 images; then apply Gaussian to each. 4

Step 1: (10 pts) Implement the Harris corner detector.   Part b.      void HarrisCornerDetector(QImage image, double sigma, double thres, CIntPt **cornerPts, int &numCornerPts, QImage &imageDisplay) To do:                                 i.          Compute x and y derivatives of the image, use them to produce 3 images (I_x^2, I_y^2, and I_x*I_y) and smooth each of them with a 5x5 Gaussian.                                ii.          Compute the Harris matrix H in a 5x5 window around each pixel.                               iii.         Compute corner response function R = Det(H)/Tr(H), and threshold R. Try threshold 50 on the UI.                              iv.           Find local maxima of the response function using nonmaximum suppression.  1 . i n cornerPts[i].m_X, cornerPts[i].m_Y . . .

Step 2: (10 pts) Implement MatchCornerPoints. void MatchCornerPoints(Qimage image1, Cintpt *cornerPts1, int numCornerPts1, Qimage image2, Cintpt *cornerPts2, int numCornerPts2, CMatches **matches, int &numMatches, Qimage &image1Display, Qimage &image2Display) image1 is the first input image image 2 is the second (match from image 1 to image 2) cornerPts1 is a vector of interest points found in image1 cornerPts2 is a vector of interest points found in image 2 numCornerPts1 is the number of interest points in image1 numCornerPts2 is the number of interest points in Image 2 matches is a vector of matches; each match has X and Y coordinates from each image   1 . i n matches[i].m_X1, matches[i].m_Y1, matches[i].m_X2, matches[i].m_Y2

Step 2: (10 pts) Implement MatchCornerPoints. void MatchCornerPoints(Qimage image1, Cintpt *cornerPts1, int numCornerPts1, Qimage image2, Cintpt *cornerPts2, int numCornerPts2, CMatches **matches, int &numMatches, Qimage &image1Display, Qimage &image2Display) To do this you'll need to follow these steps:    Compute the descriptors for each interest point. This code has already been written for you. b.      For each corner point in image 1, find its best match in image 2. The best match is defined as the closest distance (L1-norm distance. ) c.       Add the pair of matching points to "matches". d.      Display the matches using DrawMatches (code is already written. ) Just pass it the required parameters. You should see many correct and incorrect matches.  

Step 3: (10 pts) Compute the homography between the images using RANSAC (Szeliski, Section 6.1.4). You write the helper functions for ComputeHomography. Part a.       void Project(double x1, double y1, doube &x2, double &y2, double h[3][3]) This should project point (x1, y1) using the homography "h". Return the projected point (x2, y2).  See the slides for details on how to project using homogeneous coordinates. Part b.      int ComputeInlierCount(double h[3][3], Cmatches *matches, int numMatches, double inlierThreshold). This is a helper function for RANSAC to compute thenumber of inlying points for a homography "h". Project the first point in each match using the function "Project". If the projected point is less than the distance "inlierThreshold" from the second point (in that match), it is an inlier. Return the total number of inliers.

c.       void RANSAC (Cmatches *matches , int numMatches, int numIterations, double inlierThreshold, double hom[3][3], double homInv[3][3], Qimage &image1Display, Qimage &image2Display) matches is a set of numMatches matches numIterations is the number of times to iterate inlierThreshold is a real number so that the distance from a projected point to the match is less than its square hom is the homography and homInv its inverse Image1Display and Image2Display hold the matches to display

c. void RANSAC (Cmatches *matches , int numMatches, int numIterations, double inlierThreshold, double hom[3][3], double homInv[3][3], Qimage &image1Display, Qimage &image2Display) a.       Iteratively do the following for "numIterations" times:   i. Randomly select 4 pairs of potentially matching points from "matches".   ii.      Compute the homography relating the four selected matches with the function "ComputeHomography. "   iii.      Using the computed homography, compute the number of inliers using "ComputeInlierCount".    iv.      If this homography produces the highest number of inliers, store it as the best homography. b.      i. Given the highest scoring homography, once again find all the inliers. ii. Compute a new refined homography using all of the inliers (not just using four points as you did previously. ) iii. Compute an inverse homography as well (the fourth term of the function ComputeHomography should be false), and return their values in "hom” and "homInv". c.       Display the inlier matches using "DrawMatches".

Following these steps: Step 4: (10 pts) Stitch the images together using the computed homography. Following these steps: a.       bool BilinearInterpolation(Qimage *image, double x, double y, double rgb[3]). This code should be the same as in Assignment 1, but if x and y are out of range, it should just return false, else fill the rgb and return true. b.      void Stitch(Qimage image1, Qimage image2, double hom[3][3], double homInv[3][3], Qimage &stitchedImage) image1 and image 2 are the input images hom is the homography and homInv its inverse stitchedImage is the result.                                  i.            Compute the size of "stitchedImage. " To do this project the four corners of "image2" onto "image1" using Project and "homInv". Allocate the image.                                ii.            Copy "image1" onto the "stitchedImage" at the right location.                               iii.            For each pixel in "stitchedImage", project the point onto "image2". If it lies within image2's boundaries, add or blend the pixel's value to "stitchedImage. " When finding the value of image2's pixel use BilinearInterpolation. (Here’s where the true/false is needed.)