Live data from Hacker News

Parallel Seam Carving

shwestrick.github.io

31–39 of 39 posts

Re: Parallel Seam Carving

#31
post #13
post #2

That's really neat. What are some practical applications for Seam Carving? Maybe in video games with dynamic resizing of landscapes?

I have a photo of my friend, his ex-wife and a few others standing together on a camping trip. I wanted to share that photo with the group since it was the tenth anniversary of that trip, but didn't want to remind my friend of his divorce, so I used seam carving to elide his ex-wife. (The tool I used allows you to paint areas of low or high energy.) The result was almost seamless (pun intended) and you wouldn't notic…

This is a SAAS product if ever there was one

Re: Parallel Seam Carving

#33
post #14

Earlier quoted context omitted.

That... that was mind-blowing. This discovery is 13 years old. Although it has clear limitations when it comes to humans, I'm surprised I don't see this kind of resize feature available in more software. Does Photoshop have this hidden in a drawer somewhere? Does imagemagick support this?

You will probably see it appear everywhere in 10 years when the patent expires. https://patents.google.com/patent/US8213745B2/en

What prevents someone outside the US from using this?

Re: Parallel Seam Carving

#34
You can divide the work into twice as many independent chunks of the same size like so:

If you were going to divide the image into K horizontal strips of triangles, instead divide the top half into K/2 horizontal strips of triangles and divide the bottom half into K/2 horizontal strips of triangles. To make things easier at the end, please include a 1px tall overlap between the top and bottom parts. Work downward from the top and upward from the bottom until you reach the middle. At the middle, for each column, you have the cost of the top half of the minimum seam that includes that pixel and the cost of the bottom half of the minimum seam that includes that pixel. So you can add those together then take the min as before.

Re: Parallel Seam Carving

#38
A related idea would be “image summarization”, i.e. an (as-yet hypothetical) technique for generating an image that’s an “icon” of a larger image. In the same sense of “icon” as the one visual designers are trained to create: one where both large-scale structure (shape+color) and fine-scale structure (texture) are preserved, while “redundant” detail is sacrificed, in order of least to most important for visual recognition by a human or image-classifier model. You could also call this a type of psycho-visual compression, in the same vein as chroma subsampling.

Simply resampling an image smaller keeps the large-scale structure (the shape and color), but loses the fine-scale structure (texture.) That’s why we don’t just resample photos down to 32x32 and use them as icons :)

Seam Carving (whether parallel or not) does the opposite: it preserves the fine-scale structure (texture) but distorts the large-scale structure (shape.)

But not always! The amount of shape distortion in Seam Carving is worst case O(N) with the number of seams deleted, but best-case o(1). It depends on the algorithm’s choices of seam.

Regular iterative Seam Carving, as described by its original paper, isn’t stateful-enough to be able to minimize any whole-image quality (like loss of large structure.) So it’s no surprise it hasn’t been used for something like this.

But parallel Seam Carving might just be the ticket for this problem. A model could be trained to select an optimal set of seams that work together to minimize the large-structure deformation of the image (i.e. the image’s lower-band difference in frequency-space), while also individually being low-entropy seams from the Seam Carving algorithm’s perspective.

Anyone want to take a crack at this?

Re: Parallel Seam Carving

#39
post #13
post #2

That's really neat. What are some practical applications for Seam Carving? Maybe in video games with dynamic resizing of landscapes?

I have a photo of my friend, his ex-wife and a few others standing together on a camping trip. I wanted to share that photo with the group since it was the tenth anniversary of that trip, but didn't want to remind my friend of his divorce, so I used seam carving to elide his ex-wife. (The tool I used allows you to paint areas of low or high energy.) The result was almost seamless (pun intended) and you wouldn't notic…

Stalin would have loved this ability /s
Post reply on HN