{"id":126526,"date":"2015-05-17T14:00:00","date_gmt":"2015-05-17T12:00:00","guid":{"rendered":"http:\/\/mybroadband.co.za\/news\/?p=126526"},"modified":"2015-05-15T15:18:15","modified_gmt":"2015-05-15T13:18:15","slug":"removing-reflections-from-photographs","status":"publish","type":"post","link":"https:\/\/mybroadband.co.za\/news\/gadgets\/126526-removing-reflections-from-photographs.html","title":{"rendered":"Removing reflections from photographs"},"content":{"rendered":"<p>It\u2019s hard to take a photo through a window without picking up reflections of the objects behind you.<\/p>\n<p>To solve that problem, professional photographers sometimes wrap their camera lenses in dark cloths affixed to windows by tape or suction cups.<\/p>\n<p>But that\u2019s not a terribly attractive option for a traveler using a point-and-shoot camera to capture the view from a hotel room or a seat in a train.<\/p>\n<p>At the Computer Vision and Pattern Recognition conference in June, MIT researchers will present a new algorithm that, in a broad range of cases, can automatically remove reflections from digital photos.<\/p>\n<p>The algorithm exploits the fact that photos taken through windows often feature two nearly identical reflections, slightly offset from each other.<\/p>\n<p>\u201cIn Boston, the windows are usually double-paned windows for heat isolation during the winter,\u201d says YiChang Shih, who completed his PhD in computer science at MIT this spring and is first author on the paper.<\/p>\n<p>\u201cWith that kind of window, there\u2019s one reflection coming from the inner pane and another reflection from the outer pane. But thick windows are usually enough to produce a double reflection, too.<\/p>\n<p>The inner side will give a reflection, and the outer side will give a reflection as well.\u201d<\/p>\n<p>Without the extra information provided by the duplicate reflection, the problem of reflection removal is virtually insoluble, Shih explains. \u201cYou have an image from outdoor and another image from indoor, and what you capture is the sum of these two pictures,\u201d he says.<\/p>\n<p>\u201cIf A+B is equal to C, then how will you recover A and B from a single C? That\u2019s mathematically challenging. We just don\u2019t have enough constraints to reach a conclusion.\u201d<\/p>\n<h3 class=\"my-4\">Thinning the field<\/h3>\n<p>The second reflection imposes the required constraint. Now the problem becomes recovering A, B, and C from a single D. 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.<\/p>\n<p>That constraint drastically reduces the range of solutions that the algorithm has to consider.<\/p>\n<p>Nonetheless, a host of solutions still remain.<\/p>\n<p>To home in on one of them, Shih and his coauthors \u2014 professors of computer science and engineering Fr\u00e9do Durand and Bill Freeman, who were Shih\u2019s thesis advisors, and Dilip Krishnan, a former postdoc in Freeman\u2019s group who\u2019s now at Google Research \u2014 assume that both the reflected image and the image captured through the window have the statistical regularities of so-called natural images.<\/p>\n<p>The basic intuition is that at the level of small clusters of pixels, in natural images \u2014 unaltered representations of natural and built environments \u2014 abrupt changes of color are rare. And when they do occur, they occur along clear boundaries.<\/p>\n<p>So if a small block of pixels happens to contain part of the edge between a blue object and a red object, everything on one side of the edge will be bluish, and everything on the other side will be reddish.<\/p>\n<p>In computer vision, the standard way to try to capture this intuition is with the notion of image gradients, which characterize each block of pixels according to the chief direction of color change and the rate of change.<\/p>\n<p>But Shih and his colleagues found that this approach didn\u2019t work very well.<\/p>\n<h3 class=\"my-4\">Playing the odds<\/h3>\n<p>Ultimately, they settled on a new technique co-developed by Daniel Zoran, a postdoc in Freeman\u2019s group. Zoran and Yair Weiss of the Hebrew University of Jerusalem created an algorithm that divides images into 8-by-8 blocks of pixels; for each block, it calculates the correlation between each pixel and each of the others.<\/p>\n<p>The aggregate statistics for all the 8-by-8 blocks in 50,000 training images proved a reliable way to distinguish reflections from images shot through glass.<\/p>\n<p>In their paper, Shih and his colleagues report performing searches on Google and the Flickr photo database using terms like \u201cwindow reflection photography problems.\u201d<\/p>\n<p>After excluding results that weren\u2019t photos shot through glass, they had 197 images, 96 of which exhibited double reflections that were offset far enough for their algorithm to work.<\/p>\n<p>\u201cPeople have worked on methods for eliminating these reflections from photos, but there had been drawbacks in past approaches,\u201d says Yoav Schechner, a professor of electrical engineering at Israel\u2019s Technion.<\/p>\n<p>\u201cSome 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.\u201d<\/p>\n<p>\u201cThe ideas here can progress into routine photography, if the algorithm is further robustified and becomes part of toolboxes used in digital photography,\u201d he adds. \u201cIt may help robot vision in the presence of confusing glass reflection.\u201d<\/p>\n<h3 class=\"my-4\">More on\u00a0photos<\/h3>\n<p><strong><a href=\"http:\/\/mybroadband.co.za\/news\/internet\/119562-google-reddit-to-ban-nude-photos-and-video.html\">Google, Reddit to ban nude photos and video<\/a><\/strong><\/p>\n<p><strong><a href=\"http:\/\/mybroadband.co.za\/news\/internet\/117080-israel-photobombs-lebanon.html\">Israel (photo)bombs Lebanon<\/a><\/strong><\/p>\n<p><strong><a href=\"http:\/\/mybroadband.co.za\/news\/security\/111416-viewing-hacked-nude-celebrity-photos-a-sex-crime.html\">Viewing hacked nude celebrity photos a \u201csex crime\u201d<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It\u2019s hard to take a photo through a window without picking up reflections of the objects behind you.<\/p>\n","protected":false},"author":340957,"featured_media":126528,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_sma_x_autopost_status":"idle","_sma_x_autopost_error":"","_sma_x_post_id":"","_sma_facebook_post_id":"","_sma_instagram_post_id":"","_sma_threads_post_id":"","_sma_x_attempts":0,"footnotes":""},"categories":[29],"tags":[8511,7699,22598],"class_list":["post-126526","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gadgets","tag-headine","tag-mit","tag-photography"],"_links":{"self":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/126526"}],"collection":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/users\/340957"}],"replies":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/comments?post=126526"}],"version-history":[{"count":1,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/126526\/revisions"}],"predecessor-version":[{"id":126530,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/posts\/126526\/revisions\/126530"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media\/126528"}],"wp:attachment":[{"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/media?parent=126526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/categories?post=126526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mybroadband.co.za\/news\/wp-json\/wp\/v2\/tags?post=126526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}