Slashdot Mirror


Content-Aware Image Resizing

An anonymous reader writes "At the SIGGRAPH 2007 conference in San Diego, two Israeli professors, Shai Avidan and Ariel Shamir, have demonstrated a new method to shrink images. The method is called 'Seam Carving for Content-Aware Image Resizing' (PDF paper here) and it figures out which parts of an image are less significant. This makes it possible to change the aspect ratio of an image without making the content look skewed or stretched out. There is a video demonstration up on YouTube."

7 of 174 comments (clear)

  1. Gimp! by larry+bagina · · Score: 5, Interesting

    Although they demonstrated on Windows, a friend of mine is one of their graduate students and was peripherally involved. He said it was originally developed as a GIMP plug in, but moved to a separate Windows app to show off the realtime resizing, etc. Hopefully they'll release the GIMP plugin? More likely Adobe will write them a check and license it to make sure that never happens.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  2. Re:nice! by aliquis · · Score: 5, Funny

    I'd never understod this hate-your-ex-thing? The person where part of your life for some time but you have decided to hate it and want to erase it from it?
    Better never get a partner then at all if you are going to hate the person once it doesn't work longer.

    But then I'm a regular slashdot visitor and don't have any exs so what do I know.

  3. Re:The paper via ACM by Anonymous Coward · · Score: 5, Informative

    I used a lossy compression algorithm on their paper and got this...

    Shrink image:
    Step 1: Run an edge detection algorithm.
    Step 2: Find minimal energy (least amount of edges crossed) path from top to bottom or left to right (graph-cut algorithm).
    Step 3: Remove pixels along that path.
    Step 4: Repeat steps 2 and 3 as necessary.

    Extend image:
    Step 1: Run an edge detection algorithm.
    Step 2: Find minimal energy (least amount of edges crossed) path from top to bottom or left to right (graph-cut algorithm).
    Step 3: Insert pixels along that path (interpolated from neighbors)
    Step 4: Repeat steps 2 and 3 as necessary.

    Remove objects:
    Step 1: Run an edge detection algorithm.
    Step 2: Mask object by giving its pixels low/negative energy values.
    Step 3: Find minimal energy (least amount of edges crossed) path from top to bottom or left to right (graph-cut algorithm).
    Step 4: Remove pixels along that path.
    Step 5: Repeat steps 3 and 4 as necessary.

  4. Re:A picture speaks a thousand words... by Fred+Ferrigno · · Score: 5, Informative

    It's not removing any more pixels than normal resizing or cropping would, it's just doing it such that the least important ones are removed first. Instead of:

    he uic bownfoxjumed verthelaz yelowdog

    You get:

    Th qik brwn fx jmpd ovr th lzy ylo dog

    Which reduces the total size by the same amount, but retains more information than treating every bit of information the same.

  5. My Implementation by The+New+Andy · · Score: 5, Interesting

    I thought it was pretty cool, so I made my own version after seeing the video. It obviously won't be as awesome as their one, but if you want to play around with it, you can get my C source and have a play around. It is GPL3.

  6. Re:The paper via ACM by Anonymous Coward · · Score: 5, Insightful

    I think you've got it except for a small detail in the "Remove objects", which the narrator alludes to around timestamp 4:01 of the video. You might want to add:

    Step 6: Extend image to match original size using the previous extend image algorithm

    (Of course, I leave the obligatory Profit step as an exercise for the reader).

  7. Re:A picture speaks a thousand words... by random735 · · Score: 5, Interesting

    while this is technically true, you're also rearranging the relative positioning of those pixels. cropping something out doesn't change the relationship of what is left in the photo (though it may remove critical details).

    if you have 3 people in a picture and you crop it down to 2, you've erased a person, but you haven't changed who is seated next to whom. if you use this method and the middle person is erased, you make it appear as though the outer two people were in fact seated next to each other when they weren't.

    we are used to the idea that a picture can be cropped (mentally considering what might be just outside the frame). We aren't yet used to the concept that the photo has effectively been cut and pasted together to create new relationships between the objects in the photo (though of course photoshop is getting us there).

    to continue your analogy, if we take:
    the quick brown fox jumped over the lazy dog

    and drop letters, we can create:
    the cow jumped over the dog

    whereas "cropping" might let us say:
    the quick brown fox jumped

    I think it's clear that one of these is more misleading than the other, though in both cases you're just removing information. (in one case, some of that information happens to be spaces between letters/words)