Fog Simulation and Refocusing from Stereo Images

Similar documents
Correspondence and Stereopsis. Original notes by W. Correa. Figures from [Forsyth & Ponce] and [Trucco & Verri]

DeepIM: Deep Iterative Matching for 6D Pose Estimation - Supplementary Material

CHAPTER 3 DISPARITY AND DEPTH MAP COMPUTATION

1. Introduction. Volume 6 Issue 5, May Licensed Under Creative Commons Attribution CC BY. Shahenaz I. Shaikh 1, B. S.

SINGLE IMAGE FOG REMOVAL BASED ON FUSION STRATEGY

EE368 Project Report CD Cover Recognition Using Modified SIFT Algorithm

Kinect Cursor Control EEE178 Dr. Fethi Belkhouche Christopher Harris Danny Nguyen I. INTRODUCTION

Depth Estimation with a Plenoptic Camera

Computer Vision I. Dense Stereo Correspondences. Anita Sellent 1/15/16

Motion Estimation. There are three main types (or applications) of motion estimation:

Statistical image models

Error Analysis of Feature Based Disparity Estimation

Fundamentals of Stereo Vision Michael Bleyer LVA Stereo Vision

Optimizing Monocular Cues for Depth Estimation from Indoor Images

Using temporal seeding to constrain the disparity search range in stereo matching

Robotics Programming Laboratory

EE795: Computer Vision and Intelligent Systems

Automatic Tracking of Moving Objects in Video for Surveillance Applications

Depth Estimation of Light Field Images by Optical Flow

Computer Vision I - Filtering and Feature detection

Foggy Scene Rendering Based on Transmission Map Estimation

Perceptual Quality Improvement of Stereoscopic Images

ECE 470: Homework 5. Due Tuesday, October 27 in Seth Hutchinson. Luke A. Wendt

lecture 10 - depth from blur, binocular stereo

DEPTH AND GEOMETRY FROM A SINGLE 2D IMAGE USING TRIANGULATION

CONTENTS. High-Accuracy Stereo Depth Maps Using Structured Light. Yeojin Yoon

Physics-based Fast Single Image Fog Removal

An Overview of Matchmoving using Structure from Motion Methods

Computer Vision I - Basics of Image Processing Part 1

Module 5: Video Modeling Lecture 28: Illumination model. The Lecture Contains: Diffuse and Specular Reflection. Objectives_template

Filter Flow: Supplemental Material

Coarse-to-fine image registration

Data-driven Depth Inference from a Single Still Image

Research on Clearance of Aerial Remote Sensing Images Based on Image Fusion

Rendering light propagation in an optically thick medium

Dominic Filion, Senior Engineer Blizzard Entertainment. Rob McNaughton, Lead Technical Artist Blizzard Entertainment

Subpixel Corner Detection Using Spatial Moment 1)

Computer Graphics 7: Viewing in 3-D

Compression of Light Field Images using Projective 2-D Warping method and Block matching

All forms of EM waves travel at the speed of light in a vacuum = 3.00 x 10 8 m/s This speed is constant in air as well

An Implementation of Spatial Algorithm to Estimate the Focus Map from a Single Image

Deep Learning-driven Depth from Defocus via Active Multispectral Quasi-random Projections with Complex Subpatterns

Flexible Calibration of a Portable Structured Light System through Surface Plane

Reconstruction of Images Distorted by Water Waves

Digital Makeup Face Generation

Why is computer vision difficult?

DEPTH ESTIMATION USING STEREO FISH-EYE LENSES

Introduction to Computer Graphics and Computer Vision Assignment 3: Due 7/27/2015

Filters. Advanced and Special Topics: Filters. Filters

V-RAY 3.6 FOR SKETCHUP KEY FEATURES

EE795: Computer Vision and Intelligent Systems

Single Image Dehazing with Varying Atmospheric Light Intensity

METRIC PLANE RECTIFICATION USING SYMMETRIC VANISHING POINTS

International Journal of Advance Engineering and Research Development

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Ray Tracing through Viewing Portals

Time-to-Contact from Image Intensity

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

A FAST METHOD OF FOG AND HAZE REMOVAL

On-line and Off-line 3D Reconstruction for Crisis Management Applications

Rendering Smoke & Clouds

EE795: Computer Vision and Intelligent Systems

Camera Registration in a 3D City Model. Min Ding CS294-6 Final Presentation Dec 13, 2006

Light Field Occlusion Removal

Correcting User Guided Image Segmentation

Camera Calibration. Schedule. Jesus J Caban. Note: You have until next Monday to let me know. ! Today:! Camera calibration

Lecture 2 Image Processing and Filtering

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

Data Term. Michael Bleyer LVA Stereo Vision

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Stereo Matching.

CONTRAST ENHANCEMENT ALGORITHMS FOR FOGGY IMAGES

Detecting and Identifying Moving Objects in Real-Time

Adaptive Zoom Distance Measuring System of Camera Based on the Ranging of Binocular Vision

When Big Datasets are Not Enough: The need for visual virtual worlds.

Computer Graphics. Ch 6. 3D Viewing

Detecting motion by means of 2D and 3D information

