Background Blurring shadow@cmlab.csie.ntu.edu.tw 這張照片除了中間樹叢的部份,往前或往後都是模糊的,於是我們很自然的就會把焦點放在中間清楚的樹叢上,這是因為人眼對於texture清晰銳利的部份會比較敏感的緣故。

Slides:



Advertisements
Similar presentations
第一章 餐饮服务程序 学习目的: 掌握餐饮服务四个基本环节的内容 正确表述和运用各种餐饮形式的服务程序 熟悉并利用所学知识灵活机动地为不同需求的 客人提供服务.
Advertisements

金門的特色小吃 ~結合自然與人文的美食之旅~
第九章 認識勞退新制及因應之道 大葉大學 助理教授 邱祈豪.
Homework (I) Implementing the spread-spectrum watermarking system
法學緒論第三單元:立法程序 課程設計: 財經法律系 --楊東連 法學緒論-3.
工作態度倫理第二組期末報告 如何找到適合自己的工作
加入圖片.
中國地名、組織機構名稱和英譯名的自動辨識
避開鳥事、走好運! 懂卜卦的人,一輩子不吃虧!
文书档案管理基础教程 定海区档案局
石家庄迅步网络科技有限公司 联系人:张会耀 电话:
share box user research finding
行政作用法 行政命令.
新办企业办税须知 --新办企业纳税人涉税事项介绍
手持裝置應用系統之設計 與未來發展 黃有評 大同大學 資訊工程系.
三重有情、修德有愛 2003/12/24.
指導教授:林君憶老師 報告者:江秀英 日期: (三)
第 13 章 套件 (Packages).
中国科学院档案数字化 工作情况介绍 潘亚男 2013年10月24日
手外伤与断指再植 上海第二医科大学 附属第九人民医院骨科.
機械視覺概論 生產自動化.
Survey of Background Blurring
Project 2 JMVC code tracing
Population proportion and sample proportion
顏色與背景CSS樣式.
慈濟大學資源教室 特殊學生的關懷與協助
Lotus Domino R7 Designer
第四組 停車場搜尋系統 第四組 溫允中 陳欣暉 蕭積遠 李雅俐.
超高分辨率像素移位技术 1.
第二十九章 DLL / LIB函式庫開發 當我們開發程式到一個階段之後,我們一定會希望各個Component的程式碼可以分開的越清楚越好。而這一章最主要就是要告訴各位讀者,我們常在Windows系統中看到的dll或是lib的檔案該怎麼實作?做出這樣的library我們又該如何運用?為什麼使用dll或是lib有利於我們開發程式?以上這些疑問都將會在這一章中得到解答。
Vanishing Point (Line)
Chapter 2. The Graphics Rendering Pipeline 图形绘制流水线
Basis基本操作、使用者 管理與權限設定
Seam Carving for Content-Aware Image Resizing
Chapter 6 Graph Chang Chi-Chung
第十章 基于立体视觉的深度估计.
SQL Stored Procedure SQL 預存程序.
Web前端开发技术与实践 第11章:背景与边框 阮晓龙 /
第三章 基本觀念 電腦繪圖與動畫 (Computer Graphics & Animation) Object Data Image
光学设计软件 —— ZEMAX 简介 高 宏 实验室:中 西安交通大学理学院.
ICG 2018 Fall Homework1 Guidance
计算几何 Computational Geometry
攝影 Dolly Track 攝影機操作術語 Pan right (left), Tilt up (down) ,
第三章 基本觀念 電腦繪圖與動畫 (Computer Graphics & Animation) Object Data Image
A high payload data hiding scheme based on modified AMBTC technique
Microsoft SQL Server 2008 報表服務_設計
VIDEO COMPRESSION & MPEG
鏡頭 ~  一、焦距(focal length) 1. 廣角鏡頭 : 2 .標準鏡頭: 3. 望遠鏡頭:
Working Model 2D 朝陽科技大學 工業設計系 邱相文.
第五讲 从常用连续分布到二维变量分布 本次课讲授:第二章的 ; 下次课讲第三章的 ;
NSC D 蔣依吾 中山大學資訊工程系 紅外線點目標的檢知法則 Automatic detection of small targets in infrared image sequences containing evolving cloud clutter NSC D
Google Local Search API Research and Implementation
GridView.
如何使用Gene Ontology 網址:
手绘风 夏日火烈鸟.
Use of Microscope P
參數 實際參數(Actual parameter)與形式參數(Formal parameter)
File Input and Output Chap. 11: 施威銘的書 Chap. 7: K&R.
以四元樹為基礎抽取圖片物件特徵 之 影像檢索
磁共振原理的临床应用.
重庆市第一0四中学 王继军.
Parasitics Extraction (PEX) 與 postsimulation(posim)
Arguments to the main Function and Final Project
補充 數值方法 數值方法.
教育部技專校院 人才培育計畫.
Principle and application of optical information technology
IMU Deblur 張浩軒.
Banner幻燈片 電腦版 x3 個 : 1980 px X 835px Banner標題文字1
Develop and Build Drives by Visual C++ IDE
Presentation transcript:

Background Blurring shadow@cmlab.csie.ntu.edu.tw 這張照片除了中間樹叢的部份,往前或往後都是模糊的,於是我們很自然的就會把焦點放在中間清楚的樹叢上,這是因為人眼對於texture清晰銳利的部份會比較敏感的緣故。

Documentation

