CS143 Introduction to Computer Vision Homework assignment 1.

Similar documents
CS143: Introduction to Computer Vision Homework Assignment 3

Outline 7/2/201011/6/

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Edge detection. Convert a 2D image into a set of curves. Extracts salient features of the scene More compact than pixels

Scott Smith Advanced Image Processing March 15, Speeded-Up Robust Features SURF

Local Features: Detection, Description & Matching

Digital Image Processing (CS/ECE 545) Lecture 5: Edge Detection (Part 2) & Corner Detection

Anno accademico 2006/2007. Davide Migliore

16720: Computer Vision Homework 1

Multimedia Computing: Algorithms, Systems, and Applications: Edge Detection

BSB663 Image Processing Pinar Duygulu. Slides are adapted from Selim Aksoy

CSE 252A Computer Vision Homework 3 Instructor: Ben Ochoa Due : Monday, November 21, 2016, 11:59 PM

Edge and corner detection

Wikipedia - Mysid

Other Linear Filters CS 211A

Computer Vision I. Announcements. Fourier Tansform. Efficient Implementation. Edge and Corner Detection. CSE252A Lecture 13.

ECE 470: Homework 5. Due Tuesday, October 27 in Seth Hutchinson. Luke A. Wendt

Announcements. Edges. Last Lecture. Gradients: Numerical Derivatives f(x) Edge Detection, Lines. Intro Computer Vision. CSE 152 Lecture 10

Image features. Image Features

Peripheral drift illusion

Prof. Feng Liu. Spring /26/2017

Lecture 6: Edge Detection

Computer Vision for HCI. Topics of This Lecture

Matching. Compare region of image to region of image. Today, simplest kind of matching. Intensities similar.

Edge and local feature detection - 2. Importance of edge detection in computer vision

Edge Detection. Announcements. Edge detection. Origin of Edges. Mailing list: you should have received messages

16720 Computer Vision: Homework 3 Template Tracking and Layered Motion.

PA2 Introduction to Tracking. Connected Components. Moving Object Detection. Pixel Grouping. After Pixel Grouping 2/19/17. Any questions?

Motion Estimation and Optical Flow Tracking

Local Image preprocessing (cont d)

Problems with template matching

CS 565 Computer Vision. Nazar Khan PUCIT Lectures 15 and 16: Optic Flow

Straight Lines and Hough

Templates, Image Pyramids, and Filter Banks

Broad field that includes low-level operations as well as complex high-level algorithms

Features Points. Andrea Torsello DAIS Università Ca Foscari via Torino 155, Mestre (VE)

SIFT: SCALE INVARIANT FEATURE TRANSFORM SURF: SPEEDED UP ROBUST FEATURES BASHAR ALSADIK EOS DEPT. TOPMAP M13 3D GEOINFORMATION FROM IMAGES 2014

Segmentation and Grouping

Face Tracking : An implementation of the Kanade-Lucas-Tomasi Tracking algorithm

CSE 547: Machine Learning for Big Data Spring Problem Set 2. Please read the homework submission policies.

Biometrics Technology: Image Processing & Pattern Recognition (by Dr. Dickson Tong)

Local Feature Detectors

Visual Tracking (1) Tracking of Feature Points and Planar Rigid Objects

Dense Image-based Motion Estimation Algorithms & Optical Flow

CS 4495 Computer Vision Motion and Optic Flow

CS4495 Fall 2014 Computer Vision Problem Set 5: Optic Flow

Ninio, J. and Stevens, K. A. (2000) Variations on the Hermann grid: an extinction illusion. Perception, 29,

Homework 4 Computer Vision CS 4731, Fall 2011 Due Date: Nov. 15, 2011 Total Points: 40

Computer Vision I - Basics of Image Processing Part 2

EE795: Computer Vision and Intelligent Systems

School of Computing University of Utah

CSE152 Introduction to Computer Vision Assignment 3 (SP15) Instructor: Ben Ochoa Maximum Points : 85 Deadline : 11:59 p.m., Friday, 29-May-2015

Feature Tracking and Optical Flow

Feature Based Registration - Image Alignment

Scaled representations

HOMEWORK 1. Theo Lorrain-Hale UNIVERSITY OF MARYLAND

CAP 5415 Computer Vision Fall 2012

Capturing, Modeling, Rendering 3D Structures

Computer Vision I Name : CSE 252A, Fall 2012 Student ID : David Kriegman Assignment #1. (Due date: 10/23/2012) x P. = z

COMPUTER VISION > OPTICAL FLOW UTRECHT UNIVERSITY RONALD POPPE

Outlines. Medical Image Processing Using Transforms. 4. Transform in image space

Visual Tracking (1) Feature Point Tracking and Block Matching

Biomedical Image Analysis. Point, Edge and Line Detection

Low-level Vision Processing Algorithms Speaker: Ito, Dang Supporter: Ishii, Toyama and Y. Murakami