Application of Proximal Algorithms to Three Dimensional Deconvolution Microscopy

Scene Segmentation by Color and Depth Information and its Applications

Depth Measurement and 3-D Reconstruction of Multilayered Surfaces by Binocular Stereo Vision with Parallel Axis Symmetry Using Fuzzy

Fog and Cloud Effects. Karl Smeltzer Alice Cao John Comstock

Compression of Stereo Images using a Huffman-Zip Scheme

Scalable multi-gpu cloud raytracing with OpenGL

Final Project: Real-Time Global Illumination with Radiance Regression Functions

Range Sensors (time of flight) (1)

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Supplementary Material for Zoom and Learn: Generalizing Deep Stereo Matching to Novel Domains

A Qualitative Analysis of 3D Display Technology

Practice Exam Sample Solutions

V-RAY 3.6 FOR RHINO KEY FEATURES. January 2018

Usings CNNs to Estimate Depth from Stereo Imagery

Stereo Rig Final Report

Shadows in the graphics pipeline

Rendering and Modeling of Transparent Objects. Minglun Gong Dept. of CS, Memorial Univ.

I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S

GRID WARPING IN TOTAL VARIATION IMAGE ENHANCEMENT METHODS. Andrey Nasonov, and Andrey Krylov

Public Library, Stereoscopic Looking Room, Chicago, by Phillips, 1923

Camera Parameters Estimation from Hand-labelled Sun Sositions in Image Sequences

Transcription:

Fog Simulation and Refocusing from Stereo Images Yifei Wang epartment of Electrical Engineering Stanford University yfeiwang@stanford.edu bstract In this project, we use stereo images to estimate depth and use the depth information to refocus and simulate fog or smoke in the image. This type of simulation is useful for realistic scene rendering and animation. We use common techniques for depth estimation from stereo images and a novel extension of a known technique for fog simulation. I. Introduction key component of computer vision in a 3 world is depth estimation, the ability to determine the distance of various objects in a scene. This is necessary for augmented reality scenes to be rendered, for automated navigation, or any other task where a computer interacts with the real world. In addition to the practical purposes, depth estimation also allows for artistic applications, such as refocusing images and other similar effects. Noam Weinberger epartment of Electrical Engineering Stanford University noamw@stanford.edu combination of these, with greater weight given to the white image for pixels that are more distant. Guo, et al., [2] also use the atmospheric scattering model, but change the weights to be less homogenous, even across pixels at the same depth. They add Perlin noise to the fog, in order to add heterogeneity. epth estimation is also implemented using many different techniques. common technique, used for example by Scharstein and Szeliski, [3] is to use the disparity between stereo images. Two images are taken of the same scene, with slight displacement of the camera between capturing each image. The disparity of an object s position in each of the resulting images will be greater for objects closer to the camera. III. Pipeline Our pipeline performs two tasks: depth estimation and fog simulation. II. Related Work dding fog to images and 3 scenes has been implemented using various techniques. Sun, et al., [1] introduce a model intended to capture the physical properties of fog. They describe fog as water droplets in the air which scatter the ambient light. The more distant an object in the image, the more fog there is for the light from that object to travel through, and therefore the more the light is scattered. They model this with a combination of two images: the original, undistorted image and an entirely white (or gray) image representing the ambient light. Each pixel in the resulting image is a weighted Fig. 1 Pipeline, consisting of six steps The first step is getting the stereo images, for which we mainly used the Middlebury omputer Vision Stereo ataset [4]. From the stereo images, we calculate the disparity for each pixel, which is defined as the displacement of the pixel of the same

object. fter applying MM with a TV prior, we have the depth map. The weight map is calculated based on a physical model, which will be discussed in Section V. lending blurred image and the original image based on weight map gives us the rendered image. IV. epth Estimation The principle behind our depth mapping is dual vision. If the same object is observed by two cameras displaced slightly, the object in both images will also have a displacement in the same direction as the cameras (Fig. 2). 1 2 L(x, z, u ) = 2 V x x 0 + λ z 1 [ T z + 2 1 z 2 2] (4.1) + ρ u (x ) x In this formula, x is the calculated depth map, x 0 is the disparity map given. x is the gradient of x in both directions. [6] λ and ρ are coefficients in Lagrangian, in our experiment, they are set respectively as 10 and 0.05. V is a map of the degree of reliability for the pixels, for example, if the disparity of a pixel is invalid, then the corresponding element in V is 0. V is calculated as such: V = exp ( min x 2 { x neighbor 2} / ) (4.2) The disparity for invalid pixels are set as a very large negative value by default, which will result in a reliability of 0. Fig. 2 Illustration of disparity, which results from different angle of observation [5] ased on the stereo images (Fig. 3/, 4/), we used a disparity function in Matlab as the basis of disparity map, which takes into account only the displacement in horizontal direction. In addition to considering displacement in vertical direction, we calculated disparity in different color channels as well as gradient of pixels in both directions and take their average. (Fig 3, 4) ecause the disparity map is very noisy, and contains a lot of void pixels, whose disparity is not reliable. We applied alternating direction method of multipliers (MM) with a total variation (TV) prior, which uses the augmented Lagrangian: Fig. 3 Stereo images with a mannequin head. /: original stereo images; : disparity map; : depth map

