i stereoscopic focus mismatch monitoringdevernay.free.fr/publis/pujades-cvmp2011-poster.pdf · the...

1
INRIA PRIMA Team Laboratoire Informatique de Grenoble UMR 5217 Mail: {sergi.pujades-rocamora,frederic.devernay}@inria.fr Inria Grenoble - Rhˆ one Alpes 655 Av de l’Europe 38330 Montbonnot-Saint-Martin Stereoscopic Focus Mismatch Monitoring Sergi Pujades Rocamora - Fr´ ed´ eric Devernay Abstract We detect focus mismatch between views of a stereoscopic pair. First, we compute a dense disparity map. Then, we use a measure to compare focus in both images. Finally we use robust statistics to find which images zones have different focus. We show the results on the original images. Introduction Live-action stereoscopic content production requires a stereo rig with two cameras precisely matched and aligned. While most deviations from this perfect setup can be corrected either live or in post- production, a difference in the focus distance or focus range between the two cameras will lead to unrecoverable degradations of the stereoscopic footage. Measuring the focus at a point in an image is an ill-posed problem, since it may be the in-focus image of a non-textured point in the scene. We consider that the captured image is the result of the application of the focus blur on an image with infinite depth of field. Assuming parallel (or near-parallel) cameras the focus value should be dependent on depth, and thus on disparity. It can be shown that the focal blur size is linear with the stereo disparity, as seen in the figure below. 1 depth of field (DOF) disparity (d) focus distance (FD) focal blur size (σ ) In Focus Out of Focus The difference of focal blur between two images, as a function of disparity, has one of the following nine different shapes. FD l < FD r FD l = FD r FD l > FD r DOF l < DOF r d σ d σ σ d DOF l = DOF r d σ d σ d σ DOF l > DOF r d σ d σ d σ Legend : Left focal blur Right focal blur Focal blur difference Despite the fact that we cannot measure the focal blur directly, but only image blur, the sign of image blur difference has the same sign as the focal blur difference. We can thus use this function to measure focus mismatch. Algorithm Outline 1. Compute dense disparity map. 2. Measure focus mismatch. 3. Model the focus mismatch measures. 4. Draw mismatched areas on the original images. Disparity map computation We first compute a dense disparity map. Since images may differ in focus, we use a real-time multi- scale method [3] which finds good disparity values even between focused and blurred textures. We also compute semi-occluded areas by left-right consistency check, and ignore them in the following computation. Let d(i) be the disparity of pixel i =(x, y ). Focus Mismatch Measurement In order to compare the focus of corresponding points from the left and right images we use the SML operator (sum of modified Laplacian [1, 2]) which was primarily designed for depth-from-focus applications, SML(i)= x+N X r =x-N y +N X s=y -N 2 M (r, s), for 2 M (r, s) T 1 , where 2 M I = 2 I ∂x 2 + 2 I ∂y 2 . For a pixel i in the left image, SML l (i) is the SML operator computed at this pixel, and SML r (i) is computed at the corresponding pixel in the right image. Let M (i) be the sign of the difference of SML between two pixels: M (i) = sign(SML l (i) - SML r (i)). It is positive if left is more focused than right, and negative if right is more focused than left. Let w(i) be the max of SML l (i) and SML r (i): w(i) = max(|SML l (i)|, |SML r (i)|). It is high if one image is textured and in focus, which tells us where reliable information is. For each disparity value of the scene, M (d) is the mean of those differences at disparity d weighted by w(i), and w(d) is the corresponding sum of weights. This gives us an estimate of which image is more focused at disparity d. However this estimate may be very noisy : The disparity information may be inaccurate, which leads M (i) to be wrong. Focal blur bleeds over depth discontinuities : background objects may be wrongly measured as blurred. The number of measures for each disparity depends highly on scene content and information may even be missing for some disparity values. In order to tackle these problems we perform a model estimation to obtain robust information. Focus difference model estimation Given the measures M (d) and w(d) we fit a model C (d) minimising the energy E = X d w(d)E data (d)+ λE smooth (d), with E data (d)= M (d) - C (d) and E smooth (d)= |C (d - 1) - C (d)|. C (d) may take 5 possible values: Same Focus (= 0) Left slightly more in focus (0.3) Left more in focus (0.7) Right slightly more in focus (≈-0.3) Right more in focus (≈-0.7) The fact that the sign of the focus difference must correspond to one of the nine shapes described before brings one more constraint to the model: the number of sign changes is limited. The minimization can be solved in linear time (O(d max - d min )) using dynamic programming. The result is a curve telling for each disparity if left is more focused than right, both focus are the same, or right is more focused than left. Results The results below use a pair of ray-traced images with the same depth of field and different focus distances: left image is focused on the green dot, right image is focused on the blue dot. Disparity: d(i) Sign of SML Difference: M (i) Max of SML: w(i) d max d min M (i) > 0 M (i)= 0 M (i) < 0 Max w(i) Min w(i) Weighted Mean: M (d) Sum of Max of SML: w(d) Estimated model C (d) Blue and green disparities correspond to the blue and green dots in the disparity image above. To graphically view the result we draw zebra strokes on each original image, marking the areas where this image is less focused than the other. Left red zebra area (e.g. the fountain) is less focused than in the right image. Right red zebra area (e.g. the background) is less focused than in the left image. A closer look at a detail of the original images visually confirms our results. Left detail Right detail References [1] Wei Huang and Zhongliang Jing. Evaluation of focus measures in multi-focus image fusion. Pattern Recognition Letters, 28(4):493 – 500, 2007. [2]S.K. Nayar and Y. Nakagawa. Shape from focus. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 16(8):824 –831, aug 1994. [3]M. Sizintsev, S. Kuthirummal, H. Sawhney, A. Chaudhry, S. Samarasekera, and R. Kumar. Gpu accellerated realtime stereo for augmented reality. In Proceedings Intl. Symp. 3D Data Processing, Visualization and Transmission (3DPVT), 2010. This work was done within the 3DLive project supported by the French Ministry of Industry http://3dlive-project.com/

