Background Blurring

  • View
    29

  • Download
    0

Embed Size (px)

DESCRIPTION

Background Blurring. shadow@cmlab.csie.ntu.edu.tw. Outline. Introduction Documentation Object Segmentation Depth Map Generation Image Defocus. Perspective Box. Lazy Snapping. Camera Settings. Pop-up Card. Defocus Blur. Privacy Preserving. Photo Browser. Method. Depth Map Generation. - PowerPoint PPT Presentation

Text of Background Blurring

PowerPoint Presentation

Background Blurringshadow@cmlab.csie.ntu.edu.tw

1texture1

22Outline Introduction

DocumentationObject SegmentationDepth Map GenerationImage Defocus

3introductionimage defocus, refocussystemmethod3Method4Lazy SnappingPerspective BoxPop-up CardCamera SettingsDefocus BlurPrivacy PreservingPhoto BrowserObject SegmentationDepth Map GenerationApplicationsImage DefocusLazy SnappingPerspective BoxPop-up CardCamera SettingsSYSTEMUSERDEFOCUS BLUR

4MethodSegmentLazy snappingMean shift

5

Resize to 20%Do hard graph cut by lazy snappingUser StrokeMean shiftLazy Snapping. ACM Trans. On Graphics 2004.Mean Shift: A Robust Approach Toward Feature Space Analysis. PAMI 2002.A Bayesian Approach to Digital Matting. CVPR 2001.

SEGMENTLAZY SNAPPINGTOOLMEAN-SHIFTSEGMENTHARD SEGMENTHARD SEGMENTPIXELSEGMENTBOUNDARY DETECTIONUNCERTAINTRI-MAPALPHA MATTINGSEGMENTUSER INPUTFACE DETECTIONHINT5MethodDepth mapPerspective BoxVanish pointRear wall

Depth MapPerspective BoxNormal vector Pop-up card 6

Depth MapNormal vector Pop-up card

Tour Into the Picture: Using a spidery mesh user interface to make animation from a single image. SIGGRAPH 1997SEGMENT TOUR INTO THE PICTURE3D

6

MethodDepth mapPop-up card

Depth MapPerspective BoxNormal vector

Pop-up card 7Depth MapNormal vector Pop-up card TARGET IMAGETARGET IMAGESEGMETTARGET7MethodDepth mapNormal vector

Depth MapPerspective BoxNormal vector Pop-up card 8Depth MapNormal vector

SEGMENTSEGMENTSEGMENTNORMAL VECTOR

8MethodDefocus blurbokeh

9

xDEFOCUSWEIGHT

NORMALIZEWEIGHT 25625510255BOKEH

9Method10

Defocus blur

NORMALIZE10MethodNear-by object case

11Focus on the flowerFocus on the flowerTEXTURE

11Near-by object case

MethodBlur circle diameterObjects in front of the focusObjects behind the focusDefocus Blur Texture synthesis inpaintingBlur shape as alpha mapDefocus BlurInterpolation by alpha mapShallow focus image12

SYSTEMDEFOCUSBLURALPHA MAPALPHA MAPINPAINTINGDEFOCUS BLURALPHA MAP

12Experimental Result 1Defocus blur method proposed in the system comparing with other blur filter results

13Deep focusShallow focus13Experimental Result 1Defocus blur method proposed in the system comparing with other blur filter results

Gaussian blurDefocus blurDefocus blur + Bokeh14DEFOCUSWEIGHT14Experimental Result 115

Deep focusShallow focus15Defocus blurExperimental Result 116

Gaussian blurDefocus blur + BokehOriginal photograph

Defocus blur method proposed in the system comparing with other blur filter resultsDEFOCUS BLUR

16Experimental Result 2Near-by object case

17Focus on the flowerFocus on the flowerTEXTURE

17Near-by object case

Without inpaintingInterpolation resultExperimental Result 218

TEXTURE

18Applications - Privacy Preserving19

19

Applications - Image Transition at Photo Browser 20