Fig. 4 Stereo images with an indoor piano. /: original stereo images; : disparity map; : depth map The depth map (Fig. 3, 4) generated is much more uniform than the disparity map, while a few artificial points still exists. ut it is generally a good result for the next step. V. Fog Simulation and Refocusing In order to ensure that our fog simulation was working correctly, we applied it to the depth maps we produced, as well as ground-truth depth maps from the Middlebury dataset. For fog simulation, we used the atmospheric scattering model used by Sun, et al. [1], however we extended it further by adding a blurring factor. This extended model allows for refocusing and fog simulation to be implemented together or independently. It also can produce more realistic fog simulation, since atmospheric scattering also causes blur. Our model is expressed by the formula: J (x) = I (x) [ 1 W (x)] + [ α (x) + (1 α ) (x)] W (x) (5.1) I (x) is the original, undistorted image. (x) is the image after being blurred with a Gaussian kernel. (x) is an entirely white (or gray) image representing the ambient light. weighted combination of these three images creates J (x), the resulting image with simulated fog. The weighting of the images depends on W (x), which is described below, and α, a parameter controlling how much the fog adds light versus blur. If α = 1, there is only a refocus or localized blurring effect, and no ambient light. If α = 0, the fog has no blurring effect, and this formula becomes more similar to that used by Sun, et al. The weight matrix W (x) determines how much each pixel is drawn from the distorted image, rather than the original one. The weight matrix can be constructed in two ways: flat fog or local source. When producing a flat fog, W (x) depends only on the depth map. We used a similar formula to that used by Sun, et al.: W (x) = e 2.3 (x) (5.2) In this formula, (x) is the depth value at that pixel. This weighting allows for greater fog intensity at more distant pixels. When producing a local-source fog, this depth-based weighting is used and is multiplied with a weighting based on the position of the pixel. The formula in this case is: (x px) W (x) = e 2.3 (x) e σx e (y py) σy (5.3) In this formula, p x and p y are the chosen fog source location and σx and σy control how quickly the fog fades in each direction. Using this local-source fog allows for simulating smoke due to fire in a specific location, or some other kind of localization. To implement refocusing (bokeh effect), the rendered image and the weight matrix W(x) is calculated differently. First α in Eq (5.1) is set to 1. Then the formula used is: W (x) = 1 ( 1 In this formula, (x) f max (x) { f }) t (5.4) f is the reference depth, which is set to the depth where an object should be in focus. djusting will produce images with f different focal distance. djusting parameter t, the power coefficient (set to 6 in our code), will create

the effect of a camera with different depth of field. In short, this equation makes objects that are farther away from the focus have greater weight from the blurred image. It also ensures that the weight changes smoothly around the focus, like a real depth of field effect. Some results are shown in the images below: Fig. 7 Outdoor patio. : Original Image; : Image with general fog effect; : Image with a low intensity fog; : Image with fog effect localized near upper left corner VI. iscussion Fig. 5 Mannequin head. : Original Image; : Focused on background; : Focus on mid-ground; : Focused on foreground Fig. 6 Indoor piano. : Original Image; : Focused on the closest corner of the chair; : Image with general smoke effect; : Image with smoke effect localized near bottom left corner In conclusion, we built a pipeline for fog simulation and refocusing based on stereo images taken by two cameras displaced by a small distance. First, the disparity map was calculated based on the displacement of objects in both images and optimized by applying MM with TV prior. Then, based on the depth map, we blended the ambient light constant, blurred image, and original image together to produce a fog effect or bokeh effect. The physical model of fog we use is very comprehensive, by tuning the parameters we can simulate different fog simulation or control the range of fog for local source simulation. Refocusing effect is also realistic, but the blurring is only tuned by changing the ratio of original image and the blurred image. n improvement can be using a depth-based Gaussian filter. We also tried to build our own dual camera and used the image it obtained to implement pipeline. However, the images were very badly calibrated. Since the objects were too far away, they deformed differently in the images, which made the disparity map very difficult to calculate.

VII. References [1] Sun,., Kong,., He, L., and Tian, Q. n lgorithm of imaging simulation of fog with different visibility. 2015 IEEE International onference on Information and utomation, 2015. [2] Guo, F., Tang, J., and Xiao X. Foggy Scene Rendering ased on Transmission Map Estimate. International Journal of omputer Games Technology, 2014. [3] Scharstein,. and Szeliski R. Taxonomy and Evaluation of ense Two-Frame Stereo orrespondence lgorithms. International Journal of omputer Vision, 2002. [4] http://vision.middlebury.edu/stereo/data/ [5] http://www.jarnoralli.fi/joomla/research/topics/disparity [6] Wahlberg, o, et al. "n MM algorithm for a class of total variation regularized estimation problems." IF Proceedings Volumes 45.16 (2012): 83-88. VIII. cknowledgements We would like to thank Professor Gordon Wetzstein for his instruction in lectures this quarter. We would also like to thank Felix Heide for his advice and mentorship on this project.