Skip to content

CesarCaramazana/ObjectRemoval_SeamCarving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Object Removal with SeamCarving

This object removal algorithm was developed by César Caramazana and José Julián Gallardo, as the final project of a Digital Image Processing course.

In this notebook we implement an object removal algorithm based on Seam carving, a content-aware resizing algorithm that eliminates the pixels with the least enery in an image to perform cropping or scaling without losing meaningful information. The original paper is available here: https://www.eng.tau.ac.il/~avidan/papers/imretFinal.pdf

Description and results

We added some key modifications to the original implementation so that it takes a binary mask as an input (marking the object we want to remove) and iterates the steps of the seam carving algorithm to return a resized version of the image in which the object disappears. Due to time constrains, the algorithm as it is now only eliminates columns, although, in order to perform the resizing on the horizontal axis, a 90 degrees rotation in the input images would suffice. An example of a single seam removal is shown below:

o0

In spite of the wonders it can offer, our algorithm, as well as the original Seam Carving, cannot avoid some failure cases, in which artefacts are notorious and the results are unsatisfactory.

o3

However, we postprocessed the outputs with low-pass gaussian filters to blur these artefacts and achieve some better-looking images. The examples are shown below:

o1

o2

o3

o3

All the images used for testing were retrieved from the public repository: https://pixabay.com

Code usage

The code was implemented in a Google Colab notebook ObjectRemoval_SeamCarving.ipynb, using the following libraries:
  • Numpy
  • Matplotlib
  • cv2

We mounted Google Drive to access some test images. The input images must be in .jpeg or .png extension.

About

Object removal algorithm based on Seam Carving

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published