VIDEOTEXTURE

2021Applications - Image Transition at Photo Browser

BLURTEXTURESHAPE21Movie with defocus blur effect22Applications - Image Transition at Photo Browser

SYSTEMVIDEO

22Documentation 23./ depthsegmentsystem1_segmentationTool1: lazy-snapping with simple UITool2: 2_depthmapdepth of background scene (3d-box)depth of each segment3_refocusblurcamera parameterrefocusing (inpainting, defocus blur)sample// sample input, parameter and result24SegmentationLazy snappingTool1: preprocessing(resize for mean shift ) + lazy snappingLzsegment.mInput : parameter file namepreprocessingmeanshiftdownsample64meanshiftresizestroke_1.bmp, stroke_2.bmplazy snappingsegmentbmpseg_1.bmp, seg_2.bmpsegmentbackgroundseg_segN.bmplibgil2library

Tool2: segmentpngobj_1.png, obj_2.pngpngalphabmp, background,seg_segN.bmp2525Depth mapdepth.m (function depth(parafilename))Input: parameter file namedep_1.dat, dep_2.dat, dep_(segN-1).dat dep_n.dat:nx nyp1x p1yp2x p2y nnormal vector, (0,0), vector p1,p2usersegmentsegmentp1,p2segmentOutput:dep_1.bmp, dep_2.bmp dep_segN.bmp

2626Refocus Blurrefocus.m ( function [finalresult]=defocus(parafilename) )Get parameter from file, and load the segment/depth bmp filesGet the focus position from focusposition.datCompute diffusion blur circle diameter for each pixelDevide image into two parts, the part in front of the focus, and run defocus_blur.m Use alpha.m to get alpha map, and find the pixels to run inpaint.mUse the result by inpaint.m to call defocus_blur.m Combine the front part and back part by alpha mapreturn the result image

2727othersInpainting function needs the estexemplarhelper.c run mex estexemplarhelper.c before the function call at first timeThe inpainting code (inpaint.m) is from http://www.cc.gatech.edu/~sooraj/inpainting/Meanshift code is downloaded fromhttp://www.caip.rutgers.edu/riul/ 282829/Generate fromforfocuspoint.datUIrefocus.m dep_1.dat, dep_2.dat UIdepth.msegmentnormalstroke_1.bmp, stroke_2.bmpUI

Lazy snapping seg_1.bmp, seg_2.bmplzsegment.m tool2obj.pngseg_png2bmp.mdepth.mrefocus.msegment mapdep_1.bmp, dep_2.bmpdepth.mrefocus.mv1,v2,a1,a2,b1,b2..Vanish box,UIdepth.mcamera Input parameter file1.dirnamediratory of the files, include '/' on the tail, ex: 'sample1/'2.imagenamefile name of input image, ex: test.jpg3.segNnumber of segment image, include the background. ex: 2 (foreground*1+background)4.vx position of vanish point, must be in the rear wall,5.vybut can be outside of the image6.ax7.ayleft_top position of the rear wall8.bx9.byright_bottom position of the rear wall10.dc_flens focal length,(mm) ex: 50 mm, 100 mm ...etc.11.dpmaxthe depth of pixels with color level 255 in depth map, (mm)12.dnearthe depth of pixels with color level 0 in depth map, (mm)13.dc_Nthe aperture number14.thr=250threshold of bokeh color level15.light_e=0.5little constant number for light_weight function16.lens shape default setting 0 is flat disk30Camera parameterdc_f mm50~100Dpmaxrear wall5~50 (5000~50000)Dnear1dc_N1.4~2.8thr=250pixel240light_e=0.5weight function00.5~1lens shape 0refocus/lens/ 0.bmp, 1.bmp

31Sample./parameter01-.dat./sample01original imageseg_1.bmp seg_2.bmp dep_1.dat dep_2.dat UIfocusposition.datUI x1 y1x2 y2dep_1.bmp dep_2.bmp 32systembmp filesresult = refocus(parameter file name);

33END

THANK YOU34