Upload: others

Post on 03-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: i Stereoscopic Focus Mismatch Monitoringdevernay.free.fr/publis/pujades-cvmp2011-poster.pdf · The results below use a pair of ray-traced images with the same depth of eld and di

INRIAPRIMA TeamLaboratoire Informatique de GrenobleUMR 5217

Mail: {sergi.pujades-rocamora,frederic.devernay}@inria.frInria Grenoble - Rhone Alpes655 Av de l’Europe 38330 Montbonnot-Saint-Martin

Stereoscopic Focus Mismatch Monitoring

Sergi Pujades Rocamora - Frederic Devernay

Abstract

We detect focus mismatch between views of a stereoscopic pair. First, we compute a dense disparitymap. Then, we use a measure to compare focus in both images. Finally we use robust statistics tofind which images zones have different focus. We show the results on the original images.

Introduction

Live-action stereoscopic content production requires a stereo rig with two cameras precisely matchedand aligned. While most deviations from this perfect setup can be corrected either live or in post-production, a difference in the focus distance or focus range between the two cameras will lead tounrecoverable degradations of the stereoscopic footage.Measuring the focus at a point in an image is an ill-posed problem, since it may be the in-focus image ofa non-textured point in the scene. We consider that the captured image is the result of the applicationof the focus blur on an image with infinite depth of field.Assuming parallel (or near-parallel) cameras the focus value should be dependent on depth, and thuson disparity. It can be shown that the focal blur size is linear with the stereo disparity, as seen in thefigure below.

1depth of field (DOF)

disparity (d)

focus distance (FD)

focal blur size (σ)

In Focus

Outof Focus

The difference of focal blur between two images, as a function of disparity, has one of the followingnine different shapes.

FDl < FDr FDl = FDr FDl > FDr

DOFl < DOFr d

σ

d

σ σ

d

DOFl = DOFr d

σ

d

σ

d

σ

DOFl > DOFr d

σ

d

σ

d

σ

Legend :

Left focal blur

Right focal blur

Focal blur difference

Despite the fact that we cannot measure the focal blur directly, but only image blur, the sign of imageblur difference has the same sign as the focal blur difference. We can thus use this function to measurefocus mismatch.

Algorithm Outline

1. Compute dense disparity map.

2. Measure focus mismatch.

3. Model the focus mismatch measures.

4. Draw mismatched areas on the original images.

Disparity map computation

