CS 1699: Intro to Computer Vision Matlab Tutorial Prof. Adriana Kovashka University of Pittsburgh September 3, 2015.

Slides:



Advertisements
Similar presentations
Improved Seam Carving for Video Retargeting Authors: Michael Rubinstein, Ariel Shamir and Shai Avidan Source: ACM Transactions on Graphics (TOG), Volume.
Advertisements

TP14 - Local features: detection and description Computer Vision, FCUP, 2014 Miguel Coimbra Slides by Prof. Kristen Grauman.
Paris town hall.
Computational Photography Prof. Feng Liu Spring /30/2015.
Agenda Seam-carving: finish up “Mid-term review” (a look back) Main topic: Feature detection.
ICS 6N Computational Linear Algebra
1 Image filtering Hybrid Images, Oliva et al.,
CS 232 Geometric Algorithms: Lecture 1 Shang-Hua Teng Department of Computer Science, Boston University.
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
Finding Red Pixels – Part 2 Prof. Noah Snavely CS1114
CS 232 Geometric Algorithms: Lecture 1 Shang-Hua Teng Department of Computer Science, Boston University.
Announcements Kevin Matzen office hours – Tuesday 4-5pm, Thursday 2-3pm, Upson 317 TA: Yin Lou Course lab: Upson 317 – Card access will be setup soon Course.
Capturing Light… in man and machine : Computational Photography Alexei Efros, CMU, Fall 2008.
1 Image filtering
Finding Red Pixels – Part 1 Prof. Noah Snavely CS1114
Lecture 11: Stereo and optical flow CS6670: Computer Vision Noah Snavely.
COMP 110 Introduction to Programming Mr. Joshua Stough August 22, 2007 Monday/Wednesday/Friday 3:00-4:15 Gardner Hall 307.
1 Image filtering Hybrid Images, Oliva et al.,
What is wrong with this picture? Recap from Lecture 2 Pinhole camera model Perspective projections Focal length and field of view Remember to use your.
Most slides from Steve Seitz
CS 450: COMPUTER GRAPHICS COURSE AND SYLLABUS OVERVIEW SPRING 2015 DR. MICHAEL J. REALE.
CS223 Algorithms D-Term 2013 Instructor: Mohamed Eltabakh WPI, CS Introduction Slide 1.
Lenses: Focus and Defocus A lens focuses light onto the film – There is a specific distance at which objects are “in focus” other points project to a “circle.
COMP Introduction to Programming Yi Hong May 13, 2015.
CS 103 Discrete Structures Lecture 01 Introduction to the Course
CST 229 Introduction to Grammars Dr. Sherry Yang Room 213 (503)
Introduction to Data Structures
Recap from Lecture 2 Pinhole camera model Perspective projections Lenses and their flaws Focus Depth of field Focal length and field of view Chapter 2.
Linear Filters Monday, Jan 24 Prof. Kristen Grauman UT-Austin …
Linear Filters August 27 th 2015 Devi Parikh Virginia Tech 1 Slide credit: Devi Parikh Disclaimer: Many slides have been borrowed from Kristen Grauman,
Principles of Computer Science I Honors Section Note Set 1 CSE 1341 – H 1.
Image Filtering Computer Vision CS 543 / ECE 549 University of Illinois Derek Hoiem 02/02/10.
Why is computer vision difficult?
Image gradients and edges Tuesday, September 1 st 2015 Devi Parikh Virginia Tech Disclaimer: Many slides have been borrowed from Kristen Grauman, who may.
Kshitij Padalkar 13 th Oct Contents: In one Line… Need Solutions and Other Work Definition and Maths Energy, Seam Pixel Removal Criteria Other Energy.
Finding Red Pixels – Part 1 Prof. Noah Snavely CS1114
Pixels and Image Filtering Computer Vision Derek Hoiem, University of Illinois 02/01/11 Graphic:
CS 1699: Intro to Computer Vision Support Vector Machines Prof. Adriana Kovashka University of Pittsburgh October 29, 2015.
October 16, 2014Computer Vision Lecture 12: Image Segmentation II 1 Hough Transform The Hough transform is a very general technique for feature detection.
Local features: detection and description
CS 2750: Machine Learning Introduction Prof. Adriana Kovashka University of Pittsburgh January 6, 2016.
Course Info Instructor U.T. Nguyen Office: CSEB Office hours: Tuesday, 14:30-15:30 Thursday, 12:00-12:45 By.
Pixels and Image Filtering Computational Photography Derek Hoiem 08/26/10 Graphic:
CS 2750: Machine Learning Linear Regression Prof. Adriana Kovashka University of Pittsburgh February 10, 2016.
Capturing Light… in man and machine CS194: Image Manipulation & Computational Photography Alexei Efros, UC Berkeley, Fall 2015.
Lecture 10: Harris Corner Detector CS4670/5670: Computer Vision Kavita Bala.
Prof. Adriana Kovashka University of Pittsburgh September 14, 2016
Fitting: Voting and the Hough Transform
Capturing Light… in man and machine
Linear Filters April 6th, 2017
CS Computer Graphics Valdosta State University, Spring 2018
Image gradients and edges
CS 2750: Machine Learning Linear Regression
Computational Photography
Course Overview Juan Carlos Niebles and Ranjay Krishna
CS 2770: Computer Vision Linear Algebra and Matlab
CS 1674: Intro to Computer Vision Linear Algebra Review
Image filtering Hybrid Images, Oliva et al.,
Image gradients and edges April 11th, 2017
Image filtering Images by Pawan Sinha.
Capturing Light… in man and machine
Image filtering Images by Pawan Sinha.
Seam Carving Project 1a due at midnight tonight.
Most slides from Steve Seitz
Image filtering Images by Pawan Sinha.
Image filtering
Image filtering
Visuals are analog signals...
Most slides from Steve Seitz
Course overview Lecture : Juan Carlos Niebles and Ranjay Krishna
Presentation transcript:

