578118 A7 B7 -PA01Q555.DOG-3/g6 五、發明説明(/ ) 【技術領域】 (請先閱讀背面之注意事項再填寫本頁) 本發明係關於一種從車輛影像中擷取車牌區域及矯正 車牌歪斜的方法及裝置,特別是可應用於車牌自動辨識系 統及交通監控、車輛門禁的車牌區域影像之切取以及車牌 5 影像歪斜之矯正。 【先前技術】 按,車輛影像中之車牌區域的定位及切取是車牌自動 辨識的前置處理程序,因此其準確性影響車牌自動辨識的 整體性能;此外,在交通監控上乃至於車輛門禁管理上, 10管理人員需要透過攝影機及顯示器觀看來往車輛的車牌號 碼,若能自動將車牌區域的部份影像切取、矯正歪斜並顯 示出來,將可方便管理人員觀看。因此,如何自動且有效 的從車輛影像中找出車牌的位置所在、切取出來並矯正車 牌的歪斜,便是車牌自動辨識系統及交通監控、車輛門禁 15 等應用的重要課題。 先前技術對於車輛影像中之車牌區域的定位及切取, 經濟部智慧財產局員工消費合作社印製 一般係直接使用像素灰階值來運算獲得結果,而容易因光 線變化或陰影使得灰階值的運算結果發生誤差而造成車牌 區域的定位錯誤。影像中每個像素的灰階值係由明亮度及 20 物體反射強度等兩個成分相乘(Multiplication )而得(請 參考 Rafael C. Gonzalez 及 Richard E· Woods 所合著的 D/gvW /細职Praces\s7>?g,1993版,第28頁至第31頁);明亮度係由 外在的光線強弱所決定,而物體反射強度才真正是反映物 體本身的影像特性。 __ 本紙張尺度適用中國國家標準(CNS ) A4規格(210X297公釐) 578118 五、發明説明(又) 由此可見,上述習用方式仍有諸多缺失,實非一良善 之设计者’而亟待加以改良。 (請先閲讀背面之注意事項再填寫本頁) 本案發明人鑑於上述習用方法所衍生的各項缺點,乃 亟思加以改良創新,並經多年苦心孤詣潛心研究後,終於 5成功研發完成本件從車輛影像中擷取車牌區域及橋正車牌 歪斜的方法及裝置。 【發明目的】 本發明之目的即在於提供一種從車輛影像中擷取車牌 區域及矯正車牌歪斜的方法及裝置,可應用於車牌自動辨 10 識及交通監控、車柄門禁。 本發明之次一目的係在於提供一種從車輛影像中擷取 車牌區域及矯正車牌歪斜的方法及裝置,係對像素灰階值 施以對數運算(Logarithmic operation)以得到對數灰階值,再 利用對數灰階值來去除明亮度的影響並計算定位出車牌的 15 位置所在,所以不會因光線變化或陰影使得灰階值發生變 化而造成車牌區域的定位錯誤。 【技術内容】 經濟部智葸財產局資工消費合作社印製 可達成上述發明目的之從車輛影像中擷取車牌區域及 矯正車牌歪斜的方法及裝置,包括有搭配鏡頭的CCD攝影 2〇 機、影像擷取卡(Frame grabber),並配合車輛影像讀取單 元、對數灰階值(Logarithmic gray-level)運算單元、小波分解 (Waveletdecomposition)運算單元、影像各值化(脑arizati〇n)運 异單元、車牌區域粗切割單元八卓牌歪斜墙正單元、車牌 區域細切割單元等模組之運算和處理,來矯I軍^區域影 ___^_-4^·_ 本紙張尺度適用中國國家標準(CNS ) A4規格(210X297公釐) ---- 78 經濟部智慧財產局a(工消費合作社印製 A7 B7 ----PA010555.DOQ-^Q/28五、發明説明(> ) 像的歪斜,以取得車輛之車牌號碼。 【圖式簡單說明】 請參閱以下有關本發明一較佳實施例之詳細說明及其 附圖,將可進一步瞭解本發明之技術内容及其目的功效; 5 有關該實施例之附圖為: 圖一為本發明從車輛影像中擷取車牌區域及矯正車牌 歪斜的方法及裝置之實施例方塊圖; 圖二為影像以小波分解來產生粗影像、水平差異影 像、垂直差異影像、對角差異影像之示意圖; 10 圖三為小波函數以Haar函數表示之示意圖; 圖四為車牌區域粗切割單元之實施例示意圖; 圖五為車牌歪斜矯正單元之實施例流程圖; 圖六為車牌細切割單元之實施例流程圖;以及 圖七為車牌細切割單元之實施例示意圖。 15【主要部分代表符號】 1搭配鏡頭的CCD攝影機 2影像擷取卡 3車輛影像讀取單元 4對數灰階值(Logarithmic gray-level)運算單元 5小波分解(Wavelet decomposition)運算單元 6影像二值化(Binarization)運算單元 7車牌區域粗切割單元 8車牌歪斜矯正單元 9車牌區域細切割單元 (請先閱讀背面之注意事項再填寫本頁) .舞· 訂 線 本紙張尺度適用中國國家標準(CNS ) A4規格(210X297公釐) 578118 經濟部智慈財產局員工消費合作社印焚 A7 _B7 ---------ΡΑΟ 1·ϋ5ΰ 5. POd/2g五、發明説明(φ ) 【較佳實施例】 本發明係一種以攝影機拍取車輛的影像,並從原始影 像轉成對數灰階值影像、以小波分解法分解出水平差異影 像並從水平差異影像之明暗分布情況來搜尋定位車牌區域 5在整張車輛影像中的位置,矯正車牌的歪斜並將車牌區域 切取出來的方法及裝置。本發明包括搭配鏡頭的CCD攝影 機、影像擷取卡(Frame grabber)及車輛影像讀取單元、對數 灰階值(Logarithmic gray-level)運算單元、小波分解(Wavelet decomposition)運算單元、影像二值化(Binarization)運算單 10 元、車牌區域粗切割單元、車牌歪斜矯正單元、車牌區域 細切割單元等模組。 影像中每個像素的灰階值係由明亮度及物體反射強度 等兩個成分相乘而得(請參考Rafael C. Gonzalez及Richard E. Woods所合著的 /Vocm/ng,1993 版,第 28 頁至 15第31頁);明亮度係由外在的光線強弱所決定,而物體反 射強度才真正是反映物體本身的影像特性。灰階值經過對 數運异所得到的對數灰階值為對數明亮度(Logarithmic illumination)與對數反射強度(Logarithmic reflectance)之和。 假設影像畫面的解析度(Resolution)為M*N個像素,且 20在座標位置(x,y)的像素之灰階值為g(x,y),〇 < X < M+1,0 < y<N+l ; g(x,y)的值可直接從CCD攝影機的輸出值來讀取。 若座標位置(x,y)的像素之明亮度為办,、反射強度為 r(x,y) ’ 則 g(x,y)=i(x,y)*r(x,y),i(x,y)的值及 r(x,y)的值無法從 CCD攝影機的輸出值來讀取。由於影像擷取卡擷取產生的 _6_ 财關家標準(CNS ) A4規格(210X297公釐) 一 (請先閱讀背面之注意事項再填寫本頁) 裝·~· 訂 線 578118 A7 B7 PA0I0333.DOC - 7/2δ 五、發明説明(f) (請先閱讀背面之注意事項再填寫本頁) 數位影像之像素灰階值範圍為從〇到255之整數,數位化過 程中其平均之捨去值(Truncated value)為0.5,因此我們把每 個像素之灰階值加上0.5,使像素灰階值範圍為從〇.5到 255·5 ;再經過對數運算後,對數灰階值為g’(x,y)、對數明 5 亮度為i’(x,y)、對數反射強度為r’(x,y),即 g’(x,y) = In g(x,y) =In i(x,y) + In r(x,y) = i’(x,y) + r,(x,y),0<x<M+l,0<y<N+l ; 如此便把明亮度、反射強度轉為對數相加的關係,再 10 經過小波分解產生差異影像的過程便可以抵銷對數明暗 度,使差異影像幾乎由對數反射強度所呈現。 經濟部智慧財產局資工消費合作社印製 小波分解(Wavelet decomposition)將影像分解成粗影像、 水平差異影像、垂直差異影像、對角差異影像;每做一次 小波分解,所得到的粗影像、水平差異影像、垂直差異影 15 像 '對角差異影像皆為分解前影像大小的四分之一。本發 明以水平差異影像來做為切割車牌的對象:一方面,水平 差異影像的大小為原有影像的四分之一,因此切出車牌所 需的運算量便只剩原來的四分之一;另一方面,水平差異 影像每一像素的對數灰階值反映出原影像的對數灰階值水 20 平變化量,是為搜尋車牌位置所依據的特徵數值。 本發明同時利用主内涵分析(Principal component analysis ’ 又稱為 Hotelling transform,請參考 Rafael C. Gonzalez 及 Richard E· Woods 所合著的 /mage ,1993 版,第148頁至第156頁)中找出最大之Eigen value所對應的 _ 小_ 本紙張尺度適用中國國家標準(CNS ) A4規格(210 X 297公釐) 578118 A7 B7 五、發明説明(厶) -PAet^53.DQO -^8 10 15 經濟部智慧財產局員工消費合作社印製 20578118 A7 B7 -PA01Q555.DOG-3 / g6 V. Description of the Invention (/) [Technical Field] (Please read the precautions on the back before filling out this page) The present invention relates to a method of capturing license plate areas from vehicle images and correcting them. The method and device for skewing the license plate, in particular, can be applied to the automatic license plate recognition system and traffic monitoring, the cutting of the license plate area image of the vehicle access control, and the correction of the license plate 5 image skew. [Previous technology] Press, the positioning and cutting of the license plate area in the vehicle image is a pre-processing program for automatic license plate recognition, so its accuracy affects the overall performance of automatic license plate recognition; in addition, in traffic monitoring and even in vehicle access control management 10 Managers need to view the license plate numbers of passing vehicles through cameras and monitors. If some images of the license plate area can be automatically cut, corrected and displayed, it will be convenient for managers to watch. Therefore, how to automatically and effectively find out the location of the license plate from the vehicle image, cut it out and correct the skew of the license plate is an important issue for applications such as automatic license plate recognition system, traffic monitoring, and vehicle access control. In the prior art, for the location and extraction of license plate areas in vehicle images, printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs generally uses pixel grayscale values to obtain the results, and it is easy to calculate grayscale values due to light changes or shadows. As a result, an error occurs and the positioning of the license plate area is wrong. The grayscale value of each pixel in the image is obtained by multiplying the brightness and the reflection intensity of 20 objects (Multiplication) (please refer to D / gvW / fine co-authored by Rafael C. Gonzalez and Richard E. Woods) (Praces \ s7 >? G, 1993 edition, pages 28 to 31); brightness is determined by the intensity of the external light, and the reflection intensity of the object really reflects the image characteristics of the object itself. __ This paper size applies the Chinese National Standard (CNS) A4 specification (210X297 mm) 578118 5. Description of the invention (again) It can be seen that there are still many shortcomings in the above-mentioned customary methods, which are not a good designer, and need to be improved. . (Please read the precautions on the back before filling this page) In view of the various shortcomings derived from the above-mentioned conventional methods, the inventor of this case is eager to improve and innovate, and after years of painstaking and meticulous research, finally 5 successfully developed this vehicle. Method and device for capturing license plate area and skewed license plate in image. [Objective of the Invention] The purpose of the present invention is to provide a method and a device for capturing a license plate area from a vehicle image and correcting the skew of the license plate, which can be applied to automatic recognition of license plates, traffic monitoring, and handle control. A second object of the present invention is to provide a method and device for capturing a license plate area from a vehicle image and correcting the skew of the license plate. A logarithmic operation is performed on the pixel grayscale value to obtain a logarithmic grayscale value, which is then reused. The logarithmic grayscale value is used to remove the influence of brightness and calculate the location of the 15th position of the license plate. Therefore, the location of the license plate area will not be incorrectly caused by the change of the grayscale value due to light changes or shadows. [Technical content] The method and device for capturing the license plate area from the vehicle image and correcting the skew of the license plate, including the CCD camera 20 with a lens, Frame grabber, in conjunction with vehicle image reading unit, logarithmic gray-level computing unit, wavelet decomposition computing unit, and image value (brain arizati) Unit, license plate area rough cutting unit, eight Zhuo licensing skew wall positive unit, license plate area fine cutting unit and other modules to calculate and process to correct the I army ^ area shadow ___ ^ _- 4 ^ · _ This paper size is applicable to the country of China Standard (CNS) A4 specification (210X297 mm) ---- 78 Intellectual Property Bureau of the Ministry of Economy a (printed by Industry and Consumer Cooperatives A7 B7 ---- PA010555.DOQ- ^ Q / 28 V. Description of the invention (>) The image is skewed to obtain the license plate number of the vehicle. [Brief description of the drawings] Please refer to the following detailed description of a preferred embodiment of the present invention and the accompanying drawings, which will further understand the technical content of the present invention and its purpose. 5 The drawings related to this embodiment are: FIG. 1 is a block diagram of an embodiment of a method and device for extracting a license plate area from a vehicle image and correcting the license plate skew; FIG. 2 is a wavelet decomposition of the image to generate a coarse image, Schematic diagram of horizontal difference image, vertical difference image, and diagonal difference image; Figure 3 is a schematic diagram of the wavelet function represented by Haar function; Figure 4 is a schematic diagram of an embodiment of a rough cutting unit in a license plate area; Figure 5 is an implementation of a license plate skew correction unit Example flow chart; Figure 6 is an embodiment flowchart of a license plate fine-cutting unit; and Figure 7 is a schematic diagram of an embodiment of a license plate fine-cutting unit. 15 [Representative symbols of main parts] 1 CCD camera with lens 2 image capture card 3 vehicle Image reading unit 4 Logarithmic gray-level arithmetic unit 5 Wavelet decomposition arithmetic unit 6 Binarization arithmetic unit 7 License plate area rough cutting unit 8 License plate skew correction unit 9 License plate area Fine cutting unit (please read the precautions on the back before filling this page). Degree applies to Chinese National Standard (CNS) A4 specification (210X297 mm) 578118 Employees' Cooperatives of Intellectual Property Bureau of Ministry of Economic Affairs printed A7 _B7 --------- ΡΑΟ 1 · ϋ5ΰ 5. POD / 2g Explanation (φ) [Preferred Embodiment] The present invention is a camera that captures an image of a vehicle, converts the original image into a logarithmic grayscale value image, decomposes the horizontal difference image by wavelet decomposition, and removes the lightness and darkness of the horizontal difference image. The method and device for searching for the position of the license plate area 5 in the entire vehicle image based on the distribution situation, correcting the skew of the license plate and cutting out the license plate area. The invention includes a CCD camera with a lens, an image capture card (Frame grabber) and a vehicle image reading unit, a logarithmic gray-level operation unit, a wavelet decomposition operation unit, and an image binarization. (Binarization) 10 yuan calculation module, rough cutting unit in license plate area, license plate skew correction unit, fine cutting unit in license plate area and other modules. The grayscale value of each pixel in the image is obtained by multiplying the brightness and the reflection intensity of the object (see Rafael C. Gonzalez and Richard E. Woods / Vocm / ng, 1993 edition, No. 28 to 15 p. 31); brightness is determined by the intensity of the external light, and the reflection intensity of the object really reflects the image characteristics of the object itself. The logarithmic grayscale value obtained by logarithmic grayscale value is the sum of logarithmic illumination and logarithmic reflectance. Assume that the resolution of the image frame is M * N pixels, and the gray level value of the 20 pixels at the coordinate position (x, y) is g (x, y), 0 < X < M + 1, 0 < y < N + l; The value of g (x, y) can be read directly from the output value of the CCD camera. If the brightness of the pixel at the coordinate position (x, y) is set, and the reflection intensity is r (x, y) ', then g (x, y) = i (x, y) * r (x, y), i The values of (x, y) and r (x, y) cannot be read from the output values of the CCD camera. _6_ Financial Standards (CNS) A4 Specifications (210X297 mm) generated by image capture card capture (Please read the precautions on the back before filling this page) Assembling ~~ · Thread 578118 A7 B7 PA0I0333. DOC-7 / 2δ 5. Description of the invention (f) (Please read the notes on the back before filling this page) The pixel grayscale value of the digital image is an integer from 0 to 255, and the average is rounded off during the digitization process. The value (Truncated value) is 0.5, so we add 0.5 to the grayscale value of each pixel, so that the pixel grayscale value ranges from 0.5 to 255 · 5; after logarithmic operation, the logarithmic grayscale value is g '(x, y), logarithmic brightness 5 i' (x, y), logarithmic reflection intensity r '(x, y), that is g' (x, y) = In g (x, y) = In i (x, y) + In r (x, y) = i '(x, y) + r, (x, y), 0 < x < M + l, 0 < y < N + l; The brightness and reflection intensity are converted into a logarithmic addition relationship, and then the process of generating a difference image through wavelet decomposition can offset the logarithmic brightness, so that the difference image is almost represented by the log reflection intensity. Wavelet decomposition is printed by the Intellectual Property and Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs to decompose the image into a coarse image, a horizontal difference image, a vertical difference image, and a diagonal difference image; each time the wavelet decomposition is performed, the obtained coarse image, horizontal Differential image, 15 vertical difference image 'Diagonal difference image is a quarter of the size of the image before decomposition. In the present invention, the horizontal difference image is used as the object of cutting the license plate. On the one hand, the size of the horizontal difference image is a quarter of the original image, so the calculation amount required to cut out the license plate is only one quarter of the original. On the other hand, the logarithmic grayscale value of each pixel of the horizontal difference image reflects the 20-level change of the logarithmic grayscale value of the original image, which is a feature value for searching the license plate position. The present invention also uses principal content analysis (Principal component analysis' also known as Hotelling transform, please refer to / mage, 1993 edition, pages 148 to 156 by Rafael C. Gonzalez and Richard E. Woods) Corresponding to the largest Eigen value _ Small _ This paper size applies to Chinese National Standard (CNS) A4 (210 X 297 mm) 578118 A7 B7 V. Description of the invention (厶) -PAet ^ 53.DQO-^ 8 10 15 Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs 20
Eigen vector來修正像素的X-轴座標:將像素之(χ,γ)座標值 投射(P_ti〇_ Eigen vector,以產生該像素新的χ_軸座 標’ Υ-轴座標則維持不變;如此將可續正車牌歪斜的狀 況。 搭配鏡頭的CCD攝影機及影像梅取卡對車道攝取車輛 影像,並由車輛影像讀取單元將影像擷取卡所擷取的影像 讀取出來,接著由對數灰階值運算單元來對車輛影像中的 各個像素4异出其對數灰階值’小波分解運算單元則接著 將對數灰階值影像分解成粗影像、水平差異影像、垂直差 異影像、S角差異影像,接著由影像二值化運算單元將水 平差異影像各像素之對數灰階值由實數值(Realnumb呦轉 為〇或1的二元值。然後由車牌區域粗切割單元依照預設的 車牌長寬約略值來尋找整張車輛影像中那個區域的二元值 總和最咼,並將該區域初步切出為車牌區域的所在;接著 利用車牌歪斜矯正單元來矯正車牌區域影像的歪斜,使之 儘篁不歪斜;最後由車牌區域細切割單元來切除車牌粗區 域中非屬於車牌的部分。 請參閱圖一所示,係一種從車輛影像中擷取車牌區域 及矯正車牌歪斜的方法及裝置,主要係由包括搭配鏡頭的 CCD攝影機1、影像擷取卡(Frame grabber)2,以及配合車輛 影像讀取單元3、對數灰階值(Logarithmic gray-level)運算單 元4、小波分解(Wavelet decomposition)運算單元5、影像二值 化(Binarization)運算單元6、車牌區域粗切割單元7、車牌歪 斜矯正單元8、車牌區域細切割單元9等模組所組成。在圖 (請先閱讀背面之注意事項再填寫本頁)Eigen vector to correct the X-axis coordinate of the pixel: Project the (χ, γ) coordinate value of the pixel (P_ti〇_ Eigen vector to generate the new χ_axis coordinate of the pixel 'Υ-axis coordinate remains unchanged; so It will continue to correct the skew of the license plate. The CCD camera with the lens and the image pickup card will capture the vehicle image on the lane, and the image captured by the image capture card will be read out by the vehicle image reading unit, and then the logarithmic gray will be read. The step value operation unit to distinguish the logarithmic gray level value of each pixel 4 in the vehicle image. The wavelet decomposition operation unit then decomposes the log gray level value image into a coarse image, a horizontal difference image, a vertical difference image, and an S-angle difference image. Then, the image binarization operation unit converts the logarithmic grayscale value of each pixel of the horizontal difference image from a real value (Realnumb 呦 to a binary value of 0 or 1. Then, the rough cutting unit of the license plate area is in accordance with the preset length and width of the license plate. Approximately find the sum of the binary values of that area in the entire vehicle image, and cut out this area as the location of the license plate area; then use the license plate skew correction unit to correct The image of the license plate area is distorted so that it is not distorted; finally, the fine plate cutting unit of the license plate area is used to cut off the part of the coarse area of the license plate that does not belong to the license plate. Please refer to Figure 1, which is a method of capturing the license plate area from the vehicle image and The method and device for correcting the skew of a license plate are mainly composed of a CCD camera 1 with a lens, a frame grabber 2 and a vehicle image reading unit 3 and a logarithmic gray-level operation unit. 4, Wavelet decomposition (Wavelet decomposition) calculation unit 5, image binarization (Binarization) calculation unit 6, license plate area rough cutting unit 7, license plate skew correction unit 8, license plate area fine cutting unit 9 and other modules. In the figure (Please read the notes on the back before filling this page)
、1T 線· 578118 A7 ______ B7 五、發明説明(^ ~' ΓΛ010:::.ΟΟΜ ----j---7---I (請先閲讀背面之注意事項再填寫本頁) 一中,虛線箭頭始端所標示之無外框物件為輸人信號,虛 線箭頭終端所標示之無外框物件為輸出信號。搭配鏡頭的 CCD攝影機i及影像擷取卡2對車道攝取車輛影像,並由車 輛影像讀取單元3將影像掏取卡2所掏取的影像讀取出來, 5接著由對數灰階值運算單元4來對車柄影像中的各個像素 計算出其對數灰階值,小波分解運算單元5則接著將對數 灰階值影像分解成粗影像、水平差異影像、垂直差異影 像、對角差異影像,接著由影像二值化運算單元6將水平 差異影像各像素之對數灰階值由實數值㈣_ber)轉為〇 10或1的一 TG值。然後由車牌區域粗切割單元7依照預設的車 牌長寬約略值來尋找整張車輛影像中那個區域的二元值總 和最高,並將該區域初步切出為車牌區域的所在;接著利 用車牌歪斜矯正單元8來矯正車牌區域影像的歪斜,使之 不歪斜,最後由車牌區域細切割單元9來切除車牌粗區域 15中非屬於車牌的部分,以得到最後之車牌區域的所在。 線 經濟部智慈財產局員工消費合作社印製 其中搭配之鏡頭CCD攝影機1、影像擷取卡2乃習知產 品;影像擷取卡2係產生原始影像,車輛影像讀取單元3則 與衫像擷取卡介接並將影像讀取出來以暫存;車輛影像讀 取單元3可由處理器(processor)晶片、暫存記憶體(Temp〇rary 20 memory)晶片、永久記憶體(permanent mem〇ry)晶片、時序脈 衝(Sequential pulse)晶片以及電源供應器等元件所組成。 由於影像操取卡2掘取產生的數位影像之像素灰階值 範圍為從0到255之整數,其平均之數位化捨去值(Tmncated value)為〇·5,因此我們在對數灰階值運算單元4把每個像素 本紙張尺度適用中國國家標準(CNS ) Α4規格(210Χ297公釐) 五 '發明説明(《) A7 B7 PAO 105oo.uOC - lu/zo 經濟部智慧財4局8工消費合作社印製 之灰階值加上〇·5,使像素灰階值範圍為從〇·5到255·5,接 著再對每個像素灰階值作對數運算以產生對數灰階值。對 數灰階值運异單元4將原始影像轉成對數灰階值影像,對 數灰階值運算單元4可由處理器(pr〇cess〇r)晶片、暫存記憶 5 體(TemPorar^ memory)晶片、永久記憶體(Permanent memory)晶 片、時序脈衝(Sequential pulse)晶片以及電源供應器等元件 所組成。 小波分解(Wavelet decomposition)運算單元5將影像分解 成粗影像、水平差異影像、垂直差異影像、對角差異影 1〇像;圖二所不的是影像以小波分解來產生粗影像、水平差 異影像、垂直差異影像、對角差異影像之示意圖;小波分 解所可使用的小波函數有很多種,圖三所示的是小波函數 之一種· Haar函數之示意圖。我們以水平差異影像來做為 切割車牌的對象:一方面,水平差異影像的大小為原有影 15像的四分之一,因此切出車牌所需的運算量便只剩原來的 四分之一;另一方面,水平差異影像每一像素的對數灰階 值反映出原景〉像的對數灰階值水平變化量,是為搜尋車牌 位置所依據的特徵數值。小波分解運算單元5利用對數灰 P皆值影像產生水平差異影像,小波分解運算單元可由處理 20器晶片、暫存記憶體晶片、永久記憶體晶片、時序脈衝晶 片以及電源供應器等元件所組成。 影像二值化運算單元6將水平差異影像所有像素數值 之絕對值較大的像素之數值改設為丨、其他像素之數值改 設為〇;像素數值之絕對值較大的像素佔所有像素總數的 -10- (請先閱讀背面之注意事項再填寫本頁) 裝. 訂 線 本紙張尺度適用中國國家標隼(CNS ) A4規格(210X297公釐) 578118 經濟部智慧財產局員工消費合作社印製 A7 B7五、發明説明(” ^ 4 比率可為1/100、1/50或其他小於i的合適比率。影像二值化 運算單元6利用水平差異影像產生水平差異二值化影像, 影像二值化運算單元6可由處理器晶片、暫存記憶體曰 片、永久記憶體晶片、時序脈衝晶片以及電源供應器等元 5 件所組成。 圖四所示的是車牌區域粗切割單元7之實施例示意 圖,以車牌長寬大約值各兩倍的範圍做為計算二元值 的範圍窗框,在整張水平差異二值化影像中移動計算;;元 值總和的範圍窗框並計算每次範圍中所有二元值的總和; 10計异二元值總和的範圍窗框每次水平移動一個車牌的長度 或垂直移動-個車牌的寬度。從每次移動中找出二元值總 和最大的一個範圍,此長方形範圍即為車牌粗區域水平差 異二值化影像;將車牌粗區域水平差異二值化影像四個角 的座標值乘以2,即得到原始影像中車牌粗區域四個角的 I5座標值,將這個區域切出即得車牌粗區域影像。車牌區域 粗切割單元7利用車牌大約長寬值、水平差異二值化影 像、原始影像來產生車牌粗區域水平差異二值化影像、車 牌粗區域影像,車牌區域粗切割單元可由處理器晶片、暫 存記憶體晶片、永久記憶體晶片、時序脈衝晶片以及電源 20供應器等元件所組成。 車牌歪斜端正單元8利用車牌粗區域水平差異二值化 影像、車牌粗區域影像來產生車牌粗區域水平差異二值化 矯正影像、車牌粗區域矯正影像。圖五所示的是車牌歪斜 矯正單元之實施例流程圖:首先對車牌粗區域水平差異二 -11 - 本紙張尺度適用中國國家標準(CNS ) A4規格(210X29*7公釐) ----------—---- ---.-------— (請先閱讀背面之注意事項再填寫本頁) 訂 線 578118 經濟部智慈財4局g(工消費合作社印製 A7 B7 --------—-—--PAO lOWS.UOC - 12/28· 五、發明説明(/C?) 值化影像做主内涵分析(Principal component analysis),也就是 從車牌粗區域水平差異二值化影像中像素數值為1的所有 像素之X>軸與Y-軸座標做主内涵分析,並從主内涵分析中 找出最大之Eigen value所對應的Eigen vector,然後將車牌粗 5區域水平差異二值化影像所有像素之(X,Y)座標值投射 (Projection)至該Eigen vector,以產生這些像素新的X-軸座 標’ Y-軸座標則維持不變,因此可產生出車牌粗區域水平 差異二值化矯正影像;同樣對車牌粗區域影像所有像素之 (Χ,γ)座標值投射(Projection)至該Eigen vector,以產生這些像 10素新的X-軸座標,Y-軸座標則維持不變,因此可產生出車 牌粗區域橋正影像,車牌歪斜的狀況便是以此解決。車牌 歪斜矯正單元8可由處理器晶片、暫存記憶體晶片、永久 記憶體晶片、時序脈衝晶片以及電源供應器等元件所組 成。 15 最後一個步驟為車牌區域的細切割,圖六所示的為車 牌區域細切割單元9之實施例流程圖,圖七所示的車牌區 域細切割單元9之實施例示意圖則有助於了解圖六的動作 原理。首先計算車牌粗區域水平差異二值化影像的重心, 接著針對車牌粗區域水平差異二值化影像做以下處理:計 20 #重心Y-轴座標以上之母行(Row)的二元值總和,由上往 下找出較前一行之二元值總和增加最多的一行,記錄該行 之Y-轴座標為Y1 ;計算重心Y-軸座標以下之每行(R〇w)的 一元值總和,由下往上找出較前一行之二元值總和增加最 多的一行,記錄該行之Y-軸座標為Y1 ;計算重心X-轴座標 ___ 丨12嚼 本紙張尺度適用中準(規格(210X 297公釐) ------ (請先閲讀背面之注意事項再填寫本頁) -訂 線 578118 Α7 Β7 五 、發明説明(【() •PAQ10655.DOC 10/20" 經濟部智慧財產局員工消費合作社印製 以左之每列(Column)的二元值總和,由左往右找出較前一 】之—元值總和增加最多的一列,記錄該列之X-軸座標為 Xl,計算重心X-軸座標以右之每列(c〇lumn)的二元值總 矛’由右往左找出較前一列之二元值總和增加最多的一 5列’記錄該列之X-軸座標為X2。則車牌細區域水平差異二 值化墙正影像四個角在車牌粗區域水平差異二值化矯正影 像的座標即為(Χ1,Υ1)、(Χ1,Υ2)、(Χ2,Υ1)、(Χ2,Υ2);由於車 牌細區域水平差異二值化矯正影像之長寬、車牌粗區域水 平差異二值化矯正影像之長寬分別為車牌細區域之長寬、 10車牌粗區域之長寬的二分之一,因此車牌細區域四個角在 車牌粗區域中的座標即為(2*Χ1,2*Υ1)、(2*Χ1,2*Υ2)、 (2*X2,2*Yl)、(2*χ2,2*Υ2);已矯正歪斜的車牌細區域影像 便可因此切出。車牌區域細切割單元可由處理器晶片、暫 存圮憶體晶片、永久記憶體晶片、時序脈衝晶片以及電源 15供應器等元件所組成。 【特點及功效】 本發明所提供之從車輛影像中擷取車牌區域及矯正車 牌歪斜的方法及裝置,與前述引證案及其他習用技術相互 比較時’更具有下列之優點: 20 1·本發明提供一種從車輛影像中擷取車牌區域及矯正 車牌歪斜的方法及裝置,可應用於車牌自動辨識及交通監 控、車輛門禁。 2.本發明提供一種從車輛影像中擷取車牌區域及矯正 車牌歪斜的方法及裝置,係對像素灰階值施以對數運算 -13- 本紙張尺度適用中國國家標準(CNS ) Α4規格(2丨0'〆297公釐) ------------裝φ-----訂------線一0 (請先閲讀背面之注意事項再填寫本頁) 578118 A7 _P,A010S5^OQ…_五、發明説明(丨>) (Logarithmic operation)以得到對數灰階值,再利用對數灰階 值來去除明亮度的影響並計算定位出車牌的位置所在,所 以不會因光線變化或陰影使得灰階值發生變化而造成車牌 區域的定位錯誤。 5 3·本發明提供一種從車輛影像中擷取車牌區域及矯正 車牌歪斜的方法及裝置,對切出車牌所需的運算量,只有 一般習用方法的四分之一。 4.本發明提供一種從車輛影像中擷取車牌區域及矯正 車牌歪斜的方法及裝置,可矯正車牌影像歪斜的狀況。 10 上列詳細說明係針對本發明之一可行實施例之具體說 明,惟該實施例並非用以限制本發明之專利範圍,凡未脫 離本發明技藝精神所為之等效實施或變更,均應包含於本 案之專利範圍中。 綜上所述,本案不但在技術思想上確屬創新,並能較 15習用物品增進上述多項功效,應已充分符合新穎性及進步 性之法定發明專利要件,爰依法提出申請,懇請貴局核 准本件發明專利申請案,以勵發明,至感德便。 (請先閱讀背面之注意事項再填寫本頁) -裝· 訂 線 經濟部智慧財產局員工消費合作社印製 -14- 本紙張尺度適用中國國家標準(CNS ) Α4規格(210Χ 297公釐)Line 1T · 578118 A7 ______ B7 V. Description of the invention (^ ~ 'ΓΛ010 :::. ΟΟΜ ---- j --- 7 --- I (Please read the precautions on the back before filling this page) The frameless object marked at the beginning of the dashed arrow is the input signal, and the frameless object marked at the end of the dashed arrow is the output signal. The CCD camera i with the lens and the image capture card 2 capture the vehicle image from the lane, and The vehicle image reading unit 3 reads the image extracted by the image extraction card 2, and then the logarithmic grayscale value calculation unit 4 calculates the logarithmic grayscale value of each pixel in the handle image, and the wavelet decomposition The operation unit 5 then decomposes the log grayscale value image into a coarse image, a horizontal difference image, a vertical difference image, and a diagonal difference image, and then the image binarization operation unit 6 divides the log grayscale value of each pixel of the horizontal difference image from The real value ㈣_ber) is converted to a TG value of 0 or 1. Then, the license plate region rough cutting unit 7 searches for the highest sum of the binary values of that region in the entire vehicle image according to the preset approximate value of the license plate length and width, and cuts out this region as the location of the license plate region; then uses the license plate to skew The correction unit 8 corrects the distortion of the image of the license plate area so that it is not distorted. Finally, the license plate area fine cutting unit 9 removes the portion of the license plate coarse area 15 that does not belong to the license plate to obtain the location of the final license plate area. The Consumer Goods Cooperative of the Intellectual Property Bureau of the Ministry of Online Economics printed the lens CCD camera 1, the image capture card 2, which is a known product; the image capture card 2 generates the original image, and the vehicle image reading unit 3 is similar to the shirt image. The capture card is interfaced and the image is read out for temporary storage; the vehicle image reading unit 3 may be a processor chip, a temporary memory (TempOrary 20 memory) chip, and a permanent memory (permanent memory). ) Chip, timing pulse (Sequential pulse) chip and power supply components. Because the pixel grayscale value of the digital image generated by image manipulation card 2 mining is an integer from 0 to 255, the average digital rounded value (Tmncated value) is 0.5, so we are in the logarithmic grayscale value The calculation unit 4 applies the paper size of each pixel to the Chinese National Standard (CNS) A4 specification (210 × 297 mm). Five 'invention description (") A7 B7 PAO 105oo.uOC-lu / zo Ministry of Economic Affairs 4 The grayscale value printed by the cooperative adds 0.5, so that the pixel grayscale value ranges from 0.5 to 255.5, and then a logarithmic operation is performed on each pixel grayscale value to generate a logarithmic grayscale value. The logarithmic grayscale value difference processing unit 4 converts the original image into a logarithmic grayscale value image. The logarithmic grayscale value calculation unit 4 can be implemented by a processor chip, a TemPorar ^ memory chip, It consists of permanent memory chip, sequential pulse chip and power supply. Wavelet decomposition (Wavelet decomposition) operation unit 5 decomposes the image into a coarse image, a horizontal difference image, a vertical difference image, and a diagonal difference image. What is not shown in Figure 2 is the wavelet decomposition of the image to generate a coarse image and a horizontal difference image. Schematic diagram of vertical difference image and diagonal difference image. There are many types of wavelet functions that can be used for wavelet decomposition. Figure 3 is a schematic diagram of one type of wavelet function and Haar function. We use the horizontal difference image as the object of cutting the license plate: On the one hand, the size of the horizontal difference image is one quarter of the original 15 images, so the required amount of calculation to cut out the license plate is only one quarter of the original. First, on the other hand, the logarithmic grayscale value of each pixel of the horizontal difference image reflects the horizontal change of the logarithmic grayscale value of the original scene> image, which is a feature value for searching for the position of the license plate. The wavelet decomposition operation unit 5 uses a logarithmic gray P-mean image to generate a horizontal difference image. The wavelet decomposition operation unit may be composed of components such as a processing chip, a temporary memory chip, a permanent memory chip, a timing pulse chip, and a power supply. The image binarization operation unit 6 changes the value of the pixel with the larger absolute value of all the pixel values of the horizontal difference image to 丨 and the value of the other pixels to 0; the pixel with the larger absolute value of the pixel value occupies the total number of all pixels -10- (Please read the precautions on the back before filling this page). Binding. The paper size of the booklet is applicable to China National Standard (CNS) A4 specification (210X297 mm) 578118 Printed by the Consumer Cooperative of the Intellectual Property Bureau of the Ministry of Economic Affairs A7 B7 V. Explanation of the invention ("^ 4 The ratio may be 1/100, 1/50 or other suitable ratios smaller than i. The image binarization operation unit 6 uses a horizontal difference image to generate a horizontal difference binary image, and the image is binary The calculation unit 6 may be composed of 5 elements such as a processor chip, a temporary memory chip, a permanent memory chip, a timing pulse chip, and a power supply. Fig. 4 shows an embodiment of the license plate region rough cutting unit 7. Schematic diagram, using a range of approximately twice the length and width of the license plate as the range window for calculating the binary value, and moving the calculation in the entire horizontal difference binarization image; the range window for the sum of the meta values Frame and calculate the sum of all binary values in each range; 10 Ranges that count the sum of different binary values. The window frame moves the length of one license plate horizontally or the width of one license plate each time. Find two from each move. A range with the largest sum of meta values. This rectangular range is the binarized image of the horizontal difference of the license plate coarse area. Multiply the coordinate values of the four corners of the binarized image of the coarse difference of the license plate horizontal area by two to obtain the rough license plate in the original image. The I5 coordinate values of the four corners of the area are cut out to obtain the image of the rough area of the license plate. The rough area cutting unit 7 of the license plate uses the approximate length and width of the license plate, the binarized image of the horizontal difference, and the original image to generate the horizontal difference of the coarse area of the license plate. Binary image, rough license plate image, rough license plate area cutting unit can be composed of processor chip, temporary memory chip, permanent memory chip, timing pulse chip and power supply 20. License plate skew correction unit 8 uses Level difference image of the coarse area of the license plate, image of the coarse area difference of the license plate, to generate a binarized correction image of the level difference of the coarse area of the license plate, Rectification image of the rough area of the license plate. Figure 5 shows a flowchart of the embodiment of the license plate skew correction unit: First, the difference in the level of the rough area of the license plate is 2-11-This paper size applies the Chinese National Standard (CNS) A4 specification (210X29 * 7mm) (Li) ---------------- ---.--------- (Please read the notes on the back before filling this page) Line 578118 Ministry of Economic Affairs 4 Bureaus (Printed by the Industrial and Consumer Cooperatives A7 B7 -------------- PAO lOWS.UOC-12/28 · V. Explanation of the Invention (/ C?) Valued image analysis component analysis), that is, the X > axis and Y-axis coordinates of all pixels with a pixel value of 1 in the binarized horizontal difference image of the license plate are used for the main connotation analysis, and the largest Eigen value is found from the main connotation analysis. Corresponding Eigen vector, and then project the (X, Y) coordinate values of all pixels of the 5th-level license plate coarse area difference image to the Eigen vector to generate new X-axis coordinates of these pixels. Coordinates remain the same, so a binarized corrected image of the level difference in the rough area of the license plate can be generated; The (X, γ) coordinate values of all pixels in the area image are projected onto the Eigen vector to generate new X-axis coordinates of these 10 pixels, while the Y-axis coordinates remain unchanged, so a thick area of the license plate can be generated The image of the bridge is correcting the skewed license plate. The license plate skew correction unit 8 may be composed of a processor chip, a temporary memory chip, a permanent memory chip, a timing pulse chip, and a power supply. 15 The last step is fine cutting of the license plate area. Figure 6 shows the flowchart of the embodiment of the fine plate cutting unit 9 in the license plate area. Figure 7 shows the schematic diagram of the embodiment of the fine plate cutting unit 9 in the license plate area. Six action principles. First calculate the center of gravity of the image of the coarse area level difference binarization image, then do the following for the image of the coarse area level difference binarization image of the license plate: calculate the sum of the binary values of the parent row (Row) above the center of gravity # 20 of the Y-axis, From the top to the bottom, find the line that has increased the most from the sum of the binary values of the previous line, and record the Y-axis coordinate of the line as Y1; calculate the sum of the unary values of each line (R0w) below the center of gravity Y-axis, From the bottom to the top, find the line that has the largest increase from the sum of the binary values in the previous line, and record the Y-axis coordinate of the line as Y1; Calculate the center of gravity X-axis coordinate ___ 12 210X 297 mm) ------ (Please read the notes on the back before filling out this page)-578118 Α7 Β7 V. Description of the invention ([() • PAQ10655.DOC 10/20 " Intellectual Property of the Ministry of Economic Affairs Bureau employee consumer cooperatives print the sum of the binary values of each column (from left to right) to find the column that has the most increase from the previous one—record the X-axis coordinate of the column as Xl , Calculate the total value of the binary value of the center of gravity X-axis coordinate with each column (c〇lumn) to the right. Go to the left to find a 5 column that has increased the most by the sum of the binary values in the previous column. Record that the X-axis coordinate of this column is X2. Then the four corners of the positive image of the binarization wall of the small area of the license plate are at the level of the coarse area of the license plate The coordinates of the difference binarized corrected image are (× 1, Υ1), (× 1, Υ2), (× 2, Υ1), (× 2, Υ2); due to the level difference of the license plate fine area, the length and width of the corrected image and the license plate The length and width of the binarized corrected image of the horizontal difference in the coarse area are respectively one half of the length and width of the thin area of the license plate and one half of the length and width of the thick area of the 10 license plate. (2 * χ1, 2 * Υ1), (2 * χ1, 2 * Υ2), (2 * X2, 2 * Yl), (2 * χ2, 2 * Υ2); the skewed image of the fine area of the license plate can be corrected So cut out. The license plate area fine cutting unit can be composed of processor chip, temporary memory chip, permanent memory chip, timing pulse chip, power supply 15 and other components. [Features and effects] The present invention provides the following Method and device for capturing license plate area and correcting license plate skew in vehicle image, and the aforementioned citation When compared with other conventional technologies, it has the following advantages: 20 1. The present invention provides a method and device for capturing a license plate area from a vehicle image and correcting the license plate skew, which can be applied to automatic license plate recognition and traffic monitoring, and vehicle access control. 2. The present invention provides a method and device for capturing a license plate area from a vehicle image and correcting the skew of the license plate, which performs a logarithmic operation on the pixel grayscale value. 13- This paper standard is applicable to the Chinese National Standard (CNS) Α4 specification ( 2 丨 0'〆297mm) ------------ install φ ----- order ------ line one 0 (Please read the precautions on the back before filling in this page ) 578118 A7 _P, A010S5 ^ OQ ..._ V. Description of the invention (Logarithmic operation) to obtain the logarithmic grayscale value, and then use the logarithmic grayscale value to remove the effect of brightness and calculate the location of the license plate. , So there will be no misalignment of the license plate area due to changes in light levels or shadows. 5 3. The present invention provides a method and a device for capturing a license plate area from a vehicle image and correcting the skew of the license plate. The amount of calculation required to cut out a license plate is only a quarter of the conventional method. 4. The present invention provides a method and a device for capturing a license plate area from a vehicle image and correcting the skew of the license plate, which can correct the skew of the license plate image. 10 The above detailed description is a specific description of a feasible embodiment of the present invention, but this embodiment is not intended to limit the scope of the patent of the present invention. Any equivalent implementation or change that does not depart from the technical spirit of the present invention should include Within the scope of the patent in this case. To sum up, this case is not only technically innovative, but also enhances the above-mentioned multiple effects compared to 15 customary items. It should have fully met the requirements for novel and progressive statutory invention patents, and filed an application in accordance with the law. Your approval is requested. This invention patent application is designed to encourage inventions, to the utmost convenience. (Please read the precautions on the back before filling in this page)-Binding and binding line Printed by the Consumer Cooperatives of the Intellectual Property Bureau of the Ministry of Economic Affairs -14- This paper size applies to China National Standard (CNS) Α4 size (210 × 297 mm)