201227534 1 W&ybbFiOi 六、發明說明: 【發明所屬之技術領域】 本案是有關於一種影像之比對方法及系統,且特別是 有關於一種影像之紋理特徵點比對方法及系統。 【先前技術】 現今特徵點擷取較常見的技術為角點偵測,其角點偵 測方法眾多,目的是在灰階影像中找出較具有鑑別度的特 徵點位置,希望能排除容易比對錯誤的直線與亮度值變化 ® 較為一致的區域,而擷取出的特徵點通常為灰階影像亮度 值對比較強烈且較為角落的區域,其效果雖然穩定,但所 偵測到的特徵點點數不夠密集,其實在灰階影像中還有很 多區域其比對的鑑別度也是相當高的。 傳統的比對方法有光流法與眾多的區塊比對方法,傳 統光流法因為其本身理論的定義限制,無法比對移動量較 大的特徵點,對於光線變化較無抑制能力,且速度上也稍 Φ 嫌太慢。 【發明内容】 本案係有關於一種影像之比對方法及系統,其利用區 塊比對方法,其對光線變化有一定的抑制能力。 根據本案之第一方面,提出一種影像之紋理特徵點比 對方法。紋理特徵點比對方法包括以下步驟。接收一參考 影像及一目標影像。依據參考影像,產生一局部二元圖形 (Local Binary Pattern,LBP)參考影像,並依據目標 201227534201227534 1 W&ybbFiOi VI. Description of the Invention: [Technical Field of the Invention] The present invention relates to an image comparison method and system, and more particularly to a texture feature point comparison method and system for an image. [Prior Art] Nowadays, the more common techniques for feature point extraction are corner detection. There are many methods for detecting corner points. The purpose is to find the location of feature points with more discrimination in grayscale images, hoping to eliminate easy comparison. The wrong line and the brightness value change are more consistent areas, and the extracted feature points are usually the areas where the gray image brightness value is stronger and more corners. Although the effect is stable, the number of feature points detected is Not dense enough, in fact, there are still many regions in the grayscale image, the degree of discrimination of the comparison is also quite high. The traditional method of comparison has the optical flow method and a large number of block comparison methods. The traditional optical flow method is limited by the definition of its own theory, and cannot compare the feature points with larger movement amount, and has no inhibition ability for light changes. The speed is also slightly Φ too slow. SUMMARY OF THE INVENTION The present invention relates to an image comparison method and system, which utilizes a block comparison method, which has a certain ability to suppress light changes. According to the first aspect of the present invention, a texture feature point comparison method for an image is proposed. The texture feature point comparison method includes the following steps. Receive a reference image and a target image. According to the reference image, a local Binary Pattern (LBP) reference image is generated and according to the target 201227534
TW6966PA 影像產生-LBP目標影像。彳貞測LBp參考 彻, 紋理特徵點。依據此些參考紋理特徵點, =考 比對出對應之數個目標紋理特徵點。、βΡ目“影像 根據本案之一第二方面,提出一種 比對系統。紋理特徵點比對系統包括一象局之^里特^點 (Locai Binary mtern,咖)產生單元 形 f 一比對單元。提供單元㈣純—提 =早疋 考影像及-目標影像。£βρ產生單元係 2 =-參 生- LBP參考影像,並依據目標參考衫像,產 像尋找對應之數個目標紋理特徵點特徵點’於聊目標影 例’並配合所:圖之ί述:::如更:解,下文特舉實施 【實施方式】 請參照第1圖及第2圖,第 紋理特徵點比對方法之流程圖,第本實施例衫像之 之紋理特徵點比對系統1〇〇==圖綠示本實施例影像 徵點比對方法主要包含三個部方八4圖°本實施例之紋理特 取、⑴局部二元圖形(L〇c^ .⑴紋理特徵點的榻 像之區塊比對及(3 )維盤站lnary Pattern,LBP)影 Difference,SAD) 掄、=、差和(sum of Absolute 像之紋理特徵點比對系系搭配第2圖之影 所屬技術領域中具有通常知識者均例本::比= .忘. 4 201227534 法並不侷限應用於第2圖之比對系統100,也不侷限於下 述之演算示例。 (1)紋理特徵點擷取的擷取: 如第1圖所示,在步驟S101中,提供單元110提供 一參考影像Ir及一目標影像It,以供本實施例影像之紋 理特徵點比對系統100接收。提供單元110例如是一攝影 機、一照相機或儲存數張影像之儲存裝置。參考影像Ir 及目標影像It例如是連續拍攝之前一刻影像及當下刻影 φ 像。 接著,在步驟S102中,LBP產生單元120依據參考 影像Ir,產生一 LBP參考影像LBPr,並依據目標影像It 產生一 LBP目標影像LBPt。 舉例來說,本實施例之LBP參考影像LBPr的產生方 法是從參考影像Ir上進行3x3的遮罩運算所產生的結 果,而3x3的遮罩運算方法是比較遮罩中心點之參考像素 Pr之亮度與周遭8個參考像素Pr之亮度的大小關係。 • 請參照第3圖,其繪示LBP運算示意圖。參考影像The TW6966PA image generation - LBP target image. Measure the LBp reference, texture feature points. According to the reference texture feature points, the corresponding target texture feature points are compared. According to the second aspect of the present invention, a comparison system is proposed. The texture feature point comparison system includes a Loca Binary mtern (cafe) generating a unit shape f-aligning unit. Provide unit (4) pure - mention = early reference image and - target image. £βρ generation unit 2 = - participation - LBP reference image, and according to the target reference shirt image, the image looks for the corresponding number of target texture feature points Feature point 'in the target image' and cooperate with: Figure::: More: solution, the following special implementation [implementation] Please refer to Figure 1 and Figure 2, texture feature point comparison method The flow chart of the texture feature point comparison system of the first embodiment of the present invention is 〇〇==Fig. Green. The image point comparison method of the embodiment mainly includes three parts and eight figures. The texture of this embodiment Special extraction, (1) partial binary graphics (L〇c^. (1) block comparison of tatographic features of texture feature points and (3) lnary Pattern, LBP), Difference, SAD) 抡, =, difference and Sum of Absolute image texture point matching system with the shadow of the second picture belongs to the technical field The average person who has the usual knowledge:: ratio = . Forgot. 4 201227534 The method is not limited to the comparison system 100 of Figure 2, nor is it limited to the following calculation examples. (1) Texture feature points As shown in FIG. 1 , in step S101 , the providing unit 110 provides a reference image Ir and a target image It for receiving by the texture feature point comparison system 100 of the image of the embodiment. The providing unit 110 is, for example, a camera, a camera or a storage device for storing a plurality of images. The reference image Ir and the target image It are, for example, a moment before the continuous shooting and the current φ image. Next, in step S102, the LBP generating unit 120 is based on the reference image Ir. An LBP reference image LBPr is generated, and an LBP target image LBPt is generated according to the target image It. For example, the LBP reference image LBPr of the embodiment is generated by performing a 3x3 mask operation on the reference image Ir. As a result, the 3x3 mask operation method compares the brightness of the reference pixel Pr of the center point of the mask with the brightness of the surrounding eight reference pixels Pr. • Refer to FIG. 3, which shows L. BP operation diagram. Reference image
Ir之一個參考像素Pr的亮度可以用8位元來表示,其分 別表示為bl、b2、b3、b4、b5、b6、b7、b8。當鄰近之參 考像Pr之亮度大於中心參考像素Pr之亮度,則設定其值 為1 ;否則設定其值為0。如第3圖右側所示,最後所產 生的8位元LBP值為「11111100」。參考影像Ir的每一個 參考像素Pr皆計算其LBP值後,即可獲得LBP參考影像 LBPr。 請參照附圖1,其繪示數張原始影像及其LBP影像。 201227534The luminance of one reference pixel Pr of Ir can be expressed by 8 bits, which are denoted as bl, b2, b3, b4, b5, b6, b7, b8, respectively. When the brightness of the adjacent reference image Pr is greater than the brightness of the center reference pixel Pr, the value is set to 1; otherwise, the value is set to 0. As shown on the right side of Figure 3, the last 8-bit LBP value is "11111100". The LBP reference image LBPr is obtained after each of the reference pixels Pr of the reference image Ir calculates its LBP value. Referring to FIG. 1, a plurality of original images and their LBP images are illustrated. 201227534
TW6966PA 附圖1之上排影像為亮度不 ”TW6966PA The upper row of images in Figure 1 is not brightness."
影像為其對應之LBP影像。由附影像:附圖1之下排 -種區域性的亮度對比關係、可以付知LBP影像是 有相當程度的容忍能力。當 $或較暗),對光線變化 影像不會有太大的變動 始衫像的光線變化時,其LBP 然後’在步驟S103中,備制留_ 像Ir之數個目標紋理特 “早70 130摘測出參考影 方法之前,先說明债測單元^說明紋理特徵點掏取 (H_ — Stance)來求得兩個Glb=依 =:月距離 在LBP影像中,一個 值之差異里。 =::r 大小,_===; 二行二進制的8位元與: 否則皆的結果,==°才會有〇的結果, 其數值為丨_數,斥(㈣邏輯運算後 如下式⑴為例,「10110111」與Γ1011ιηιη XOR 10111010 οοοοΰοι · : = 結果為其漢明距離為3。= 數較U漢明距離越大,表㈣差異度越大的 ► · · · ·鲁♦ .............................C1) 請參照第4圖,其綸干一泉去 參考像素如一6):意:考:參素考 f 7X7的參考像讀_ ’財考像素Pro射心: 個圓C,而周遭會有16個參考像素xi位於這個圓c = 201227534The image is its corresponding LBP image. From the attached image: Figure 1 below, a kind of regional brightness contrast relationship, it can be known that the LBP image has a considerable degree of tolerance. When $ or darker, the light change image does not change much when the light of the starter image changes, and the LBP then 'in step S103, prepares the remaining _ like Ir's several target textures. Before extracting the reference shadow method, first explain the debt measurement unit ^ to describe the texture feature point extraction (H_ - Stance) to obtain two Glb=== month distance in the LBP image, a difference in value. ::r size, _===; 2 lines of binary octets and: Otherwise, the result of all, == ° will have a 〇 result, the value is 丨 _ number, repulsion ((4) logic operation is as follows (1) For example, "10110111" and Γ1011ιηιη XOR 10111010 οοοοΰοι · : = The result is that the Hamming distance is 3. = The greater the distance from the U Hamming, the greater the difference in the table (four) ► · · · · Lu ♦ ... ..........................C1) Please refer to Figure 4, its Ranganquanquan reference pixel as a 6): meaning: test: Reference test f 7X7 reference like reading _ 'Cai Kong Pixel Pro Shooting: a circle C, and there will be 16 reference pixels xi around this circle c = 201227534
I W6966PA (i=l〜16)。偵測單元13。並設定一臨:值莫:距^ 個漢明距離U足义_ y時,羞2虽連續η :我們所要練的一個參考紋理特徵點卜。其中考:素Pr〇 表不參考像素Pr〇與參考像 、 參考像素Pr0之附近為平滑區域時,其H大。所以,當 比較低。並且漢明距離u足"二'mu 表示此參考像素Pr0的幾何角度程的連續數量可以 Pr〇為角點時,其漢明距㈣一滿;"列如’ 像素 简直線邊緣時,其:莫二 足_%>丨的連續數量會比較小。在 〜禹 130 t:參數°來排除容易比對錯誤恤邊:測單元 明參照附圖2’其繪示參考紋理特徵點緣立 上述條^之參,素^即可_為參考紋理足 (2 ) LBP影像之區塊比對· 接著’在步驟S104中,比對罝* 1/ln 紋理特徵點fr,於目標,像If t 140依據此些參考 理特徵點ft。、ι ?出對應之數個目標紋 目找^LB!^生早疋12G得到LBP參考影像咖盘LBP 接二2測單f 13Q _出參考紋理特徵點 目標紋理特徵f"t仃可== 置比對來^目標影像It的 點^與目標紋理特徵點ft對應^出參考紋理特徵 201227534I W6966PA (i=l~16). Detection unit 13. And set a side: value Mo: from ^ Hamming distance U foot _ y, shame 2 although continuous η: a reference texture feature point we want to practice. The test is as follows: When the vicinity of the pixel Pr 〇 and the reference image and the reference pixel Pr0 are smooth regions, the H is large. So when it is lower. And Hamming distance u foot " two 'mu indicates that the continuous number of geometric angles of this reference pixel Pr0 can be Pr 〇 corner point, its Hamming distance (four) is full; " column such as 'pixel simple straight edge, It: the number of consecutive _%> 丨 连续 will be relatively small. In the ~ 禹 130 t: parameter ° to rule out the easy comparison of the wrong shirt side: the measurement unit clearly refers to Figure 2', which shows the reference texture feature point edge of the above-mentioned article ^, can be _ for the reference texture foot ( 2) Block alignment of the LBP image. Then, in step S104, the 罝*1/ln texture feature point fr is compared to the target, such as If t 140, according to the reference feature points ft. , ι out the corresponding number of target lines to find ^ LB! ^ 生早疋 12G get LBP reference image coffee tray LBP 2 2 test list f 13Q _ out reference texture feature point target texture feature f"t仃可== Set the comparison ^ the target image It's point ^ corresponds to the target texture feature point ft ^ out reference texture feature 201227534
TW6966PA * j 舉例來說,請參考第5圖,其繪示LBP區塊比對之示 意圖。比對單元140於目標影像It尋找出對應於一參考 紋理特徵點fr之位置(^7)。 接著,以位置為中心,在目標影像It框選出7χ7 搜尋範圍R。比對單元14〇並在參考影像Ιγ中,以參考紋 理特徵點fr為中心框選出3χ3參考比對區塊rl。比對單 元140更在7x7搜尋範圍R内,以每一目標像素pt為中 〜任思框選出3x3目標比對區塊r2。如此將可以框選出7 π個目標對比區塊r2 (第5圖僅繪示出一個目標比對區 塊 r2 ) 〇 然後,比對單元140計算參考比對區塊rl與每一目 標比對區塊r2的漢明距離總和。其數學式表示如下式 (2 ) · 廿 … ............(2) 八中Μ為移動向量’ 4U],„e[_33],ve[姊妹七”力 為參考影像Ir巾,座標為(x+i,w)的參考像素&之咖 值。味_,_ν)為目標影像It中,座標為+一)的 參考像素Pt之LBP值。 當統計完7x7搜尋範圍内所有參考像素阡與目梹 素Pt之漢明距離κ„,ν)時,設定_門檀值。當漢明^離 叫如)小於此門檻值時’表示此參考像素阡與此 素Pt之相似度夠高,則設定此目標像 不 徵…候選點,最後…尋範圍 201227534 woyoom 點)考紋理特徵點卜與多個可能的目標紋理特徵 點ft的移動向量(wv)的集合。 竹伋 (?絕對誤差和(SAD)之區塊比對: 紋理:ί點步是:中,判斷單元150判斷每-參考 僅對應於一個目標紋理特徵點ft。若 fi,則:考紋理特徵點^對應於多個目標紋理特徵點 it,則進入步驟Si〇6。 又點 fr 160 (‘ 〇uUu e D Γ徵‘點^之亮度的絕對誤差和 標紋理特徵點ft㈣⑽心卿選取其中之一目 un -舉例來說’經過上述LBP 11塊比對之後,比對單-=到座標為(撕考紋理特徵點fr可能對岸t = =)’而對應於多個目標紋理特徵點二 理=二:固參考紋理特徵點斤對應於-個目乂 竹㈣u u卩真正移動向量(mv))。 16〇將和(SAD)是—個全域的搜尋法,選取單元 入二與參考紋理特徵點“ 及其對應之最❹的目絲小的軸向量Μ (―)。-的目“理特徵點⑽,其座標為 (^W*,^ + V*)=arg SAD{l>y)(x + U}y + v).......................... 輯運== = =離:實作上’將心i 直接利用查表的方式來計算j 201227534TW6966PA * j For example, please refer to Figure 5, which shows the LBP block alignment. The matching unit 140 finds a position (^7) corresponding to a reference texture feature point fr at the target image It. Next, with the position as the center, the 7χ7 search range R is selected in the target image It box. The comparison unit 14 〇 and in the reference image Ι γ, selects the 3 χ 3 reference alignment block rl with the reference texture feature point fr as the center. The comparison unit 140 is further in the 7x7 search range R, and the target 3x3 target comparison block r2 is selected for each target pixel pt. Thus, 7 π target contrast blocks r2 can be selected (the fifth graph only shows one target comparison block r2). Then, the comparison unit 140 calculates the reference comparison block rl and each target alignment area. The sum of the Hamming distances of the block r2. Its mathematical expression is expressed by the following formula (2) · 廿... ............(2) Eight middle Μ is the moving vector '4U', „e[_33], ve[Sister Seven” force is The reference image Ir towel, the coordinate value of the reference pixel & (x + i, w). The taste _, _ν is the LBP value of the reference pixel Pt whose coordinates are + a) in the target image It. When counting all the reference pixels in the 7x7 search range and the Hamming distance κ„, ν) of the target Pt, set the _ gate value. When the Hamming ^ is called less than this threshold, 'represent this reference. The similarity between the pixel 阡 and the prime Pt is high enough, then the target image is set to be unrecognized... the candidate point, and finally... the search range 201227534 woyoom point) the motion vector of the texture feature point and the motion vector of the plurality of possible target texture feature points ft ( The set of wv). The bamboo block (? Absolute error sum (SAD) block comparison: texture: ί point step is: medium, the judgment unit 150 judges that each reference only corresponds to one target texture feature point ft. If fi, Then: the texture feature point ^ corresponds to a plurality of target texture feature points it, then proceeds to step Si 〇 6. Also fr 160 (' 〇uUu e D Γ ' 'point ^ the absolute error of the brightness and the standard texture feature point ft (four) (10) The heart selects one of the items un - for example, 'after the above LBP 11 block alignment, the comparison single-= to the coordinates is (the texture feature point fr may be opposite the shore t = =)' corresponds to multiple target textures Feature point two rationality = two: solid reference texture feature point kg corresponds to - a target bamboo (four) u u卩Real motion vector (mv). 16〇(SAD) is a global search method, which selects the unit into the reference texture feature point and its corresponding minimum axis vector. (―).- The objective of the feature point (10), whose coordinates are (^W*,^ + V*)=arg SAD{l>y)(x + U}y + v)....... ................... 运运=====Off: In fact, 'I will use the way of looking up the table directly to calculate j 201227534
TW6966PA 的個數。如第2圖所示’儲存單元170可以建立一個8位 元的漢明距離表,其資料表大小為8x256 = 2, 048 bits, 如下表1所示: XOR運算之漢明距 第1 第2 第3 第4 第5 第6 第7 第8 1的 位元 位元 位元 位元 位元 位元 位元 位元 數量 0 0 — 0 0 0 —0 0 0 0 0 0 0 0 0 ' 0 0 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 —0 1 1 2The number of TW6966PA. As shown in Fig. 2, the storage unit 170 can establish an 8-bit Hamming distance table whose data table size is 8x256 = 2, 048 bits, as shown in Table 1 below: Hamming distance of the XOR operation is the first 2nd 3rd, 4th, 5th, 6th, 8th, 8th, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th, 1st, 8th 1 1 0 0 0 0 0 0 1 0 1 0 0 0 0 0 —0 1 1 2
-----^~L—ί_____ 查表單元180可以依據漢明距離表查出漢明距離 需要計算32 bits的XOR運算,也只需要進行4次查名 可快速完成,有助於整體效能的提升。 本實施例中所使用的是區塊比對方法,因為使用^ 徵經實驗㈣’對於光線變化有—定的抑缝力,且濱 上利用特徵點擷取方法中特徵影像的資料結構,搭配逢 方式’大大的減少計算缝與—般區塊比對方法相較: 201227534 1 wovoor/x 擁有較而的效能。 綜上所述,雖然本案已以實施例揭露如上,然其並非 用以限定本案。本案所屬技術領域中具有通常知識者,在 不脫離本案之精神和範圍内,當可作各種之更動與潤飾。 因此,本案之保護範圍當視後附之申請專利範圍所界定者 為準。 【圖式簡單說明】 第1圖繪示本實施例影像之紋理特徵點比對方法之 鲁流程圖。 第2圖繪示本實施例影像之紋理特徵點比對系統之 方塊圖。 第3圖繪示LBP運算示意圖。 第4圖繪示一參考像素與周遭16個參考像素之示意 圖。 第5圖繪示LBP區塊比對之示意圖。 φ 附圖1繪示數張原始影像及其LBP影像。 附圖2繪示參考紋理特徵點之示意圖。 【主要元件符號說明】 100 :紋理特徵點比對系統 110 :提供單元 120 : LBP產生單元 130 :偵測單元 140 :比對單元 201227534-----^~L_ί_____ The table lookup unit 180 can calculate the 32-bit XOR operation according to the Hamming distance table to find the Hamming distance, and only needs 4 times to find the name to complete quickly, which contributes to the overall performance. Improvement. In this embodiment, the block comparison method is used, because the use of ^ experiment (4) 'has a certain suppression force for light changes, and the data structure of the feature image in the feature point extraction method on the beach is matched with In the way of 'significantly reduce the calculation of the seam compared with the general block comparison method: 201227534 1 wovoor / x has a relatively good performance. In summary, although the present invention has been disclosed above by way of example, it is not intended to limit the present invention. Those who have ordinary knowledge in the technical field of the present invention can make various changes and refinements without departing from the spirit and scope of the case. Therefore, the scope of protection in this case is subject to the definition of the scope of the patent application attached. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a flow chart showing a method for comparing texture feature points of an image of the present embodiment. Fig. 2 is a block diagram showing the texture feature point comparison system of the image of the embodiment. Figure 3 shows a schematic diagram of the LBP operation. Figure 4 is a schematic diagram of a reference pixel and surrounding 16 reference pixels. Figure 5 is a schematic diagram showing the comparison of LBP blocks. φ Figure 1 shows several original images and their LBP images. 2 is a schematic diagram of a reference texture feature point. [Main Component Symbol Description] 100: Texture Feature Point Alignment System 110: Providing Unit 120: LBP Generating Unit 130: Detecting Unit 140: Aligning Unit 201227534
TW6966PA 150 :判斷單元 160 :選取單元 170 :儲存單元 180 :查表單元 位元 b卜 b2 ' b3、b4 ' b5 ' b6 ' b7、b8 C :圓 fr :參考紋理特徵點 ft、ft* :目標紋理特徵點 Ir :參考影像 It :目標影像 LBPr : LBP參考影像 LBPt : LBP目標影像 Pr、PrO、xi :參考像素 Pt :目標像素 R :搜尋範圍 r 1 :參考比對區塊 r2 :目標比對區塊 S101〜S106 :流程步驟 12TW6966PA 150 : Judging unit 160 : Selection unit 170 : Storage unit 180 : Table lookup unit bit b b b ' b3, b4 ' b5 ' b6 ' b7, b8 C : Circle fr : Reference texture feature point ft, ft * : target Texture feature point Ir: Reference image It: Target image LBPr: LBP reference image LBPt: LBP target image Pr, PrO, xi: Reference pixel Pt: Target pixel R: Search range r 1 : Reference comparison block r2: Target comparison Blocks S101 to S106: Flow Step 12