We first compute a dense disparity map. Since images may differ in focus, we use a real-time multi-scale method [3] which finds good disparity values even between focused and blurred textures. Wealso compute semi-occluded areas by left-right consistency check, and ignore them in the followingcomputation. Let d(i) be the disparity of pixel i = (x, y).

Focus Mismatch Measurement

In order to compare the focus of corresponding points from the left and right images we use theSML operator (sum of modified Laplacian [1, 2]) which was primarily designed for depth-from-focusapplications,

SML(i) =

x+N∑r=x−N

y+N∑s=y−N

∇2M (r, s), for ∇2

M (r, s) ≥ T1, where ∇2MI =

∣∣∣∣∣∂2I

∂x2

∣∣∣∣∣ +

∣∣∣∣∣∂2I

∂y2

∣∣∣∣∣ .For a pixel i in the left image, SMLl(i) is the SML operator computed at this pixel, and SMLr(i) iscomputed at the corresponding pixel in the right image.Let M(i) be the sign of the difference of SML between two pixels:

M(i) = sign(SMLl(i)− SMLr(i)).

It is positive if left is more focused than right, and negative if right is more focused than left.Let w(i) be the max of SMLl(i) and SMLr(i) :

w(i) = max(|SMLl(i)|, |SMLr(i)|).

It is high if one image is textured and in focus, which tells us where reliable information is.For each disparity value of the scene, M(d) is the mean of those differences at disparity d weighted byw(i), and w(d) is the corresponding sum of weights. This gives us an estimate of which image is morefocused at disparity d.However this estimate may be very noisy :

• The disparity information may be inaccurate, which leads M(i) to be wrong.

• Focal blur bleeds over depth discontinuities : background objects may be wrongly measured asblurred.

• The number of measures for each disparity depends highly on scene content and information mayeven be missing for some disparity values.

In order to tackle these problems we perform a model estimation to obtain robust information.

Focus difference model estimation

Given the measures M(d) and w(d) we fit a model C(d) minimising the energy

E =∑d

w(d)Edata(d) + λEsmooth(d), with

Edata(d) = M(d)− C(d) and Esmooth(d) = |C(d− 1)− C(d)|.C(d) may take 5 possible values:

• Same Focus (= 0)

• Left slightly more in focus (≈ 0.3)

• Left more in focus (≈ 0.7)

•Right slightly more in focus (≈ −0.3)

•Right more in focus (≈ −0.7)

The fact that the sign of the focus difference must correspond to one of the nine shapes described beforebrings one more constraint to the model: the number of sign changes is limited. The minimization canbe solved in linear time (O(dmax − dmin)) using dynamic programming. The result is a curve tellingfor each disparity if left is more focused than right, both focus are the same, or right is more focusedthan left.

Results

The results below use a pair of ray-traced images with the same depth of field and different focusdistances: left image is focused on the green dot, right image is focused on the blue dot.

Disparity: d(i) Sign of SML Difference: M(i) Max of SML: w(i)

dmaxdmin M(i) > 0M(i) = 0M(i) < 0 Max w(i)Min w(i)

Weighted Mean: M(d) Sum of Max of SML: w(d) Estimated model C(d)

⊗ →

Blue and green disparities correspond to the blue and green dots in the disparity image above.

To graphically view the result we draw zebra strokes on each original image, marking the areas wherethis image is less focused than the other.

Left red zebra area (e.g. the fountain) is lessfocused than in the right image.

Right red zebra area (e.g. the background) isless focused than in the left image.

A closer look at a detail of the original images visually confirms our results.

Left detail Right detail

References[1] Wei Huang and Zhongliang Jing. Evaluation of focus measures in multi-focus image fusion. Pattern Recognition Letters, 28(4):493 – 500, 2007.

[2] S.K. Nayar and Y. Nakagawa. Shape from focus. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 16(8):824 –831, aug 1994.

[3] M. Sizintsev, S. Kuthirummal, H. Sawhney, A. Chaudhry, S. Samarasekera, and R. Kumar. Gpu accellerated realtime stereo for augmented

reality. In Proceedings Intl. Symp. 3D Data Processing, Visualization and Transmission (3DPVT), 2010.

This work was done within the3DLive project supported bythe French Ministry of Industryhttp://3dlive-project.com/