File Exchange

image thumbnail

Seam Carving for content aware image resizing

version 1.0 (2.79 KB) by

illustrative example of the seam carving algorithm.

4.71429
9 Ratings

7 Downloads

Updated

No License

Editor's Note: This was a File Exchange Pick of the Week

illustrative example of Seam carving for content aware image resizing


usage: carvedimg=seamcarving(im,k)

k is how many vertical seams to remove.
im is the image.

example:
img=imread('peppers.png')
carvedimg=seamcarving(img,50)
image([carvedimg img]);
axis equal;

Author: Aslak Grinsted 2007...
Based on ideas from Avidan & Shamir:
http://video.google.com/videoplay?docid=-6221880321193117495
Note i haven't read their paper and they have probably lots of smart tricks for optimizations.

Comments and Ratings (12)

aravindh raju

sir is it vertical seam carving is possible

Waheeb Yaqub

Joel Mendonca

mahdi

mahdi (view profile)

mahdi

mahdi (view profile)

mahdi

mahdi (view profile)

Really nice piece of code. Works like a charm!

fido genial

great work!!! How do you increase the size of the image... I see only seam removal...

kkk kkk

great!

fabrice clavel

Aslak Grinsted

It only requires image processing toolbox in order to load the demo images. Try loading one of your own and applying it to that instead. --Anyway i have tried to remove this dependency in a new version just uploaded.

Gerd Kunert

Requires Image Processing Toolbox!

Updates

Changed costfunction to the same as used in the google video clip. works better for some images but slightly slower.

Fixed a bug that prevented it to run outside demo-mode.

Improved various small things suggested by Doug Hall and made some small optimizations.
* handle grayscale images
* add nice demo mode

MATLAB Release
MATLAB 7 (R14)

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video