Docsity

Image Resizing and Seam Carving Algorithm, Lecture notes of Computer Science

Partial preview of the text

Download Image Resizing and Seam Carving Algorithm and more Lecture notes Computer Science in PDF only on Docsity!

Introduction

Meet your TAs

  • ‘nuff said.

Goals for you Course Work

  • Know some algorithms and data structures
  • Find new ones
  • Reason about them
  • Use them
  • Take more CS
    • Class
    • Surfing and Blogging
    • Homeworks and Projects
    • Sections
    • TA hours
    • Exams (midterm, final)

Index Cards

  • Your name
  • Your brown.edu short login
  • Do you have a CS account from CS15 or another course?
  • Intended concentration(s)
  • Self-portrait or good description
  • Other courses this semester (estimate if unknown)
  • Name of person to your left
  • Name of person to your right
  • Do you know calculus?
  • “I am ____% sure I’ll stay in CS16.”
  • Brief CS autobiography

Image Resizing

  • Original image:

Image Resizing

  • Ah ha!

Image Resizing

  • Idea: to narrow image, delete unimportant pixels
  • “Importance” of a pixel can be approximated by “how different am I from my neighbors?”

Intensities Docsity.com

Image Importance

Low HighDocsity.com

Approach 1

  • Find the least-important pixel and remove it, then the next- least important…
  • Repeat, removing worst pixels in order:

Approach 2

  • Removing least important pixel in each row:

Still messy…

  • Oops. Left and right edges look good. Middle

is a mess

  • Too much shifting between adjacent rows!
  • Solution: Find the column whose total

importance is smallest and remove it; repeat.

Progress!

  • Much better…but not ideal.
  • Important stuff removed as well as

unimportant.

  • What if picture looked like this?
  • Solution: “Seam”
    • Path from top to bottom that moves L/R by at most one pixel per row.

Seams

  • Horizontal and vertical seams shown