Skip to main content

MIT scientists develop algorithm for removing reflections from photos

mit scientists develop algorithm for removing reflections from photos reflectionremoval
According to MIT, its “researchers have created a new algorithm that, in a broad range of cases, can automatically remove reflections from digital photos. On the left is the original photo taken through a window, with the photographer's reflection clearly visible. On the right, the reflection has been separated from the photo.” Credit: Massachusetts Institute of Technology
Whatever the scenario, we’ve all taken photos through windows hoping to capture that fleeting image: an arching rainbow from the car window, a person or car passing by a building window, or a priceless artifact behind museum glass. And when you go to view your photos afterward, you see that they have been marred by the reflections, which are usually of the photographer. Well, a group at the Massachusetts Institute of Technology may have found a solution to the problem after creating an algorithm that reduces the reflection in photographs.

Photos taken through windows or glass usually have two nearly identical reflections, one slightly offset from the other. Double-paned windows, as well as plain old thick windows, are often the culprits, says YiChang Shih, one of the MIT researchers who developed the algorithm. “With that kind of window, there’s one reflection coming from the inner pane and another reflection from the outer pane,” Shih says. “The inner side will give a reflection, and the outer side will give a reflection as well.”

So, the algorithm looks at the values for images inside the glass and outside of it, and attempts to correct it so that it looks the way it was intended. “You have an image from outdoor (A) and another image from indoor (B), and what you capture is the sum of these two pictures (C),” Shih says, who presents the problem as a complex mathematical challenge in then trying to recover A and B data from C.

“But the value of A for one pixel has to be the same as the value of B for a pixel a fixed distance away in a prescribed direction. That constraint drastically reduces the range of solutions that the algorithm has to consider,” MIT News writes.

The process in really technical, but in short, the algorithm uses a technique developed at Hebrew University of Jerusalem in Israel that analyzes the colors of the images by breaking them into 8 x 8 blocks of pixels, calculating “the correlation between each pixel and each of the others.” Out of 197 images from Google and Flickr that they tested the algorithm on, 96 worked. (Check out MIT News for a more detailed explanation.)

“People have worked on methods for eliminating these reflections from photos, but there had been drawbacks in past approaches,” Yoav Schechner, a professor of electrical engineering at Israel’s Technion, told MIT News. “Some methods attempt using a single shot. This is very hard, so prior results had partial success, and there was no automated way of telling if the recovered scene is the one reflected by the window or the one behind the window. This work does a good job on several fronts.”

“The ideas here can progress into routine photography, if the algorithm is further ‘robustified’ and becomes part of toolboxes used in digital photography,” Schechner adds. “It may help robot vision in the presence of confusing glass reflection.”

The MIT researchers will present the algorithm at the Computer Vision and Pattern Recognition conference in Boston, in June. The research is still in its early stages, but over time, we could see it embedded into digital cameras and smartphones, or photo software, and do away with unwanted reflections once and for all.

Editors' Recommendations

Enid Burns
Enid Burns is a freelance writer who has covered consumer electronics, online advertising, mobile, technology electronic…
How to remove location data from your iPhone photos
How to transfer photos from an iPhone to an iPhone

We all love making memories, and a great way to collect those memories is to take a quick snap of a gorgeous landscape, a party in full swing, or a particularly incredible meal. The Apple iPhone now also adds a location to your pictures, meaning it can collate those images together into a location-themed album, or show you all the shots you've taken in a specific location. It's a fun little addition, and it's one that adds a lot of personality to the Photos app.

Read more
‘Photoshopped’ royal photo causes a stir
The Princess of Wales with her children.

[UPDATE: In a message posted on social media on Monday morning, Princess Kate said that she herself edited the image, and apologized for the fuss that the picture had caused. “Like many amateur photographers, I do occasionally experiment with editing," she wrote, adding, "I wanted to express my apologies for any confusion the family photograph we shared yesterday caused."]

Major press agencies have pulled a photo of the U.K.’s Princess of Wales and her children amid concerns that it has been digitally manipulated.

Read more
Nikon sale: Get up to $700 off select Nikon cameras and lenses
nikon d780 review product  1

Crutchfield has a huge sale on many different Nikon cameras with some of the best camera deals that we’ve seen in a while. With nearly 30 different items in the sale, the best thing that avid photographers can do is take a look for themselves. However, if you want a little insight before you dive in, take a look at what we have to suggest below.

What to shop for in the Nikon sale
Nikon makes some of the best DSLR cameras around with our overall favorite -- the -- available for $2,197 reduced from $2,297. The camera is perfect for both photographers and videographers with a 24.5-megapixel full-frame image sensor. Its rugged magnesium-alloy body is weather-sealed against dust, dirt, and moisture so it’s great for all occasions. The Nikon EXPEED 6 image processor is optimized for low-light performance while maintaining long battery life with an autofocus sensor module with support for 51 focus points. You just need to add a lens to reap the benefits with features like the 273-point phase-detection AF system detecting and tracking subjects throughout the entire frame.

Read more