201244790 六、發明說明: 【發明所屬之技術領域】 本發明係有關於一種虛擬高爾夫模擬裝置及其使用之感測裝置與感 測方法,尤其是一種其中虛擬高爾夫球場被成像並模擬且使用者所敲擊之 高爾夫球的執跡被感測裝置感測並在虛擬高爾夫球場上模擬的虛擬高爾夫 模擬裝置’以及其使用之感測裝置與感測方法。 【先前技術】 近年來,已開發出許多裝置,在室内或在特定地方經由模擬而以互動 運動遊戲的形式,讓使用者享受到受歡迎的運動遊戲,比如棒球、足球、 籃球及高爾夫。 一尤其是近年來,已經開發出所謂的螢幕高爾夫系統,其中當使用者揮 爾夫球桿崎擊安錄擊雜上的高目夫料,感顚制被敲擊的 问爾夫抽取出移動之高爾夫球±的物理資訊,使得高爾夫球的執跡能 在虛擬高爾夫球場上被模擬’藉以讓使用者能享受到虛擬實境中的高爾夫。 為了在這類互動運動遊戲中模擬使用比如高爾夫球之球類的運動,許 多研究已經破導人到許多感⑹系統,用於精確感測移動之高爾夫球上的物 理資訊’亦即高爾夫球的移動。 ,如’許錢職置’比如使账外線制器喊繼置、使用雷射 j器的感測裝置、使脾波制^的感職纽及使舰像感測器的感 ΐ署置’都已峰出到市場上。許多研究已經被導人照像感測器型的感測 用於觸並分析移動⑥目夫球的影像,藉喊確感測移動高爾夫球 Γ而’照像機的拍倾域是111定’頭像機是在@定拍攝區域内獲得 爾夫球的影像’其結果是當高_夫球移動,影像中高爾夫球的大小 改變。為此’很難從雜訊巾區分出高爾夫球。尤其是,當使用具有 像機時’报難在照像機所獲得的影像中找尋高_夫球,因而很 難精確計算高岐球的執跡。 201244790 【發明内容】 因此’本發明是著眼於上述問題而產生,並且本發明的目的在提供一 2虛擬高爾夫模擬裝置,其中使用虛擬高爾夫模擬,獲得使用者揮動高爾 ,球桿敲擊高^球所敲擊之高爾夫球的影像,以及從所獲得的影像找尋 问爾,球’ t算高岐球的移純跡’藉以實現高縣球軌跡賴擬影像, 尤其是其t高肤雜料且射地郷射純,崎確計算高爾夫球 ,軌跡,藉轉決财機所獲得之影像上高狀_大小改變錄難抽取 咼爾夫球的問題,並揭示其使用的感測裝置與感測方法。 依據本發明的特點’上述及其他目的可藉提供一種用於虛擬高爾夫模 擬裝置的感測裝置而完成,該細裝置包括:__照像單元,用於獲得使用 者揮動高岐球桿縣高爾夫球顺擊之高爾夫球·數個酸影像;以 及-感測處理單元,包括_預先處理裝置以及—樣板匹配裝置,該預先處 理裝置驗處雌照像單元獲得的該特像,藉以抽取多個高目夫球候選 ^ ’而該樣板匹配裝置聽預設鑛L夫球樣板,#作高岐球的 一參考影像,並依據每個高爾夫球候選者的大小,變動匹配所抽取的該等 阿爾夫球候選者以及該高爾夫球樣板,藉以抽取高爾夫球的資訊。 依據本發明的另-特點’提供-種虛擬高爾夫模擬I置,包括一感測 裝,’該感赚置包括:_照像單元’祕獲得使用者揮減爾夫球桿敲 擊高爾夫球所轉之高_夫球的減侧框雜、以及—_處理單元, 包括一預先處理裝置以及一樣板匹配裝置,該預先處理裝置用於處理該照 像單元獲知的S亥等影像,藉以抽取多個高爾夫球候選者,而該樣板匹配裝 ,用於預設並儲存-高爾夫球樣板’當作高岐球的_參考雜,並依據 每,高爾夫球候選者的大小,變動匹配所抽取的該等高爾夫球候選者以及 該向爾夫球樣板,藉以抽取高爾夫球的資訊;以及一影像實現裝置,用於依 據該感測處理單元所抽取的資訊,實現該高爾夫球之軌跡的模擬影像。 依據本發_又-特點’提供—種用於虛擬高爾夫模擬的感測方法, 包括.獲得使用者揮動高爾夫球桿敲擊高爾夫球所敲擊之高爾夫球的複數 個圖框影像;處理獲得的該等影像,以抽取多個高爾夫球候選者;以及依 據母個尚爾夫球候選者的大小,變動匹配所抽取之該等高爾夫球候選者和 一尚爾夫球樣板,該高爾夫球樣板係被預設及儲存以當作高爾夫球的一參 201244790 考影像,藉以抽取高爾夫球的資訊。 【實施方式】 現在,將參考所附圖式詳細說明依據本發明虛擬高爾夫模擬裝置及方 法以及其使用之感測裝置與感測方法的示範性實施例。 首先’將參考f1圖及第2圖說明依據本發明實施例的虛擬高爾夫模 擬裝置以及其使用的感測裝置。 第1圖是顯雜據本發明實施例虛擬高爾夫模擬裝置所綱之螢幕高 爾夫系統實綱示意圖’ 第2圖是顯示第!圖巾螢幕高爾夫纽所應用 之虛擬高爾夫模擬裝置的結構的方塊圖。 如第1圖及第2圖所示’依據本發明實施例的虛擬高爾夫模擬裝置包 括用於感測使用者所敲擊的高爾夫球B的感測裝置s、以及用於實現虛擬 高爾夫球場之影像並依據感測裝置S的感測蟀果在虛擬高爾夫球場上提供 尚爾夫球B之轨跡的模擬影像的模擬器i,以使得虛擬高爾夫模擬能進行。 如第1圖所示,依據本發明實施例的虛擬高爾夫模擬裝置所應用之螢 幕尚爾夫系統可配置成具有一種結構,其中擊球台11〇設置在提供預設大 小的空間之高爾夫室2的地面上,而使用者是在擊球台11〇上敲擊高爾夫 球B,擊球墊120設置在擊球台ι10的一側,而高爾夫球B安置在擊球墊 120上以使得使用者能在擊球台11〇上敲擊高爾夫球&以及螢幕3設置在 高爾夫室2的前方,從影像輸出裝置(第2圖中所示的影像輸出部3〇,比如 光束投影機)輸出的虛擬高爾夫模擬之影像被投影到螢幕3上,而影像資訊 是從模擬器1傳送至影像輸出裝置。 擊球台110及擊球墊120設置在第1圖所示的擊球板100上。另一方 式是,擊球台110及擊球墊12〇可設置在高爾夫室2的地面上。 可設置擊球板100以使得擊球板iOO能在向前及向後的方向上以及在 左邊及右邊方向上傾斜預設角度。而且,擊球板10〇可連結至模擬器1, 以使得擊球板100可對應於目前實現的虛擬高爾夫球場的地形而傾斜。 同時’如第1圖所示’感測裝置S設置在高爾夫室2内’以感測使用 者所敲擊的兩爾夫球B。 亦即’如第2圖所示,感測裝置s包括照像單元50以及感測處理單 201244790 元60,照像單元50包含有複數個照像機51及52,而感測處理單元60用 於處理照像單元50所獲得的影像,藉以抽取移動高爾夫球的物理特性。 照像單元50可由用於影像感測的單一照像機或更多個照像機而構 成。為了獲得移動高爾夫球B的影像並抽取高爾夫球在三維空間的座標, 較佳的是配置使用二個或更多個相互協同連結之照像機51及52的立體型 照像單元,如第1圖所示。 移動南爾夫球之物理特性可包括南爾夫球的速度、高爾夫球的移動方 向(高爾夫球在水平方向的移動角度)、高爾夫球的高度(高爾夫球在垂直方 向的移動角度)以及高爾夫球的旋轉。 感測處理單元6G可包括抓取器7卜擊球偵· 72、高爾夫球影像處 理裝置80以及高爾夫球桿影像處理裝置9〇,其中抓取器71以每個圖框為 基礎依序《^賴料元50賴得的f彡像’擊_測€ 72聽接收並處理 抓取器71所收集的_,藉喊晴轉備妓已經完成且擊球是否 已經由使用者進行,高爾夫球影像處理裝置8〇用於在擊球伽器感測 到高爾夫球已經被使用者敲擊時,處理從擊球伽器72接收的影像,藉以 抽取移動高爾夫球之物理特性上的資訊,•爾夫球桿影像處理裝置9〇曰用 =從擊球_器72接收的影像’分析高球桿的移動執跡,藉以抽 球旋轉上的資訊 月感測處理單元⑼進—步包括主換裝置73,驗匹配照像機51 in ^彡^藉⑽絲舰賴影躺二維纽(從每個照像機 所抽取峨三維資訊’或減地,觀配細峨像機影像 所抽取的的二維育訊轉換成二維資訊。 包她糊蝴嶋繼_麵1較佳地 _ _庫1G、資料處理部2G以及影像輸出部3〇。 貧料庫H)儲存虛擬高爾夫模擬必要的所有資料。例如 舰======絲_之影像或 影像輸出部30輸出從資料處理部2G接收的影像資訊到螢幕,以使得 201244790 使用者能看到影像。 控制器Μ依據感測裝置S的感測結果接收資訊,以控制所有元件的 操作’比如模擬器1的資料庫10、資料處理部20以及影像輸出部3〇。亦 即’控制器Μ、資料庫1〇以及資料處理部2〇的功能如同影像實現裝置, 用於依據感測裝置S的感測結果實現高爾夫球執跡之模擬影像。 下文中,將參考第3圖說明第2圖所示感測裝置S的更加詳細結構以 及構成感測裝置S之個別元件的功能。 如第3圖所示’依據本發明感測裝置中資訊的傳送是以照像單元5〇— 抓取器71—擊球偵測器72—高爾夫球影像處理裝置叨—高爾夫球桿影像 處理裝置90—>模擬器1的次序來進行。 照像單元50拍攝預設範圍,包括設置有擊球台及擊球墊的部分,以 獲得每秒數百圖框影像。 所獲知圖框影像傳送至抓取器71。抓取器71儲存從照像單元%接收 的影像,並同時傳送影像至擊球偵測器72,以進行影像處理。 ^較佳地,擊球偵測器72從抓取器接收的影像找尋高爾夫球,並決定 高爾夫球是否滿足預設條件,域測擊球賴是否已經完成。而且擊球摘 測器72蚊高球是碰擊球準配經絲雜置上轉,藉喊測擊是 否已經由使用者進行。 。感測擊球準備是否已經完成以及感測擊球是否已經進行的擊球偵測 器72之方法,並不是本發明的核心,因而詳細說明將省略 ^&感測到個者已經敲擊高爾夫球時,擊球鋼器會儲存高 球已經被敲擊時的影像、以及之後的複數個_影像。這: 送至高爾夫球影像處理裝置8。,以使得該等影像能被高肤球=二= 置80處理。 衣 此夕卜, …傾綱湖利織耗駄_,擊麵_ 72 存南爾夫球已經銳擊之前的複數侧框影像,並傳送所齡的 影像至高爾夫球桿影像處理裝置9〇。高岐球桿影像處理裝置^ 减高狀料倾雜置8G __雜,抽取 冋爾姐純影像,以驅動高爾夫球桿頭的動轨跡,藉以估計高球 雨爾夫球雜歧裝置8(m及簡夫轉树處縣置%所抽取的 201244790 高爾夫球之物理特性上的資訊被傳送至模擬器1β模擬器丨輪出模擬影像, 其中高爾夫球是依據所接收的資訊而在虛擬高爾夫球場上移動,以使得虛 擬高爾夫模擬可進行。 高爾夫球影像處理裝置80較佳地包括預先處理裝置81以及樣板匹配 裝置82,其中預先處理裝置81用於處理個別照像機所獲得之影像,以抽 取多個高爾夫球候選者,而樣板匹配裝置82用於預設並處理高爾夫球樣 板,當作高爾夫球的參考影像,並用於變動匹配所抽取的該等高爾夫球候 選者以.及南爾夫球樣板,依據該等高爾夫球候選者的大小抽取高爾夫球的 資訊。 既然每個照像機所獲得的影像包含許多種具有類似高爾夫球形狀及 咼爾夫球影像的雜訊(例如,高爾夫球附近地形的特定部分、使用者身體的 一部分以及高爾夫球桿的頭部)’所以必需從影像精確抽取高爾夫球。為 此’預先處理裝置81處理影像以選取並抽取主要被視為高爾夫球的多個物 件,當作尚爾夫球候選者。樣板匹配裝置辨識所抽取之多個高爾夫球候選 者中敢相似於尚爾夫球樣板的其中之一以當作南爾夫球,並抽取所辨識之 高爾夫球的座標,以言十算高爾夫球的轨跡資訊。 然而’樣板匹配裝置不容易比較該等高爾夫球候選者以及高爾夫球樣 板。理由是’某一圖框中高爾夫球候選者的大小可不同於另一圖框中高爾 夫球樣板的大小。結果,不同圖框中奇爾夫球的大小會不同。這是因為, 照像機的拍攝區域是固定,而照像機與高爾夫球之間的距離在拍攝區域内 是依據高爾夫球的移動而改變,其結果是,個別圖框中移動高爾夫球的影 像之大小會相互不同。 另一方面,高爾夫球樣板的大小及形狀是均一固定。如果高爾夫球候 選者與高爾夫球樣板比較而沒有改變’因而不能決定高爾夫球候選者如何 相似於高爾夫球樣板,並因此不能精確抽取高爾夫球。 為此’樣板匹配裝置估計高爾夫球候選者的大小,並依據所估計的高 爾夫球候選者的大小,變動匹配高爾夫球候選者以及高爾夫球樣板,藉以 抽取其間的相似程度,因而能精確辨識高爾夫球。 下文中’將參考第3圖至第5圖說明預先處理裝置所進行的影像處理。 首先,預先處理裝置81(見第3圖)從第4圖⑻所示之由照像機獲得的 201244790 影像200分離第4圖⑻所示之來源影像220。 既然照像機獲得的影像包含寬拍攝範圍 很多時間處理影像200。為此,必要的區域被抽取。?^斤以要發費 被處理,藉以降低影像處理時間。 /、有被抽取的影像 第4圖(b)所示的來源影像22〇是定義成從第 P1 _ P㈣爾,峨以 ,即,當高爾夫球被敲擊時,高爾夫球飛向螢幕3(見第〗圖)。 为析间爾夫球從已經進行擊球的一點到離已經進^ ^ ^ ^ 觀距離的移動,藉以足夠計«訊’比如高向 度角 前-imrr2可為對應於螢幕3⑽1嶋位置或離螢幕向 點P1及點P2從照像機所獲得的影像來指定,且對應於點朽及點 之間區段的影像從照像機所獲得的影像分離,以獲得第4圖⑼所示之來源 影像。 同時一’背,應像是經由差異操作,從上述所獲得的來源影像移除,如 第5圖所不,藉以只獲得高爾夫球候選者。例如,第5圖⑼所示的背景影 像230可經由差異操作從第5圖⑻所示的來源影像22〇移除,以獲得第$ 圖(c)所示只具有移動部分的影像。 經差異操作所抽取之影像的移動部分不被視為高爾夫球。某些移動部 分會是雜訊,比如高爾夫球桿頭的一部分或使用者身體的一部分。。 結果,預先處理裝置依據高爾夫球的幾何特性,將經差異操作所獲得 取之影像240中被視為高爾夫球的部分指定為高爾夫球候選者。例如,大 的寬度高度比的部分是不被視為高爾夫球,並因而排除這類的部分。而且, 具有-個或二個像素大小的部分是很小,不被視為高爾夫球,並因而排除 這類的部分。 ' 依據高爾夫球幾何特性所獲得影像的剩餘部分被指定為高爾夫球候 選者。第5圖(c)顯示二個被抽取的高爾夫球候選者cl4及C1_2已經被抽 201244790 發明示之—㈣處理是相對於酿影像來進行。依據本 歧每個雌鑛麟雜巾擊槪經進行 由®框影像、以及擊球已經進行之後所獲得的所有圖框影像,經 由上述處理以抽取高爾夫球候選者。 下文中,將參考第3圖至第6圖說明樣板随裝置所進行 補結好侧赌麟之麟上乡細㈣高爾夫球 Γ,其等如第4圖及第5圖所示之處理以抽取所有高爾 ^ Γίΐ, )是顯示職並儲存以#作高岐球之參考影像的 同爾夫球樣板Τ的示意圖。 在第6 _中,高爾夫球候選者C1]及C1_2表示從來源影像的第 :圖框抽取的高爾规候選者,⑶表示從第二圖框抽取的高爾夫球候選 者’ C3-1表示從第三圖姉取的高爾夫球候選者,二⑷表示從第四圖 框抽取的高爾夫球候選者。 樣板匹配裝置82包括估計裝置82a、正規化裝置咖以及匹配裝置 82c,其中估計裝£82a用於估計預先處理裝㈣所抽取之高爾夫球候選 者(見第5圖_大小’正規化裝置82b用於正規化高爾夫球候選者,使得 每個南®夫球候選者具有對應於高爾夫球樣板的大小,而匹配裝置咖用 於匹配正,化高_夫賴選者以及高狀雜板,以抽取的相似程 度,並從高爾夫球候選者找尋高爾夫球,以抽取座標資訊。 估計裝置823在三雜間中估計被抽取之每個高爾夫球候選者的大 小。每個照像機所獲得影像包含二維資訊。因此,為了計算三維空間中每 個高爾夫球候選者的大小,每個高岐賴選者的三維座⑽訊=由轉換 裝置73(見第2圖及第3圖)來抽取’在三維空間中,每個高爾夫球候選者 以及相對應照像機之間的距離使用所抽取的三維座標資訊來計算,藉以估 計每個高爾夫球候選者的大小。 亦即’估計裝置82a使用轉換裝置73估計三維空間中第6圖⑷所示 之多個影像的每個高爾夫球候選者C1-1至C4-1的大小。 可從第6圖(a)看出’個別圖框中每個高爾夫球簡者的大小是彼此不 同。發生這種現象疋因為馬爾夫球在拍攝區中移動,結果,照像機以及高 爾夫球之間的距離改變。為此,個別圖框中高爾夫球候選者的大小使用三 201244790 維,間的座標數值來估計,藉叫變每個高爾夫球候選者的大小,使得每 個尚爾夫雜選者的大小是物於高目夫球樣板社小,或改變高爾夫球 樣板的大小以使得高狀雜板的A小是等同於每個高爾夫球候選者的大 小’而且高爾夫球候選者與高爾夫球樣板比較,決定高爾夫球候選者對高 爾夫球樣板的她程度如何,藉峨高爾夫球麵者輕賴尋真實的高爾 夫球。 >正規化裝置82b考慮到藉估計裝置❿所估計的每個高爾夫球候選者 的估4大j而正規化每個⑧爾夫球候選者以使得每個高爾夫球候選者的 大小是等’高爾夫球樣板τ的大]、,或正規化高肢球樣板τ以使得高 爾夫1樣板τ的大錢等同於每個高爾夫球闕者的大小。 高爾夫球候選者的正規化是高爾夫球候選者影像之變形的處理,以使 得高爾夫賴選者的大候等同於細夫樣Μ狀小,轉持高爾夫 球候選者影像的形狀及像素比,藉以達到高爾夫球候選者及高_夫球樣板 ^間輕易軸較。另-方面’高岐球樣板τ的正規化是高狀球樣板影 ^之變形的處理’以使得關夫球樣板了的大小是等同於相對應高爾夫球 候選者的大小’而轉高爾夫球樣板影像的雜及像素比,藉以達到高爾 夫球樣板及高爾夫球候選者之間輕易的比較。 在經由正規化裝置82b $成高爾夫球候選者或高爾夫球樣板的正規化 ,,匹配裝置82c t匕較每個高爾夫球候選者以及高爾规樣板,藉以抽取 相似程度被轉換絲據許彡蚊祠而紋的紐,比如整體形狀、 像素及像素數值分佈。#相她度等於或大關設數辦,其中一相對 應的高爾夫球候選者可被辨識為“高爾夫球,,。 可依據匹配結果,抽取被辨識為高爾夫球之高爾夫球候選者的座標數 值’並依制純之座標餘較變,計算滅雜上的魏,比如 夫球的速度、方向、高度角。 下文中’將參考第7 B1說明依據本發明實施姻於虛擬高爾夫槪 感測方法。 百先’當虛擬高爾夫模擬開始時M吏用者安置高爾夫球於擊球塾上, 使得使用者能敲擊高岐球。此時,感測裝置獲得安置於擊球塾上之高爾 201244790 ==:::的影像找尋高爾夫卿)。這種高爾夫球找尋處 她r。爾2求從f獲得的剔象被找出,並且高爾夫球所在之座標上的資訊 < a果預雜件被滿足,縣球準襟完制Sll)。 咖在3擊轉備時,擊球伽_始感測擊球是否已經由使用者進行 — 心則到擊球已經進行時(S20) ’擊球細器確認何時擊球已經進 =收集擊球已經進行時的圖框影像以及之後的複數個圖框影像(,並 ,送所收集的圖框影像至高爾夫球影像處理裝置。另一方面,在感測到擊 球還未進仃時,歧程相鄉賴測步驟(S12)。 如果擊球侧器收集該等圖框影像,並在感測到擊球已經進行之後即 ,傳送所收觸該相框影像至高岐球影像處理裝置,則高爾夫球影像 處理裝置從:接收的影像分離預設區域,以抽取來源影像(幻2)。 接著’ tfi爾夫球影像處理裝置從所抽取的麟像移除背景影像卿), 以抽取多個高爾夫球候選者(S34)。 〜複數個照像機影像與所抽料料高爾夫球親者進概配,藉以獲 得二維座標㈣’並域該三賴標資織取比如在該等照雜以及相對 應該等高爾夫球候選者之間距離的纽,以估計每個高爾夫球候選者的大 小(S40)。 該等高爾夫球候選者或高爾夫球樣板考慮到每個高爾夫球候選者的 估計大小來正規化(S50)。 在正規化後,該等高爾夫球候選者與高爾夫球樣板匹配(S61)。 接著,δ玄專南爾夫球候選者以及高爾夫球樣板之間的相似程度被轉換 並計算成數值(S62)。 ' 如果在每個高爾夫球候選者以及高爾夫球樣板之間所計算的相似程 度小於預没數值’則相對應的高爾夫球候選者不被視為高爾夫球,並因而 被排除(S63)。另一方面,如果在每個高爾夫球候選者以及高爾夫球樣板之 間所计算的相似程度等於或大於預設數值’則相對應的高爾夫球候選者被 視為高爾夫球,並抽取相對應的高爾夫球候選者的座標(S64)。 以這種方式,在個別圖框中具有相似程度等於或大於預設數值的高爾 夫球候選者被辨識為高爾夫球,相對應的高爾夫球的座標數值被抽取,且 12 201244790 所抽取的高爾夫球的座標數值相互連結以計算高爾夫球的軌跡(S65)。 所計算的高爾夫球轨跡藉模擬器1實現為模擬影像(S7〇)。 從上述說明中顯而易見的是,在虛擬高爾夫模擬裝置以及其使用的感 :則裝^及方法其巾制虛織岐觀,麟伽者揮動冑爾夫球桿 敲擊南爾夫球所敲擊之高爾夫球的影像,以及㈣麟的影像找尋高爾夫 球计,尚爾夫球的移動轨跡,藉以實現高爾夫球執跡的模擬影像,尤其是 其中南爾夫球很容易且精確地從影像中抽取,以精確計算高爾夫球的軌 跡’藉以解決照像機所獲得之影像上高爾夫球的大小改變而很難抽取高爾 夫球的問題。 以上所述者僅為用以解釋本發明之較佳實施例,並非企圖據以對本發 明做任何形式上之關’是以,凡有在綱之發鴨神下所作有關本發明 之任何修飾或變更’皆仍應包括在本發明意祕護之範嘴。 【圖式簡單說明】 本發明的上軌其他目的、義及其他伽,可纟以上的詳細說明結 合所附圖式而被更加清楚了解,其中: 第1圓是顯示絲本發明實施例虛擬高爾夫難裝置賴㈣螢幕高爾夫 系統之實例的示意圖; 第2圆是顯示依據本發明實施例虛擬高爾夫模擬裝置之結構的方塊圖; 第3圖是顯示第2圖感測裝置的詳細結構及構成感測裝置之^件的功能的 示意圖; 第4圖⑻是齡贿單元所麟f彡像麻意圖,而第4圖⑼齡藉從第* _所示影像分離對應於預題段之區酬獲得之來源縣的示意7圖; 第5圖⑻是顯示來源影像的示意圖,第5 _是顯示靜 圖,而第5 _是顯示藉從來源影像移除f景影像所獲得之影像的示意圖^; 第6圖⑻是齡藉結好侧框賴得之影像上乡個酸的高_夫雜 選者Cl-丨至C4-1 ’其等如第4圖及苐5圆所示之處理以抽取所有高爾夫 球候選者’而第6 _是顯示預設並儲存以#作高爾夫球 爾夫球樣板T的示意圖;以及 象、问 第7圖是顯不依據本發明實施例用於虛擬高爾夫模擬裝i的感測方法的流 201244790 程圖。 【主要元件符號說明】 1 模擬器 2 高爾夫球室 3 螢幕 10 資料庫 20 資料處理部 30 影像輸出部 50 照像單元 51 拍攝裝置 52 拍攝裝置 60 感測處理單元 71 抓取器 72 擊球偵測器 73 轉換裝置 80 高爾夫球影像處理裝置 81 預先處理裝置 82 樣板匹配裝置 82a 估計裝置 82b 正規化裝置 82c 匹配裝置 90 高爾夫球桿影像處理裝置 100 擊球板 110 擊球台 120 擊球塾 200 影像 220 來源影像 230 背景影像 240 影像 14 201244790 B 而爾夫球 C1-1〜C4-1高爾夫球候選者 Μ 控制器 PI、Ρ2 點 S 感測裝置 S10〜S20步驟 S31〜S70步驟 T 1¾爾夫球樣板201244790 VI. Description of the Invention: [Technical Field] The present invention relates to a virtual golf simulation device and a sensing device and sensing method therefor, and more particularly to a virtual golf field that is imaged and simulated and used by a user The track of the hit golf ball is sensed by the sensing device and simulated on the virtual golf course's virtual golf simulation device' and the sensing device and sensing method it uses. [Prior Art] In recent years, many devices have been developed to allow users to enjoy popular sports games such as baseball, soccer, basketball, and golf in the form of interactive sports games indoors or in specific places. In particular, in recent years, a so-called screen golf system has been developed in which when the user swings the ball and slaps on the high-profile, the stunned warrior pulls out the movement. The physical information of the golf ball ± enables the golf ball's execution to be simulated on the virtual golf course 'by allowing the user to enjoy the golf in the virtual reality. In order to simulate the use of golf balls, such as golf balls, in such interactive sports games, many studies have broken through many (6) systems for accurately sensing physical information on moving golf balls, ie golf balls. mobile. For example, 'Xu Qian's position', such as the use of the external line controller, the sensing device using the laser device, the sensory button for the spleen wave system, and the feeling of the ship sensor. They have all peaked in the market. Many studies have been used by sensory sensor-type sensing to touch and analyze the image of a moving 6-ball, so that the mobile golf ball is sensed and the camera's slanting field is 111. The avatar machine is an image of the golf ball obtained in the @定 shooting area. The result is that when the high _ ball moves, the size of the golf ball in the image changes. For this reason, it is difficult to distinguish golf balls from noise towels. In particular, when using a camera to find a high-figure ball in an image obtained by a camera, it is difficult to accurately calculate the execution of the high-ball. 201244790 [Summary content] Therefore, the present invention has been made in view of the above problems, and an object of the present invention is to provide a 2 virtual golf simulation device in which a virtual golf simulation is used to obtain a user swinging a golf ball, and a club hitting a high ^ The image of the golf ball hit by the ball, and the search for the image from the obtained image, the ball 't counts the high path of the ball, so as to achieve the high ball trajectory of the image, especially its high skin material and shot The ground is pure, and the calculation of the golf ball, the trajectory, and the image obtained by the money-for-money machine are high. The problem of changing the size of the golf ball is difficult, and the sensing device and sensing method used are revealed. . According to a feature of the present invention, the above and other objects can be attained by providing a sensing device for a virtual golf simulation device, the thin device comprising: a photo camera unit for obtaining a user swinging a golf club in the golf course a golf ball and a plurality of acid images; and a sensing processing unit comprising: a pre-processing device and a template matching device, the pre-processing device inspecting the special image obtained by the female photo unit, thereby extracting a plurality of high-order images The candidate candidate ^' and the template matching device listens to the preset mine L-ball model, # is a reference image of the high-ball, and varies the selected Alf-ball candidates according to the size of each golf candidate. And the golf sample to extract information about the golf ball. According to another feature of the present invention, a virtual golf simulation I is provided, including a sensing device, which includes: a photo unit, a secret user, a reduced golf club, a golf club. The _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a golf ball candidate, and the template matching device is used for presetting and storing the golf ball template as a _ reference miscellaneous ball, and according to the size of each golf ball candidate, the golf ball is selected and matched. The ball candidate and the golf ball template are used to extract information of the golf ball; and an image realizing device for realizing the simulated image of the track of the golf ball according to the information extracted by the sensing processing unit. According to the present invention, a sensing method for virtual golf simulation is provided, which comprises: obtaining a plurality of frame images of a golf ball that a user swings a golf club to strike a golf ball; The images are for extracting a plurality of golf ball candidates; and according to the size of the female parent ball candidates, the selected golf candidates and a Shanlf ball model are matched and changed, the golf model system It is preset and stored to be used as a golf ball's 201244790 test image to extract golf information. [Embodiment] Now, an exemplary embodiment of a virtual golf simulation apparatus and method according to the present invention and a sensing apparatus and sensing method therefor will be described in detail with reference to the accompanying drawings. First, a virtual golf simulation apparatus according to an embodiment of the present invention and a sensing apparatus used therewith will be described with reference to the f1 diagram and the second diagram. Fig. 1 is a schematic diagram showing the outline of the screen golf system according to the virtual golf simulation apparatus of the embodiment of the present invention. A block diagram of the structure of a virtual golf simulation device applied to the Towel Golf Club. As shown in FIGS. 1 and 2, a virtual golf simulation apparatus according to an embodiment of the present invention includes a sensing device s for sensing a golf ball B tapped by a user, and an image for realizing a virtual golf course. And based on the sensing result of the sensing device S, the simulator i of the simulated image of the trajectory of the Balliff B is provided on the virtual golf course, so that the virtual golf simulation can be performed. As shown in FIG. 1, the screens of the virtual golf simulation apparatus according to the embodiment of the present invention can be configured to have a structure in which the hitting table 11 is disposed in a golf room 2 that provides a space of a preset size. On the ground, the user hits the golf ball B on the hitting table 11 , the hitting pad 120 is placed on one side of the hitting table ι 10 , and the golf ball B is placed on the hitting pad 120 to make the user The golf ball can be struck on the hitting table 11 and the screen 3 can be placed in front of the golf room 2 and output from the image output device (the image output unit 3 shown in Fig. 2, such as a beam projector). The image of the virtual golf simulation is projected onto the screen 3, and the image information is transmitted from the simulator 1 to the image output device. The ball table 110 and the ball striking pad 120 are provided on the blade 100 shown in Fig. 1. Alternatively, the batting station 110 and the ball striking pad 12A may be disposed on the ground of the golf room 2. The blade 100 can be set such that the blade iOO can be tilted by a predetermined angle in the forward and backward directions as well as in the left and right directions. Moreover, the blade 10 can be coupled to the simulator 1 such that the blade 100 can be tilted corresponding to the terrain of the currently implemented virtual golf course. At the same time, the sensing device S is disposed in the golf room 2 as shown in Fig. 1 to sense the two ball B struck by the user. That is, as shown in FIG. 2, the sensing device s includes the photographic unit 50 and the sensing processing unit 201244790, the photographic unit 50 includes a plurality of cameras 51 and 52, and the sensing processing unit 60 The image obtained by the photographing unit 50 is processed to extract the physical characteristics of the moving golf ball. The photographic unit 50 can be constructed by a single camera or more cameras for image sensing. In order to obtain an image of the mobile golf ball B and extract the coordinates of the golf ball in three-dimensional space, it is preferable to configure a stereoscopic image unit using two or more cameras 51 and 52 that are cooperatively coupled to each other, such as the first The figure shows. The physical characteristics of the moving Nalph ball may include the speed of the Nalph ball, the moving direction of the golf ball (the moving angle of the golf ball in the horizontal direction), the height of the golf ball (the moving angle of the golf ball in the vertical direction), and the golf ball. The rotation. The sensing processing unit 6G may include a gripper 7 and a golf ball image processing device 80, and a golf club image processing device 9A, wherein the gripper 71 is sequentially based on each frame. The 彡 元 赖 赖 赖 赖 赖 ' ' ' 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 72 The processing device 8 is configured to process the image received from the ball striking device 72 when the ball striking device senses that the golf ball has been tapped by the user, thereby extracting information on the physical characteristics of the moving golf ball, The club image processing device 9 analyzes the movement of the golf club by using the image received from the ball finder 72, whereby the information sensing processing unit (9) on the spinning rotation further includes the main switching device 73. , test matching camera 51 in ^ 彡 ^ borrow (10) silk ship lie shadow two-dimensional New Zealand (three-dimensional information extracted from each camera 'or reduce the ground, view the fine camera image extracted by the second We will convert it into two-dimensional information. Material processing unit 2G as well as a video output unit 3〇 The lean material library H) to store virtual golf simulation all the information necessary. For example, the image of the ship ====== silk/image output unit 30 outputs the image information received from the data processing unit 2G to the screen so that the 201244790 user can see the image. The controller 接收 receives information according to the sensing result of the sensing device S to control the operation of all components such as the database 10 of the simulator 1, the data processing unit 20, and the image output portion 3A. That is, the functions of the controller 资料, the database 1 and the data processing unit 2 are similar to the image realizing means for realizing the simulated image of the golf course in accordance with the sensing result of the sensing device S. Hereinafter, a more detailed structure of the sensing device S shown in Fig. 2 and the functions of the individual elements constituting the sensing device S will be described with reference to Fig. 3. As shown in FIG. 3, the transmission of information in the sensing device according to the present invention is a camera unit 5 - a gripper 71 - a ball striking detector 72 - a golf ball image processing device - a golf club image processing device 90 -> The order of the simulator 1 is performed. The photographing unit 50 photographs a preset range including a portion where the hitting table and the hitting pad are provided to obtain hundreds of frame images per second. The acquired image of the frame is transmitted to the gripper 71. The gripper 71 stores the image received from the photographing unit % and simultaneously transmits the image to the shot detector 72 for image processing. Preferably, the shot detector 72 finds the golf ball from the image received by the gripper and determines whether the golf ball satisfies the preset condition and whether the field test shot has been completed. Moreover, the hitting ball picker 72 is a high-ball hitting ball that is matched with the warp yarn and is used by the user. . The method of sensing whether the shot preparation has been completed and sensing whether the shot has been performed is not the core of the present invention, and thus the detailed description will omit ^& sensing that the individual has tapped the golf When the ball is in place, the hitting steel will store the image when the high ball has been tapped, and the subsequent multiple images. This is sent to the golf ball image processing device 8. So that the images can be processed by the high-ball = two = 80. On the other hand, ... the syllabus of the lake is 駄 _, 面面_ 72 The ball has been sharply hit before the multiple side frame image, and the image of the age is transmitted to the golf club image processing device 9 〇. The sorghum club image processing device ^ reduces the amount of material and mixes the 8G __ miscellaneous, extracts the pure image of the scorpion sister to drive the trajectory of the golf club head, thereby estimating the high-ball Yulfer ball miscellaneous device 8 (m and The information on the physical characteristics of the 201244790 golf ball extracted by the county tree is sent to the simulator 1β simulator to take out the simulated image, in which the golf ball moves on the virtual golf course according to the received information. So that the virtual golf simulation can be performed. The golf image processing device 80 preferably includes a pre-processing device 81 and a template matching device 82, wherein the pre-processing device 81 is configured to process images obtained by the individual cameras to extract a plurality of a golf ball candidate, and the template matching device 82 is configured to preset and process the golf model as a reference image of the golf ball, and to use for matching the selected golf candidates and the Nalph ball template. The information of the golf ball is extracted according to the size of the golf ball candidates. Since the images obtained by each camera contain many kinds of similar high The shape of the ball and the noise of the golf ball image (for example, a specific part of the terrain near the golf ball, a part of the user's body and the head of the golf club) 'so it is necessary to accurately extract the golf ball from the image. For this purpose' The pre-processing device 81 processes the image to select and extract a plurality of objects mainly regarded as golf balls, and serves as a candidate for the golf ball. The template matching device recognizes that the plurality of golf candidates extracted are similar to Shanlf One of the ball templates is used as a ball for the Nalph, and the coordinates of the identified golf ball are extracted to calculate the trajectory information of the golf ball. However, the 'model matching device does not easily compare the golf candidates and Golf sample. The reason is that the size of the golf ball candidate in one frame may be different from the size of the golf ball in the other frame. As a result, the size of the golf ball in different frames will be different. This is because The shooting area of the camera is fixed, and the distance between the camera and the golf ball changes in the shooting area according to the movement of the golf ball, If the size of the image of the golf ball moved in the individual frames is different from each other. On the other hand, the size and shape of the golf sample are uniformly fixed. If the golf candidate is compared with the golf sample without change, it cannot be determined. How the golf candidate is similar to the golf model, and therefore cannot accurately extract the golf ball. For this, the 'template matching device estimates the size of the golf candidate and varies the matching golf candidate according to the estimated size of the golf candidate. And the golf model, in order to extract the similarity between them, so that the golf ball can be accurately identified. Hereinafter, the image processing performed by the pre-processing device will be described with reference to FIGS. 3 to 5. First, the pre-processing device 81 (see Fig. 3) The source image 220 shown in Fig. 4 (8) is separated from the 201244790 image 200 obtained by the camera shown in Fig. 4 (8). Since the image obtained by the camera contains a wide shooting range, the image 200 is processed a lot of time. To this end, the necessary areas are extracted. The amount of money is processed to reduce the image processing time. /, the image to be extracted is shown in Figure 4 (b). The source image 22 is defined as the first P1 _ P (four), that is, when the golf ball is tapped, the golf ball flies to the screen 3 ( See the figure). For the separation of the ball from the point where the ball has been hit, to the distance that has already entered the ^ ^ ^ ^ distance, enough to count the «message" such as the high-angle angle front - imrr2 can correspond to the position of the screen 3 (10) 1 或 or away The screen is specified from the image obtained by the camera to the point P1 and the point P2, and the image corresponding to the segment between the point and the point is separated from the image obtained by the camera to obtain the image shown in FIG. 4 (9). Source image. At the same time, the back should be removed from the source image obtained as described above via the difference operation, as shown in Fig. 5, so that only the golf candidate can be obtained. For example, the background image 230 shown in Fig. 5 (9) can be removed from the source image 22A shown in Fig. 5 (8) via a difference operation to obtain an image having only a moving portion shown in Fig. (c). The moving portion of the image extracted by the difference operation is not considered a golf ball. Some moving parts are noises, such as a part of a golf club head or a part of the user's body. . As a result, the pre-processing device designates the portion of the image 240 obtained by the difference operation as the golf ball as the golf ball candidate in accordance with the geometrical characteristics of the golf ball. For example, a portion of a large width to height ratio is not considered a golf ball, and thus such a portion is excluded. Moreover, portions having a size of one or two pixels are small and are not considered to be golf balls, and thus such parts are excluded. The remainder of the image obtained from the geometrical characteristics of the golf ball is designated as a golf candidate. Figure 5(c) shows that the two extracted golf ball candidates cl4 and C1_2 have been drawn. The invention is shown in the invention. (4) The processing is performed with respect to the brewing image. According to the present, each of the female ore quilts is subjected to the above-described processing to extract the golf ball candidates from the frame image and all the frame images obtained after the hitting has been performed. In the following, reference will be made to Figures 3 to 6 to illustrate that the sample is complemented by the device, and the processing is as shown in Figures 4 and 5 for extraction. All Gore ^ Γίΐ, ) is a schematic diagram showing the Tonger ball sample 以 with the reference image of #高岐球. In the sixth _, the golf ball candidates C1] and C1_2 represent the Gaulle candidates extracted from the first frame of the source image, and (3) the golf candidate 'C3-1 extracted from the second frame indicates the slave. The golf ball candidate captured in the third figure, two (4) represents the golf ball candidate extracted from the fourth frame. The template matching device 82 includes an estimating device 82a, a normalizing device, and a matching device 82c, wherein the estimated device 82a is used to estimate the golf candidate extracted by the pre-processing device (4) (see FIG. 5_size 'normalizing device 82b) In order to normalize the golf candidate, each South® golfer candidate has a size corresponding to the golf sample, and the matching device is used to match the positive, high, and high-profile boards for extraction. The degree of similarity, and the golf ball is sought from the golf candidate to extract the coordinate information. The estimating device 823 estimates the size of each of the selected golf candidates in the three-cell. The image obtained by each camera includes two-dimensional. Therefore, in order to calculate the size of each golf candidate in the three-dimensional space, the three-dimensional seat (10) of each of the high-altitude candidates is extracted by the converting device 73 (see FIGS. 2 and 3) in the three-dimensional space. The distance between each golf ball candidate and the corresponding camera is calculated using the extracted three-dimensional coordinate information, thereby estimating the size of each golf candidate. That is, the estimation device 82a estimates the size of each of the plurality of golf balls C1-1 to C4-1 of the plurality of images shown in Fig. 6 (4) in the three-dimensional space using the conversion device 73. As can be seen from Fig. 6(a) The size of each golfer in the 'individual frame' is different from each other. This phenomenon occurs because the Malfoy ball moves in the shooting area, and as a result, the distance between the camera and the golf ball changes. The size of the golf candidate in the individual frame uses three 201244790 dimensions, the coordinate value between them is estimated, and the size of each golf candidate is changed by borrowing, so that the size of each Shanrf miscellaneous is the object of Gaofufu. The ball template is small, or the size of the golf sample is changed such that the A small of the high profile is equal to the size of each golf candidate' and the golf candidate is compared with the golf sample to determine the golf candidate pair How much is the golf model, and the golfer is eager to find the real golf ball. > Normalization device 82b takes into account the estimation of each golf candidate estimated by the estimation device ❿ 4 large j and normalize each of the 8 golf ball candidates so that the size of each golf candidate is equal to 'the size of the golf sample τ', or normalize the high-limb model τ to make the golf 1 sample τ The big money is equal to the size of each golfer. The normalization of the golf candidate is the processing of the deformation of the golf candidate image, so that the golf candidate's big wait is equal to the fine-like shape, and the transfer is small. The shape and pixel ratio of the golf candidate image are used to achieve an easy axis comparison between the golf ball candidate and the high-ball model. Another aspect is that the normalization of the high-ball model τ is the processing of the deformation of the high-ball sample. 'The size of the golf ball model is equal to the size of the corresponding golfer', and the pixel-to-pixel ratio of the image of the golf ball is changed to achieve an easy comparison between the golf sample and the golfer candidate. In the normalization of the golf ball candidate or the golf ball template via the normalization device 82b, the matching device 82c is compared with each golf ball candidate and the Golfer model plate, so as to extract the similarity degree and convert the silkworm New lines, such as overall shape, pixel and pixel value distribution. #相约度等或大关设置办, where a corresponding golf candidate can be identified as "golf ball,". According to the matching result, the coordinate value of the golf candidate recognized as the golf ball can be extracted. 'And according to the standard of the pure standard, calculate the Wei on the miscellaneous, such as the speed, direction, and elevation angle of the ball. In the following, the method of sensing the virtual golf ball according to the present invention will be described with reference to the seventh embodiment. When the virtual golf simulation begins, the M user places the golf ball on the batting ball so that the user can tap the high ball. At this time, the sensing device is placed on the hitting ball. Goal 201244790 == :::The image is looking for the golfer.) This kind of golf is looking for her r. 2 The tick obtained from f is found, and the information on the coordinates of the golf ball is satisfied. , County ball 襟 襟 S ll 。 。 。 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖 咖Confirm when the shot has been entered = collect the shot has been The frame image during the execution and the subsequent plurality of frame images (and, the collected frame image is sent to the golf image processing device. On the other hand, when it is sensed that the hitting has not yet entered, the ambiguity The step of measuring the home (S12). If the hitting side collects the image of the frame, and after sensing that the hitting has been performed, then transmitting the image of the photo frame to the high-definition image processing device, the golf ball The image processing device separates the preset area from the received image to extract the source image (Magic 2). Then the 'tfi golf ball image processing device removes the background image from the extracted image to extract a plurality of golf balls Candidates (S34). ~ Multiple camera images are matched with the materials of the golfer, to obtain a two-dimensional coordinate (four) 'and the three-dimensional pledges are woven, for example, in such The distance between the golf candidates should be equal to estimate the size of each golf candidate (S40). The golf candidates or golf templates are normalized in consideration of the estimated size of each golf candidate. (S50) After normalization, the golf candidates match the golf sample (S61). Next, the degree of similarity between the δ 玄 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳 纳'If the degree of similarity calculated between each golf candidate and the golf sample is less than the pre-null value' then the corresponding golf candidate is not considered a golf ball and is thus excluded (S63). In one aspect, if the calculated degree of similarity between each golf candidate and the golf sample is equal to or greater than a preset value ', the corresponding golf candidate is regarded as a golf ball, and the corresponding golf ball is extracted a coordinate of the candidate (S64). In this manner, a golf ball candidate having a degree of similarity equal to or greater than a preset value in the individual frame is recognized as a golf ball, and a coordinate value of the corresponding golf ball is extracted, and 12 201244790 The coordinate values of the extracted golf balls are connected to each other to calculate the trajectory of the golf ball (S65). The calculated golf ball track is implemented by the simulator 1 as an analog image (S7〇). It is obvious from the above description that in the virtual golf simulation device and the sense of its use: the installation and the method of the towel imaginary woven, the lyrics waved the golfer to hit the Nalph ball The image of the golf ball, and (4) Lin's image to find the golf meter, the movement path of the ball, to achieve the simulated image of the golf track, especially where the Nalph ball is easily and accurately from the image. The problem of extracting, in order to accurately calculate the trajectory of the golf ball, is to solve the problem that it is difficult to extract the golf ball by solving the change in the size of the golf ball on the image obtained by the camera. The above is only a preferred embodiment for explaining the present invention, and is not intended to be in any form to dictate the invention. 'All should still be included in the mouth of the invention. BRIEF DESCRIPTION OF THE DRAWINGS Other objects, advantages and other features of the present invention can be more clearly understood from the following description in conjunction with the accompanying drawings in which: A schematic diagram of an example of a hard-to-play device (four) screen golf system; a second circle is a block diagram showing the structure of a virtual golf simulation device according to an embodiment of the present invention; and a third figure is a detailed structure and composition sensing of the sensing device of FIG. Schematic diagram of the function of the device; Figure 4 (8) is the intention of the bribe unit, and Figure 4 (9) is separated from the image shown by the *__ corresponding to the pre-title section. Figure 7 of the source county; Figure 5 (8) is a schematic diagram showing the source image, the fifth _ is a static image, and the fifth _ is a schematic diagram showing the image obtained by removing the image of the f scene from the source image; 6 (8) is the process of drawing the good side frame and relying on the image of the high acid _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Ball candidate 'and the 6th _ is the display preset and saves with # Golf golf ball schematic template T; and like, Q is a view showing a seventh embodiment according to the present invention is not significantly embodiment 201244790 flow chart for sensing method of the virtual golf simulation apparatus i. [Description of main component symbols] 1 Simulator 2 Golf room 3 Screen 10 Library 20 Data processing unit 30 Image output unit 50 Photo unit 51 Imaging device 52 Imaging device 60 Sensing processing unit 71 Grabber 72 Shooting detection 73 conversion device 80 golf ball image processing device 81 pre-processing device 82 template matching device 82a estimation device 82b normalization device 82c matching device 90 golf club image processing device 100 ball striking plate 110 batting station 120 hitting ball 200 image 220 Source image 230 Background image 240 Image 14 201244790 B Golf ball C1-1~C4-1 Golf candidate Μ Controller PI, Ρ2 point S Sensing device S10~S20 Step S31~S70 Step T 13⁄4 Wolf ball template