./ 系統主要分成三部份,前兩塊產生出depth和segment的 資訊之後,可以在第三部份根據不同參數設定產生出不同的 效果 system 1_segmentation Tool1: lazy-snapping with simple UI Tool2: 光影魔術手 2_depthmap depth of background scene (3d-box) depth of each segment 3_refocusblur camera parameter refocusing (inpainting, defocus blur) sample // sample input, parameter and result

Segmentation Lazy snapping Tool1: preprocessing(resize for mean shift ) + lazy snapping Lzsegment.m Input : parameter file name 先做preprocessing,這裡可以用meanshift或是直接downsample成64色階 ,並且在meanshift的地方resize為五分之一加快速度, 讀取stroke_1.bmp, stroke_2.bmp…等前後景筆劃圖,前景是紅色,後景是藍色。然後執行lazy snapping處理 ◎每個segment都存一個灰階的bmp檔,檔名分別是seg_1.bmp, seg_2.bmp…沒有先後順序。將每個segment扣除剩下的background的部份,即是seg_segN.bmp ◎需要libgil2的library Tool2: 光影魔術手 每個segment都存一個png檔,檔名分別是obj_1.png, obj_2.png…將這些png檔的alpha值轉成bmp, 並且扣除只剩下background的部份,即是seg_segN.bmp

Depth map depth.m (function depth(parafilename)) Input: nx ny Output: parameter file name dep_1.dat, dep_2.dat, …dep_(segN-1).dat ★ 每個dep_n.dat的內容: nx ny p1x p1y p2x p2y … ★ n表示normal vector, 預設是 (0,0), vector方向代表物體在平面上的法向量方向,長度表示深度變化量 ★ p1,p2…是user劃下的筆劃座標,即此segment的深度參考點,預設是segment最下方的點。如果沒有p1,p2…系統會自動取segment最下方一列的點作為參考點。 Output: dep_1.bmp, dep_2.bmp … dep_segN.bmp

Refocus Blur refocus.m ( function [finalresult]=defocus(parafilename) ) Get parameter from file, and load the segment/depth bmp files Get the focus position from focusposition.dat Compute diffusion blur circle diameter for each pixel Devide 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.m Use the result by inpaint.m to call defocus_blur.m Combine the front part and back part by alpha map return the result image

others Inpainting function needs the estexemplarhelper.c run mex estexemplarhelper.c before the function call at first time The inpainting code (inpaint.m) is from http://www.cc.gatech.edu/~sooraj/inpainting/ Meanshift code is downloaded from http://www.caip.rutgers.edu/riul/

中間檔案/參數 Generate from for focuspoint.dat UI畫定 refocus.m 的聚焦點資訊 dep_1.dat, dep_2.dat … depth.m每個segment的深度參考點和normal值,如果沒有給予參考點則視為最下方一排 stroke_1.bmp, stroke_2.bmp… Lazy snapping 的前後景分割依據 seg_1.bmp, seg_2.bmp… lzsegment.m 產生,或是用tool2取得obj.png之後,用seg_png2bmp.m產生 depth.m和refocus.m都需要用到的segment map dep_1.bmp, dep_2.bmp… depth.m產生 refocus.m需要用到的深度資訊 v1,v2,a1,a2,b1,b2.. Vanish box和消失點座標,可用UI介面畫定 depth.m產生背景深度資訊所需要 其他camera 參數 使用者自行調整

Input parameter file 1.dirname diratory of the files, include '/' on the tail, ex: 'sample1/' 2.imagename file name of input image, ex: test.jpg 3.segN number of segment image, include the background. ex: 2 (foreground*1+background) 4.vx position of vanish point, must be in the rear wall, 5.vy but can be outside of the image 6.ax 7.ay left_top position of the rear wall 8.bx 9.by right_bottom position of the rear wall 10.dc_f lens focal length,(mm) ex: 50 mm, 100 mm ...etc. 11.dpmax the depth of pixels with color level 255 in depth map, (mm) 12.dnear the depth of pixels with color level 0 in depth map, (mm) 13.dc_N the aperture number 14.thr=250 threshold of bokeh color level 15.light_e=0.5 little constant number for light_weight function 16.lens shape default setting 0 is flat disk

Camera parameter dc_f 相機的焦距,單位是mm,數值越大景深越淺, 建議在50~100之間 Dpmax rear wall距離成像平面的距離,建議為5~50公尺 (5000~50000) Dnear 場景裡距離成像平面最近的物體距離, 建議為1公尺,至少要在兩倍焦距以上 dc_N 光圈值,數值越大,光圈孔隙越小,景深越深, 為達到淺景深效果建議值在1.4~2.8之間,越小效果越強 thr=250 將pixel產生散景效果的臨界值,建議不要低於240 light_e=0.5 weight function的明度微調參數,為一個大於0的值, 數值越大明度影響越低,建議為0.5~1之間 lens shape 光圈孔隙的形狀,預設為0 對應到refocus/lens/ 資料夾底下的0.bmp, 1.bmp

Sample ./ ./sample01 parameter01-.dat original image seg_1.bmp seg_2.bmp … dep_1.dat dep_2.dat … 可由UI產生 focusposition.dat 可由UI產生,給定要聚焦的點,可以為單一或是多個點,將會取其對應到的深度平均值,格式為 x1 y1 x2 y2 … dep_1.bmp dep_2.bmp …

執行: 用system的前兩步驟產生出前頁所述的參數和bmp files,並放在所屬資料夾下 result = refocus(parameter file name);