Difference between revisions of "Image retargeting by k-seam removal"

From AIRWiki
Jump to: navigation, search
 
m (Laboratory work and risk analysis)
 
(62 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''DO NOT EDIT THIS PAGE!'''
 
 
This is a generic template for a project page. Project pages describe the projects going on at the AIRLab and are listed in the [[Projects]] page. Feel free to copy (but ''not'' to cut or modify) the contents of its 'edit' tab and re-use them as a basis for your own project's page. The instructions to do that are given at [[Projects#HOWTO add a new project to the AIRWiki]].
 
 
Of course this is only intended as a hint: ''your'' page must contain also all the details about your work. In particulat you need to write down in detail if your work can cause any risk to you or to others.
 
 
Finally, keep in mind that '''YOU have the responsibility to guarantee that your work complies to the [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] and the [http://airlab.elet.polimi.it/index.php/airlab/content/download/613/5300/file/Regolamento_AIRLab.pdf Rules] of the AIRLab. Despite the joking tone of what follows, these are matters that you must consider very seriously'''.
 
 
If you have any doubt about the safety of a tool, a procedure or anything else in the AIRLab, stop ''now'' and talk with the Teacher who is in charge of your project.
 
 
 
== '''Part 1: project profile''' ==
 
== '''Part 1: project profile''' ==
  
 
=== Project name ===
 
=== Project name ===
''the 'official' name, if there is one, or a one-line description''
 
  
Construction of an evil, humankind-hating robot.
+
Image retargeting by k-seam removal.
  
 
=== Project short description ===
 
=== Project short description ===
''here you must write down, in at least a few lines of text, what the project is about''
 
  
This project is aimed at designing and constructing a big, powerful and indestructible autonomous robot. It will be able to fight, defeat and ultimately wipe out humanity. After that, the robot will proceed to populate the Earth with a new breed of mechanical beings. Actually, the development of the self-replicating system will be performed by a future project, to be set up after (?) the success of this one.
+
This project presents a methodology for content aware image resizing based on seam removal. In this work four different approaches were implemented in order to retarget an image:
 +
* removing a 8-connected path of pixels (1-seam) minimizing an energy function
 +
* removing a not connected path of pixels (k-seam) minimizing an energy function
 +
* removing a 8-connected path of pixels (1-seam) minimizing the energy variation in the image
 +
* removing a not connected path of pixels (k-seam) minimizing the energy variation in the image
 +
where k is the maximum disconnect allowed.
 +
 
 +
The work ends with a comparison on several test pictures among these algorithms considering the one which gives the best results.
  
 
=== Dates ===
 
=== Dates ===
 
Start date: 2008/01/01
 
Start date: 2008/01/01
  
End date: 2010/12/31
+
End date: 2008/06/24
 
+
=== Website(s) ===
+
''address of the official web page(s) of the project, if any; do not put other links here, as they belong to [[#Part 2: project description]]''
+
 
+
http://www.construction_of_an_evil_humankind-hating_robot.org
+
  
 
=== People involved ===
 
=== People involved ===
''put here the links to the AIRWiki pages associated to all the people working on the project''
 
 
''[by the way, please note that one of such pages is automatically created for every AIRLab user (yes, for you too) and that you MUST have filled it in - complete with a photo - before entering the lab for the first time]''
 
  
 
===== Project head(s) =====
 
===== Project head(s) =====
''the people who guide the project, and therefore your own work too''
 
  
P. Azzoide - [[User:PampurioAzzoide]]
+
* [[User:PierluigiTaddei|Pierluigi Taddei]]
 +
* Vincenzo Caglioti
  
===== Other Politecnico di Milano people =====
 
''if any, other people participating to the project: e.g. Ph.D students''
 
  
T. Paccio - [[User:TaddeoPaccio]]
 
  
 
===== Students currently working on the project =====
 
===== Students currently working on the project =====
  
Giuseppe Onzo - [[User:GiuseppeOnzo]]
+
* Luigi Cardamone - luigi (dot) cardamone (at) mail (dot) polimi (dot) it
  
===== Students who worked on the project in the past =====
+
* [[User:PamelaGotti|Pamela Gotti]]
  
Vittoria Ittima - [[User:VittoriaIttima]]
 
  
===== External personnel: =====
 
''other people, specifying their role in the project and an e-mail address''
 
  
dott. B. Adguy (chief R&D scientist, BadCorp Ltd) - bill (dot) adguy (at) badcorp (dot) com
+
== '''Part 2: project description''' ==
  
=== Laboratory work and risk analysis ===
+
==='''State of the art'''===
''describe here what you actually do or will do in the AIRLab for your project; it is especially important to specify any activity that can lead to potential risks for you or other people and how you will ensure that no one is harmed. A list of potentially dangerous (if not correctly performed) activities is included into the [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] of the AIRLab, which you MUST know to work at the AIRLab.''
+
  
Laboratory work for this project will be mainly performed at AIRLab/Lambrate. It will include significant amounts of mechanical work as well as of electrical and electronic activity. Potentially risky activities are the following:
+
This project is based on the article ''Seam carving for content-aware image resizing, Avidan, S. and Shamir, A.,International Conference on Computer Graphics and Interactive Techniques, 2007'', in which the author describes content aware image resizing by removal of 8-connected path of pixels.
* Use of mechanical tools. Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.
+
* Use of soldering iron. Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.
+
* Use of high-voltage circuits. Special gloves and a current limiter will be used.
+
* Transportation of heavy loads (e.g. robot parts).  Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.
+
* Robot testing.  Standard safety measures described in [http://airlab.elet.polimi.it/index.php/airlab/content/download/461/4110/file/documento_valutazione_rischi_AIRLab.pdf Safety norms] will be followed.
+
* Death ray testing: on the robot will be mounted professor Azzoide's death ray projector. When testing it on live animals (e.g. pigeons, pigs, camels) we will make sure that people stay away from the test area.
+
  
== '''Part 2: project description''' ==
+
==='''The problem'''===
''Put here all the scientific and technical information about the project. Feel free to insert titles and sections as needed. Remember that [http://www.mediawiki.org/wiki/Help:Contents here] you can find help about wiki syntax.''
+
 
 +
The normal way of resizing a picture doesn’t take in account it’s content and differs from the resizing of a web page where each object is modified on the basis of its content. So, there is the need for an image resizing that is content aware.
 +
 
 +
==='''The Idea'''===
 +
 
 +
The idea behind content aware resizing is to treat in a different way the important regions of the image respect to those regions with less information. To achieve this goal it’s possible to remove from the picture the seam with low energy.
 +
A seam is a path of pixel from top to bottom or from left to right, as it’s possible to see in the following picture:
 +
 
 +
[[Image:Paesaggioconseam.JPG|center|thumb|An example of vertical connected seam|400px]]
 +
 
 +
==='''The Algorithm'''===
 +
 
 +
The implemented algorithms use different kind of seam and minimize different measure:
 +
* removing a 8-connected path of pixels (1-seam) minimizing an energy function
 +
* removing a not connected path of pixels (k-seam) minimizing an energy function
 +
* removing a 8-connected path of pixels (1-seam) minimizing the total energy variation in the image
 +
* removing a not connected path of pixels (k-seam) minimizing the total energy variation in the image
 +
 
 +
Where k seam are those seam with a maximum disconnection of k pixel. This disconnection is important when in the picture there are many object and it’s important to don’t cut their edges.
 +
 
 +
All these algorithms were implemented in Matlab and tested on several pictures (source code is available here: [[Media:Carving.zip|Carving source code]]
 +
). The project follows with  a comparative analysis of strength and weakness of each method.
 +
 
 +
==='''Report'''===
 +
 
 +
The report about this project is available here: [[Media:Relazione.pdf|Report]]
 +
 
 +
==='''Conclusion'''===
 +
 
 +
From results emerge that the best algorithm is that one working with 1-seam with minimum energy.
 +
 
 +
In the following pictures it is possible to see the difference between the result of the retargeting using the best algorithm and the normal resize method (stretching).
 +
 
 +
[[Image:ImageContentResizeDelfino.jpg|left|thumb|Original image|325px]]
 +
 
 +
[[Image:Delfino22.JPG|left|thumb|Resized image with streching|250px]]
 +
 
 +
[[Image:Delfino2 original connected.JPG|left|thumb|Resized image with 1-seam with minumum energy|250px]]
 +
 
 +
[[Image:Delfino2 original notconnected.JPG|left|thumb|Resized image with k-seam with minumum energy|250px]]
 +
 
 +
[[Image:Delfino2 final connected.JPG|left|thumb|Resized image with 1-seam with minumum energy variation|250px]]
  
Just to give you some ideas:
+
[[Image:Delfino2 final notconnected.JPG|left|thumb|Resized image with k-seam with minumum energy variation|250px]]
* state of the art;
+
* preliminary studies and sketches;
+
* design notes and guidelines;
+
* link to project documents and files (you can upload them using the [[Special:Upload]] page);
+
* description and results of experiments;
+
* photos and videos (they must have been uploaded with [[Special:Upload]] before you can insert them into this page);
+
* link to source code of the software written for the project (you can upload it with [[Special:Upload]]);
+
* advice about the configuration and the use of hardware and software;
+
* useful internet links;
+
* anything else that you think is useful to describe the project or could help people who will work on it in the future. Think about what ''you'' would have liked to find clearly explained when you started your work, instead of discovering it all by yourself the hard way. (By the way, if some of those missing information belong to other pages of this wiki, please update those pages: future users will be grateful.)
+

Latest revision as of 16:25, 16 June 2008

Part 1: project profile

Project name

Image retargeting by k-seam removal.

Project short description

This project presents a methodology for content aware image resizing based on seam removal. In this work four different approaches were implemented in order to retarget an image:

  • removing a 8-connected path of pixels (1-seam) minimizing an energy function
  • removing a not connected path of pixels (k-seam) minimizing an energy function
  • removing a 8-connected path of pixels (1-seam) minimizing the energy variation in the image
  • removing a not connected path of pixels (k-seam) minimizing the energy variation in the image

where k is the maximum disconnect allowed.

The work ends with a comparison on several test pictures among these algorithms considering the one which gives the best results.

Dates

Start date: 2008/01/01

End date: 2008/06/24

People involved

Project head(s)


Students currently working on the project
  • Luigi Cardamone - luigi (dot) cardamone (at) mail (dot) polimi (dot) it


Part 2: project description

State of the art

This project is based on the article Seam carving for content-aware image resizing, Avidan, S. and Shamir, A.,International Conference on Computer Graphics and Interactive Techniques, 2007, in which the author describes content aware image resizing by removal of 8-connected path of pixels.

The problem

The normal way of resizing a picture doesn’t take in account it’s content and differs from the resizing of a web page where each object is modified on the basis of its content. So, there is the need for an image resizing that is content aware.

The Idea

The idea behind content aware resizing is to treat in a different way the important regions of the image respect to those regions with less information. To achieve this goal it’s possible to remove from the picture the seam with low energy. A seam is a path of pixel from top to bottom or from left to right, as it’s possible to see in the following picture:

An example of vertical connected seam

The Algorithm

The implemented algorithms use different kind of seam and minimize different measure:

  • removing a 8-connected path of pixels (1-seam) minimizing an energy function
  • removing a not connected path of pixels (k-seam) minimizing an energy function
  • removing a 8-connected path of pixels (1-seam) minimizing the total energy variation in the image
  • removing a not connected path of pixels (k-seam) minimizing the total energy variation in the image

Where k seam are those seam with a maximum disconnection of k pixel. This disconnection is important when in the picture there are many object and it’s important to don’t cut their edges.

All these algorithms were implemented in Matlab and tested on several pictures (source code is available here: Carving source code ). The project follows with a comparative analysis of strength and weakness of each method.

Report

The report about this project is available here: Report

Conclusion

From results emerge that the best algorithm is that one working with 1-seam with minimum energy.

In the following pictures it is possible to see the difference between the result of the retargeting using the best algorithm and the normal resize method (stretching).

Original image
Resized image with streching
Resized image with 1-seam with minumum energy
Resized image with k-seam with minumum energy
Resized image with 1-seam with minumum energy variation
Resized image with k-seam with minumum energy variation