Seam Carving for Content-Aware Image Resizing

RayAlome shared this video with me: Advanced Photo Resizing

Don’t let the boring title fool you, this video is amazing.

Technology by Ariel Shamir of the Efi Arazi School of Computer Science in Israel.

I’ve got to say, this software is rather amazing. Appears to have been presented during SIGGRAPH 2007 by Shai Avidan (Mitsubishi Electric Research Lab) and Ariel Shamir (The interdisciplinary Center & MERL). As the disclaimer suggests, I wasn’t too attracted to the title and it sounded somewhat boring. However, as I was watching the video, it never stopped to amaze me how awesome the software/algorithm they wrote did.

Image resizing has always been a problem. When you scale down an image, you lose too much important information and when you enlarge images you get pixelation. This new technique appears to be able to fix both those problems.

It’s hard for me to explain what exactly is going on, but by looking at the levels and gradients and other ways computer sees images that humans don’t, they label areas of the pictures to be high energy and low energy. When you resize an image today, you generally remove 1 vertical or horizontal line every few lines. However, that leaves you image jaggedly and funky looking, especially if you’re not resizing to same aspect ratio.

By find finding these high and low energy zones, they are able to remove a seam (non-straight line) that is the lowest possible energy as defined by the user. So as you stretch or shrink the image, the algorithm automatically calculates what to add and what to remove, leaving the image in the crispest and sharpest state possible. I also really enjoyed the ability to give positive or negative weights to area I want to remove and keep, allowing me to remove people I don’t in an image, and keeping those I want. Take that you bystander who always seems to appear randomly in my digipix.

I don’t really truly get how the algorithm works for enlarging pictures. It mentioned it find the lowest energy seam and expand that and interpolate the colors to match the area. However, I assume if you’re adding to a lowest energy area already, it’ll remain the lowest energy area. However, during the demo of stretching the image. You could clearly see the lowest energy seam doesn’t remain the same. Oh well, guess we’ll have to wait for the paper to be released to see what’s going on.

But can you imagine if browsers, photo viewers, or even thumbnail generators utilized this algorithm? That would be so sweet!

I brought up the point of apply this to video as it sounded a very cool area to apply this. Imagine watching YouTube videos without the blurriness and shrinking only removes the useless areas. Or stretching a video from 640×480 to 1920×1080 to make it HD. Haha. I would really want to see what a movie would look like then.

Anyway, another interesting SIGGRAPH 2007 presentation was the Scene Completion Using Millions of Photographs by James Hays and Alexei A. Efros from Carnegie Mellon University.

Abstract

What can you do with a million images? In this paper we present a new image completion algorithm powered by a huge database of photographs gathered from the Web. The algorithm patches up holes in images by finding similar image regions in the database that are not only seamless but also semantically valid. Our chief insight is that while the space of images is effectively infinite, the space of semantically differentiable scenes is actually not that large. For many image completion tasks we are able to find similar scenes which contain image fragments that will convincingly complete the image. Our algorithm is entirely data-driven, requiring no annotations or labelling by the user. Unlike existing image completion methods, our algorithm can generate a diverse set of image completions and we allow users to select among them. We demonstrate the superiority of our algorithm over existing image completion approaches.

Yet another really interesting algorithm. This one allows you to fill in an missing area or remove unwanted objects from a photo and have it filled in with something else. Solves quite a different problem from the former, yet I was really astonished by the results in their paper and presentation.

The algorithm scans through thousands if not millions of images to see if there’s a match that would fill in the whole in your image. I like the results. Building not match the surround, remove it. Construction vehicles obstructing the view, remove it. This is fun!

Assembly Line For Lego Cars

I got this link from Digg: Production Line Built From Legos Builds Lego Cars and just as the author claims, “Consider my little Lego geek mind blown.”

Do check out the video: Mindstorms Autofabrik, where this guy (or maybe girl) built a car producing factory out of Legos. You can even customize what color you want your Lego car to be! With a few simple pushes on the Lego buttons to define the colors, this factory first goes and retrieves the building blocks for your car color. Then it presses on to a board to construct the base of the car. Finally wheels are added and the top of the car completes the building. The car even gets a test drive as it leaves the building!

