Git Product home page Git Product logo

cair's Introduction

CAIM: Content Aware Image Manipulation

M. Rizwan, Waleed A. Malik amd Fayyaz Minhas

Department of Computer and Information Sciences

Pakistan Institute of Engineering and Applied Sciences (PIEAS), PO Nilore, Islamabad, Pakistan

15 May, 2010

This work focuses on content aware image resizing and object removal. Traditional image resizing techniques do not consider the content of the image and as a result these techniques produce artifacts such as change in the aspect ratio of different objects in the image. The technique [1] implemented in this project uses dynamic programming to identify a seam (a set of connected pixels on a single image from top to bottom or from left to right) in the image over which a certain energy function or map (e.g. sum of the absolute values of the horizontal and vertical image gradients) is minimized. This seam is then removed from the image and as a result the size of the image is reduced with minimal loss of important information from the image. This process is repeated over and over again until the desired size of the image is obtained. Figure-1 below shows the effect of content aware image resizing in comparison to the conventional resizing method. It clearly shows the effectiveness of the proposed scheme. The concept of finding a seam using dynamic programming can also be extended to removal of objects from images in an intelligent manner. In this process the object to be removed from an image is marked using a simple user interface by the user. The software, in its computation of the energy map, sets the value of the pixels corresponding to that object to very small values which forces the seams to pass through that object and as a result the unwanted object is removed during size reduction. The loss of visual quality is automatically minimized in the process due to dynamic programming. Figure-2 shows an example of object removal from an image. The Matlab implementation of the technique is available here.

Content Aware Image Resizing

Content Aware Image Manipulation

Running:

You can run the code in Matlab. The file is: compec.m.

References:

[1] Avidan, Shai, and Ariel Shamir. "Seam carving for content-aware image resizing." ACM Transactions on graphics (TOG). Vol. 26. No. 3. ACM, 2007.

cair's People

Contributors

foxtrotmike avatar

Watchers

Muhammad Dawood avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.