Artistic Stylization of Images and Video Part III Anisotropy and Filtering Eurographics 2011

Corner Detection. GV12/3072 Image Processing.

Feature Detectors and Descriptors: Corners, Lines, etc.

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

SUMMARY: DISTINCTIVE IMAGE FEATURES FROM SCALE- INVARIANT KEYPOINTS

Edge Detection. CSE 576 Ali Farhadi. Many slides from Steve Seitz and Larry Zitnick

EN1610 Image Understanding Lab # 3: Edges

Why is computer vision difficult?

Automatic Image Alignment

ME/CS 132: Introduction to Vision-based Robot Navigation! Low-level Image Processing" Larry Matthies"

Local invariant features

Local features: detection and description May 12 th, 2015

Texture. Outline. Image representations: spatial and frequency Fourier transform Frequency filtering Oriented pyramids Texture representation

CPSC 425: Computer Vision

Local Descriptors. CS 510 Lecture #21 April 6 rd 2015

The SIFT (Scale Invariant Feature

Pictures at an Exhibition

16720: Computer Vision Homework 2 Feature Descriptors, Homographies & RANSAC

Line, edge, blob and corner detection

Image processing. Reading. What is an image? Brian Curless CSE 457 Spring 2017

Frequency analysis, pyramids, texture analysis, applications (face detection, category recognition)

Lecture 2 Image Processing and Filtering

Perspective Projection [2 pts]

Schedule for Rest of Semester

Introduction to Computer Vision

Image processing and features

CS334: Digital Imaging and Multimedia Edges and Contours. Ahmed Elgammal Dept. of Computer Science Rutgers University

CS 556: Computer Vision. Lecture 3

Midterm Exam CS 184: Foundations of Computer Graphics page 1 of 11

Chapter 3: Intensity Transformations and Spatial Filtering

Image Matching. AKA: Image registration, the correspondence problem, Tracking,

Stitching and Blending

Lecture 7: Most Common Edge Detectors

CS5670: Computer Vision

( ) =cov X Y = W PRINCIPAL COMPONENT ANALYSIS. Eigenvectors of the covariance matrix are the principal components

Feature Descriptors. CS 510 Lecture #21 April 29 th, 2013

Transcription:

CS143 Introduction to Computer Vision Homework assignment 1. Due: Problem 1 & 2 September 23 before Class Assignment 1 is worth 15% of your total grade. It is graded out of a total of 100 (plus 15 possible extra points, which must be done for graduate credit). Goals. Introduce you to Matlab and the manipulation of images and vectors in Matlab. Introduce convolution and filtering. Introduce image pyramids. Allow you to experiment with image blending Experiment with image feature detection. Files you need. The images that you should work with are in the directory /course/cs143/asgn/asgn1/. Additionally, we provided four Matlab scripts problem[1-4].m in the directory /course/cs143/asgn/asgn1/, which you should start from. Their main purpose is to make it easier for us to grade your homework. You are therefore asked to copy those files and modify them, so that they perform the appropriate task and display your results. You are of course free to write your own scripts and/or functions and only add calls to these to the scripts we provided. What to hand in. You will hand in your Matlab code (and our support code needed to run your program), which is supposed to show all your results, and any text or explanations 1

that are required. Make an effort to submit neat commented code so we can attempt giving you partial credit where necessaary. If the result is wrong and we cannot follow your line of reasoning, we will not be able to award you any points. Please hand in the modified problem[1-4].m scripts as well as any other Matlab scripts or functions that your solution requires. Make sure that all your results are displayed properly! Pay attention to the efficiency of your program. You will lose points if your program is very slow. You will also hand in any text or explanations electronically. They should either be in plain text format, in Postscript, or in PDF. To handin the assignment run the commands below from the folder that contains your solutions. The entire contents of that folder will be zipped and sent to us. For assignment 1, problems 1 and 2: /course/cs143/bin/handin asgn1 p1 p2 For assignment 1, all problems: /course/cs143/bin/handin asgn1all General Remarks. You may use built-in Matlab routines to perform convolution and image resizing. See the Collaboration Policy on the website: http://www.cs.brown.edu/courses/cs143/collaboration.html Problem 1. Image pyramids. (20pts) For the Mona Lisa image, build a 5 level Gaussian pyramid and display it in a format similar to the one in the figure. Also implement and display a Laplacian (difference of Gaussian (DoG)) pyramid. 2

Problem 2. Image derivatives. (20pts) In this part of the assignment you are to compute the first partial derivatives of the Barbara image in the x and y directions. Do this at every scale in the Gaussian pyramid and show the results. Also state which masks you used to implement your derivative filters. Using these derivatives, compute the gradient magnitude at each scale; ie I = I 2 x + I 2 y. Choose a threshold to detect edge locations using the gradient magnitude. Show the detected edge locations as black points on a white image. Write a paragraph explaining how you chose the threshold and what problems this approach might have for edge detection. (5 extra pts) Combine information across scales in your detection of edges above. Explain what you did, how it worked, and why. Problem 3. Image Blending. For this problem you will be reconstructing the blended image shown above. This technique is introduced as image blending and is a way of splicing to images together in such a way that the transition between them is smooth and natural looking. This problem uses color images. You can think of color images is being three separate images, one for each color channel. We have taken care of loading, splitting the color channels, and displaying the results for you, so 3

you only need to work with the individual color components, which work the same way as the grayscale images you worked with previously. See section 3.4.4 (pp. 165) of your textbook for details on the algorithm. (5 extra pts) Find two other images and blend them. This requires that the images are alligned, the same size, and that you create a mask between them. Problem 4. Image derivatives and image features. The local spatial correlation captures something about the local image structure. It can be expressed as c(x,y, x, y) = 1 W(x,y) x k,y k W(x,y) (I(x k,y k ) I(x k + x,y k + y)) 2 where I(x,y) is an image, W(x,y) is a neighborhood of pixel locations centered on (x,y) and ( x, y) represents some spatial shift in the image. (10pts) Derive an approximation for the spatial correlation function as c(x,y, x, y) [ x y]a[ x y] T. Your task is to figure out what the matrix A should be. Start by approximating I(x k,y k ) I(x k + x,y k + y) by its first order Taylor approximation. Recall that the Taylor series expansion of a function is f(x 0 + x) = f(x 0 ) + d dx f(x 0) x + d2 dx 2f(x 0) x + 2! You only need the first order approximation. Once you have this approximation, constructing A is a matter of rearranging things into a matrix form. Show your work! Hint: A will be a 2 2 matrix constructed from the first partial image derivatives. For those who are interested, it is a positive semi-definite matrix. (15pts) Compute this matrix at every pixel in the CIT image. Take W to be a 5 5 window. 4

The matrix A is sometimes called the structure tensor ; it captures information about the local variation in the image gradient. We can understand something about the local image structure by examining the eigenvectors and eigenvalues of this matrix. In particular, the eigenvectors provide a coordinate system that is aligned with the principal axis of the image variation; that is, the eigenvectors tell us about the local orientation of image features. The eigenvalues (which are always non-negative) tell us something about what kinds of image structures are present. If both eigenvalues are small, then the local neighborhood is roughly homogeneous. If one eigenvalue is large and the other is small, then there is an edge present in a particular orientation. If they are both large, then there is a more complex structure such as a corner or other junction. The eigenvalues can be computed using Matlab s eig [V,D] = eig(a); function This returns a diagonal matrix of eigenvalues along the diagonal of D. The eigenvectors are stored column-wise in V. Using a sparse set of pixel locations (e.g. every 4th pixel, or other value you decide is appropriate), draw an ellipse oriented along the principal axis of the image variation at that point (as given by the eigenvectors of the structure tensor) with semiaxis proportional to the eigenvalues of the structure tensor at that point. You should obtain an image similar to the example we give on page 6 of this handout. Hint: We provide a matlab function for drawing ellipses: ellipse(ra,rb,ang,x0,y0,c); The ellipse drawn has axis ra and rb, is centered at the point x0,y0 and rotated by the angle ang. The color of the ellipse is C. Figure out how to compute the angle and the ratio between ra,rb and the eigen values (you may want to test it on simple image first). Hint: You need to adjust the scale of your ellipses. Since their size is proportional to the eigenvalues, you can divide by the maximum value to give a normalized size, and then multiply by a fixed scale for the desired size of the ellipse. 5

(15pts) When both eigenvalues are large, we will think of this as an interest point or feature. Find the strongest 20 interest points at each scale in your pyramid. Show the locations of the points on the finest scale image. For every interest point found, do nonmaximum suppression. Compute an image that represents the importance of each feature in terms of the eigenvalues. Using this salience image, first find the most salient feature. Then mask out (set to zero) the pixels in a neighborhood around this. Repeat the search for the next most salient feature and so on. Otherwise you may have feature points clustered around the same position. Draw a circle around each point, with the radius of the circle indicating the scale at which the point was found (larger circles for coarse scales). Hint: The following Matlab command draws circles: rectangle( Position, [x y d d], Curvature, [1 1]); The circle drawn inscribes a square with the upper left corner at (x,y) and an edge length of d. 6

Hint: You may want to test your feature detection algorithm on a very simple image first, for example just synthetic image of a rectangle. 7

Problem 5. Hybrid Images (200-Level Credit). (15pts) Take a look at the images at: http://cvcl.mit.edu/hybridimage.htm A hybrid image is made by combining one image where there are only low spatial frequencies and one that contains only high frequencies. Using your Gaussian and Laplacian pyramids get a low frequency image from a coarse level of the Gaussian pyramid and high frequency (band pass) image from a fine level of the Laplacian pyramids. Linearly combine these. For this problem, you should find two images you would like to combine, align them and combine them at different spatial frequencies to create something comparable to what is shown on the web page above.??? give them two test images???? how many points? 8