Did I mention how my little mind was completely blown!?!?! People say that modern Legos have taking out the imagination out of Legos, but my GOD, if this isn’t pure imagination, I don’t know what is!

Awesome Wedding Proposal

SueOn sent me this blog entry: Sara and I just got engaged! This was a pretty awesome wedding proposal and was really fun to watch. Do check out the video: My Early Muir Owl.

In the beginning of the clip, he tells of the setup:

Sara was told the artist, “Serge Gandaora” was exhibiting new work at a gallery called, 40000, in Chicago.

The piece was called “My early muir owl”.

Little did she know that it was all an elaborate ruse.

Turns there are quite a few anagrams used in this production.

  • Serge Gandaora = George and Sara (or Sara and George)
  • My early muir owl = Will you marry me
  • I tuba fuel = Beautiful

I couldn’t really find “I tuba fuel” in the video. I’m assuming it’s a common anagram and someone in the comments just mentioned it.

It was awesome to see how Sara’s expression slowly changed after looking through the top pane. First she was surprised to see that the weird objects actually formed letters and words. Then it semi-hits and she’s shocked when she realizes the artist wrote the message, “Will you marry me?” . Then when she sees George kneeling on the floor and realizes the artist was George, she becomes super shocked. Then everyone’s happy.

I pointed out that there was a bottom looking pane (which probably saw nothing), but was meant for George to get in position (kneeling) and hold out the ring. Very sweet.

Too bad they didn’t have real live footage of actual revealing, though the pictures did reveal a lot. Then again with these snapshots of freeze in time, it did have a very strong feeling of capturing the moment. Overall, it was a fantastic wedding proposal.

If you enjoyed the soundtrack, the song is actually called Sæglópur by Sigur Rós. You can watch the music video on YouTube: Sigur Ros – Saeglopur. I listened to a couple other songs by them and they’re actually rather nice and soothing.

Topless Car Wash

I was reading this article: Not the topless car wash they expected

Male drivers who paid $5 for a topless car wash ended up getting hosed. Young women held up signs along a parkway advertising the car wash on Sunday and telling the drivers where to go. But hidden behind a big blue tarp, it was shirtless male firefighters who were washing the cars.

Which totally reminded me of the The Man Show, which had a clip with almost the same thing: Topless Car Wash. Instead of male firefighters, it had big fat men with tons of blubber. You could tell some of the patrons were pissed. Even the price was the same. I wonder if they got the idea from The Man Show.

New Chinese Phrases

So I was reading this article: Modern marriage and mortgages enter Chinese lexicon and helped me remember a discussion I had with my dad awhile back. I had asked him, if there’s been any new Chinese character for the past few hundred years, or has it always been the 5000 or some that has been standardized in one of the earlier dynasties. This is referring to Traditional Chinese, as I believe Simplified Chinese has drop that amount to about 2000 characters, which is still quite a handful for anyone wanting to learn.

My dad doesn’t think that any new characters have been added to the Chinese dictionary. This however differs from phrases. Any new concept or idea, people use existing Chinese characters to form up a new phrases to represent the new concept or idea. For example, computer is 電腦 (dian4 nao3) which literally means electric brain. The monitor is called 螢光幕 (ying2 guang1 mu4) which translates to fluorescent screen.

I always like to see how Chinese evolves with new sayings and understanding how they come about is always fun.

The new phrases mentioned in this article are:

  • Economic reforms and soaring rates of home ownership have coined a new moniker for the tribe of youth struggling to pay off home loans in traditionally debt-wary China: “fang nu,” or “house slaves”. 房奴 (fang2 nu2) which as they stated correctly does translate to house slave.
  • And young, married professionals who live in separate homes to keep the romance alive and maintain their own space have been branded “Semi-honey couples” (“ban tang fu qi”), the official Xinhua news agency said, citing education officials. 半糖夫妻 (ban4 tang2 fu1 qi1) which translates to half sweet couples.
  • “Young Chinese moving in fashionable circles often drop phrases like ‘duan bei’, with a literal meaning of ‘brokeback’,” to euphemistically refer to male homosexuals, Xinhua said. 斷背 (duan4 bei4) which translates to broken back. I found it very interesting they’re using this phrase to refer to homosexual people and is a clear example of how Hollywood has affected the Chinese language.
  • The emergence of city-dwelling couples choosing a pet over children had seen the use of “ding chong jia ting,” in Chinese, or “DINKS with pets,” in English, the report added. 丁寵家庭 (ding1 chong3 jia1 ting2) actually uses a Chinese character (丁 – ding) to represent the DINK acronym. 寵 means pet and 家庭 means family, and as suggested earlier, it means double income no kids with pets.