CS 1699: Intro to Computer Vision Matlab Tutorial Prof. Adriana Kovashka University of Pittsburgh September 3, 2015

Plan for Today Course basics refresher Matlab tutorial Overview of Homework 1 (Start on image filtering)

Course Info Course website: Instructor: Adriana Kovashka – Please use "CS1699" at the beginning of your Subject Office: Sennott Square 5325 Office hours: Tuesday and Thursday, 4pm-5pm Grader: Nils Murrugarra-Llerena

Textbooks Computer Vision: Algorithms and Applications by Richard Szeliski Computer Vision: Algorithms and Applications Visual Object Recognition by Kristen Grauman and Bastian Leibe Visual Object Recognition Please do the assigned readings before class

Homework Submission We will use CourseWeb Navigate to the CourseWeb page for CS1699, click on "Assignments" and the corresponding HW # Attach a zip file with your written responses and code Name the file as YourFirstName_YourLastName.zip or YourFirstName_YourLastName.tar Homework is due at 11:59pm on the due Grades will appear on CourseWeb

Late Policy You get 3 "free" late days, i.e., you can submit homework a total of 3 days late. For example, you can submit one problem set 12 hours late, and another 60 hours late. Once you've used up your free late days, you will incur a penalty of 25% from the total project credit possible for each late day. A late day is anything from 1 minute to 24 hours.

Collaboration Policy You will work individually. The work you turn in must be your own work. You can discuss the problem sets with your classmates, but do not look at their code. You cannot use posted solutions, search for code on the internet or use Matlab's implementations of something you are asked to write. When in doubt, ask the instructor! Plagiarism will cause you to fail the class and receive disciplinary penalty.

Homework 1 Part I: Matlab exercise – Today’s lecture Part II: Short answers – Lectures on 9/08 and 9/15 Part III: Implementing image pyramids – Lecture on 9/10 Part IV: Implementing seam carving – Today’s lecture

Matlab tutorial

Image Formation Slide credit: Derek Hoiem

Digital camera A digital camera replaces film with a sensor array Each cell in the array is light-sensitive diode that converts photons to electrons Slide by Steve Seitz

Slide credit: Derek Hoiem Digital images

Sample the 2D space on a regular grid Quantize each sample (round to nearest integer) Image thus represented as a matrix of integer values. Adapted from S. Seitz 2D 1D

Digital color images Slide credit: Kristen Grauman

RG B Color images, RGB color space Digital color images Slide credit: Kristen Grauman

Images in Matlab Images represented as a matrix Suppose we have a NxM RGB image called “im” –im(1,1,1) = top-left pixel value in R-channel –im(y, x, b) = y pixels down, x pixels to right in the b th channel –im(N, M, 3) = bottom-right pixel in B-channel imread(filename) returns a uint8 image (values 0 to 255) –Convert to double format (values 0 to 1) with im2double R G B row column Slide credit: Derek Hoiem

Tutorial Part I s/matlab-tutorial/ s/matlab-tutorial/

Tutorial Part II orial.m orial.m

Homework 1 Seam carving

Seam carving: main idea [Shai & Avidan, SIGGRAPH 2007]

Content-aware resizing Traditional resizing Seam carving: main idea [Shai & Avidan, SIGGRAPH 2007]

Content-aware resizing Seam carving: main idea Intuition: Preserve the most “interesting” content  Prefer to remove pixels with low gradient energy To reduce or increase size in one dimension, remove irregularly shaped “seams”  Optimal solution via dynamic programming. Kristen Grauman, UT-Austin

Want to remove seams where they won’t be very noticeable: –Measure “energy” as gradient magnitude Choose seam based on minimum total energy path across image, subject to 8-connectedness. Seam carving: main idea Kristen Grauman, UT-Austin

Let a vertical seam s consist of h positions that form an 8-connected path. Let the cost of a seam be: Optimal seam minimizes this cost: Compute it efficiently with dynamic programming. Seam carving: algorithm s1s1 s2s2 s3s3 s4s4 s5s5 Kristen Grauman, UT-Austin

How to identify the minimum cost seam? First, consider a greedy approach: Energy matrix (gradient magnitude) Kristen Grauman, UT-Austin

row i-1 Seam carving: algorithm Compute the cumulative minimum energy for all possible connected seams at each entry (i,j): Then, min value in last row of M indicates end of the minimal connected vertical seam. Backtrack up from there, selecting min of 3 above in M. j-1 j row i M matrix: cumulative min energy (for vertical seams) Energy matrix (gradient magnitude) j j+1 Kristen Grauman, UT-Austin

Example Energy matrix (gradient magnitude) M matrix (for vertical seams) Kristen Grauman, UT-Austin

Example Energy matrix (gradient magnitude) M matrix (for vertical seams) Kristen Grauman, UT-Austin

Real image example Original Image Energy Map Blue = low energy Red = high energy Kristen Grauman, UT-Austin

Real image example Kristen Grauman, UT-Austin

Real image example Kristen Grauman, UT-Austin

Other notes on seam carving Analogous procedure for horizontal seams Can also insert seams to increase size of image in either dimension –Duplicate optimal seam, averaged with neighbors Other energy functions may be plugged in –E.g., color-based, interactive,… Can use combination of vertical and horizontal seams Kristen Grauman, UT-Austin

Results from Eunho Yang Example results from classes at UT Austin

Results from Suyog Jain

Seam carving result Original image Results from Martin Becker Conventional resize

Seam carving result Conventional resize Original image Results from Martin Becker

Results from Jay Hennig Original image (599 by 799) Conventional resize (399 by 599) Seam carving (399 by 599)

“Failure cases” with seam carving By Donghyuk Shin

“Failure cases” with seam carving By Suyog Jain

Next Time Image filtering Reading for Tuesday: Szeliski Sec , 3.2 Reading for today was: Szeliski Sec