Silk Trailer Music

I was watching the new trailer for Silk and I found the music near the end to be very beautiful. As you might’ve guessed, I’m very big on scores and soundtrack music. You can watch the trailer at HD-Trailers.net or Yahoo! Movies.

You can read my comments of the trailer on my HD-Trailers.net blog.

This blog entry is to share with you the song that I found to be very amazing. The music isn’t available to be purchase or download yet, so I’ve ripped it from the trailer: Silk Trailer Music.

silk trailer music

According to someone on the IMDb forums, this is an original score for this movie done by Ryuichi Sakamoto (坂本 龍一).

It is believed to be original score for the movie, done by Ryuichi Sakamoto, who contributed music for Babel.

From Wikipedia:

In 2007, the soundtrack album for Silk, the French-Canadian production will be released. Silk tells the story of a married silkworm merchant-turned-smuggler in 19th century France traveling to Japan for his town’s supply of silkworms after a disease wipes out their African supply. During his stay in Japan, he becomes obsessed with the concubine of a local baron.

I tried searching for it on Amazon.com, but wasn’t able to find it. I can’t wait for the soundtrack to be released.

Seattle Street of Dreams 2007

So every year around the Seattle area, there’s this thing called Seattle Street of Dreams, where 5 or 6 builders build these luxurious houses and showcases them off for a couple months, and then sells it off. These houses are usually over $1 million and according to Derek, one last year went for $6 million. These years houses ranged from $1.7 million to $2 million. Derek thinks that’s because the house market has slowed down and the fact that one or more houses didn’t get sold last year, might’ve made builders a bit scared of building extremely expensive homes.

Derek was talking about secret hidden rooms (like the ones you see in Batman), and it had pool tables and poker tables, and from the outside, you wouldn’t know there was a room there at all. Unfortunately, this year they didn’t have any of that. I think one of the main topics this year was Green and how to make house more environment friendly. I didn’t really see that much environment friendly things. I mean, it doesn’t even have solar panels.

I also got to see Dan’s kid and Matt’s kid. They’re both so cute, yet look like quite a handful. I nudged Derek and ask him when little Dereks will be coming out.

So I took a lot of pictures. You can check out the pictures I took in my photo gallery: Seattle Street of Dreams 2007

Here are few cool ones:
la belle fleurla belle fleur living roomla belle fleur patiola belle fleur 8 person showergreenleaf retreat dining roomgreenleaf retreat patiogreenleaf retreat patio fireplacegreenleaf retreat waterfallgreenleaf retreat living roomgreenleaf retreat media roomgreenleaf retreat snowboard benchcopper fallscopper falls sinkcopper falls game roomtamarack fountaintamarack nooktamarack living roomthe urban lodge nook

I personally like the Greenleaf Retreat the most (House #2). It had a very modern look and the inside look quite grandeur. One thing I realized was that outside patios apparently is a very big thing…

Afterwards, Derek, Shanna and I decided to go get coffee at Starbucks. On our way there, Tekman gives me a call and tells me that he’s in front of my house. I had picked up some Nintendo Wii component cables for Xyon and him at Monoprice, and they were there to pick it up. One problem, I wasn’t at home. They thought about calling me, but didn’t want to wake me up, so decided to just drop by unexpectedly. I had IM Tekman the night before telling him since I was going to be up there, I could just drop off the cables. Apparently that’s no longer his primary screenname. I’ve bumped that screenname down a level and moved his cell screenname to the top. I told him to meet us at Starbucks and with the help of Xyon’s GPS system, they got to us with no problems. We sat around and just chatted for awhile, enjoying the nice day when the forecast had expected rain.

Speaking of not waking me up, I had actually gone to bed at 6:30am the night before, and my alarm clock went off at 9:30am. Didn’t actually make it out of bed till 9:48am and thought I was going to be late. Fortunately, Derek was going to be late also.

Pineapple, Raspberry & Orange Sherbet

So while browsing through the ice cream aisle today at Safeway, I decided I was going to get a sherbet today. I’ve been longing the flavor of Rainbow Sherbet for quite awhile now, however I was never able to find it in a size that I can consume or a flavor that I like.

So I’m usually turned off by most things (besides milk) that say low fat. I hate low fat cookies. I hate low fat ice cream. I hate diet sodas. Even with milk, I need reduced fat 2%. However at Safeway today, the choice was either a big gallon or 5qt Rainbow Sherbet which I’d probably get sick of before I’m done, or Safeway Select Low Fat Sherbets. Dreyers also had a couple, but they were single fruit flavors and I wanted a mix of fruit flavors. Dreyers were also low-fat.

So I ended up picking up the Safeway Select Pineapple, Raspberry & Orange Sherbet, and to my surprise, it actually tasted really good. They even had tiny pineapple chunks. Accordnig to Edy’s Grand Rainbow Sherbet Ice Cream, the description of Rainbow Sherbet is A refreshing mix of orange, pineapple, and raspberry flavors. Those are the exact same fruit flavors as the one I got! Although this ice cream did have a slight rainbow flavor, it felt like something was still missing from it. It could be that I haven’t had Rainbow Sherbet for many years now and have just forgotten what it taste like.

So I was talking to Ungsunghero about this and it turns out that sherbets are just low fat in general, due to the less milk content. I looked at the ice cream carton again and it does say “naturally” low fat. I guess I shouldn’t be afraid of low fat sherbets anymore.

Our conversation got back to Thrifty (now Rite Aid) ice cream and it turns out that Rite Aid sells their own brand of ice cream. My mom used to really like this ice cream that had coconut flavor and pineapple chunks, which I was quite fond of too. I mean those are the main components of piña colada (yes, I knew that before Ungsunghero told me), but I was pretty sure the ice cream flavor wasn’t called piña colada. Ungsunghero says it’s called pineapple coconut and apparently I can purchase it from Rite Aid in a carton from the freezer section. I personally never really buy food from Rite Aid, but with this new knowledge, things may need to change.

Server Downtime Earlier

My website was down beginning last evening till this afternoon. Dreamhost apparently had some DNS issues which took forever to resolve. Outlook kept complaining that it couldn’t connect to my email server. When the DNS issues were finally starting to resolve, I started getting my emails in chunks as email servers retried sending them to me. I also got back a bunch of unable to send emails (people spamming using my domain). I’m guessing these emails were also trying to reach other Dreamhost customers.

Everything’s back up now, but I’m starting to get tired for all this Dreamhost nonsense. I’ve decided that after my contract is up, I’m probably going to switch over to 1&1 and purchase a business plan. Space and bandwidth might not be as much, but I’m only using 8GB out of 256GB on Dreamhost. I use about 65GB/month, but my plan comes with over 3,000GB. For the 1&1 Business plan that I plan to upgrade to, for about the same $10/mo plan, I still get 250GB of webspace and 2,500GB of bandwidth.

Plus the fact that I haven’t seen 1&1 down for half a day has really given me confidence during the past 3 years that I’ve used them.

You know something’s gone awry when DreamHost has to offer a new add-on for $15 more per month so that you can get guaranteed CPU and memory. I got an email awhile back introducing DreamHost Private Servers. For $23/month (assuming you’re on the 2 year contract for $7.95/mo), you get a guaranteed 150MHz CPU and 150MB of RAM.

For that amount, I can get a 1&1 Developer Hosting package.

You know, DreamHost is the first webhosting service I’ve hit into CPU/memory issues and it hasn’t always been like this. My gallery and blog used to coexist fine on the same account. Now I have to split them apart because combined, they’re consuming too much resources for 1 account.

Many people have said they oversell their web hosting, but I’ve always thought, who doesn’t? But I’ve never hit a problem until a few months ago, that I was getting 500 Internal Server Errors because they have a CPU/memory monitor program that kills anything that exceeds a certain CPU usage during peak hours. One person even calculated if he was to serve a static page 24/7 at the sustainable speed and below the CPU/memory requirements, he’d never be able to reach the allotment of bandwidth that he has purchased. I can’t find that blog entry anymore, but I did find this: Dreamhost Sucks At Hosting