TW201030675A - Peeling skeletonization image processing method - Google Patents

Peeling skeletonization image processing method Download PDF

Info

Publication number
TW201030675A
TW201030675A TW98103946A TW98103946A TW201030675A TW 201030675 A TW201030675 A TW 201030675A TW 98103946 A TW98103946 A TW 98103946A TW 98103946 A TW98103946 A TW 98103946A TW 201030675 A TW201030675 A TW 201030675A
Authority
TW
Taiwan
Prior art keywords
image
pixel
pixels
edge
converted
Prior art date
Application number
TW98103946A
Other languages
Chinese (zh)
Inventor
Jung-Chi Lai
Original Assignee
Darfon Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Darfon Electronics Corp filed Critical Darfon Electronics Corp
Priority to TW98103946A priority Critical patent/TW201030675A/en
Publication of TW201030675A publication Critical patent/TW201030675A/en

Links

Landscapes

  • Image Processing (AREA)

Abstract

A peeling skeletonization image processing method includes steps stated below. An original image of a character is acquired, wherein the original image has a plurality of image pixels arranged in the form of a matrix. The data of each image pixel is digitalized for converting the original image into a binary image. The data of the image pixels of the binary image is sequentially read according to four directions of the matrix for finding a plurality of marginal image pixels. The data of the surrounding image pixels of the marginal image pixels are used for determining if converting the marginal image pixels into white image pixels. The method continues until the width of each line forming the character becomes the width of a single pixel, so as to convert the original image of the character into a skeletonization image.

Description

201030675 息·· Λ Λ. 六、發明說明: 【發明所屬之技術領域】 本發明是有關於一種影像處理方法,且特別是有關於 一種剝筍式骨架化之影像處理方法。 【先前技術】 籌 馨 在許多工程系統中’都需利用影像識別之技術作為系 統中不同步驟、區塊之檢驗或判斷。舉例來說,半導體製 1中,每當一次製程完畢後,多需以影像識別系統去檢驗 氣作元成之工件,以判斷是否符合製程良率,例如,是檢 殮光阻之線寬、線距等。另外,以製作鍵盤為例,鍵盤上 所有的文字符號,如英文字母、注音符號數字等,是在 鍵盤的所有按鍵組裝完成後才印製到按鍵上,在印製完成 後,還需檢驗這些文字符號是否印製正確才可出廠販售。 隨著影像識別之技術發展,對於精確度以及處理速度 =要求也日益增加,因此,如何以較為有效且快速之方式 取影像之特徵實為一值得探討之問題。 【發明内容】 法本發明係有關於一種剝筍式骨架化之影像處理方 個,是以對稱之方式逐層剝除像素點,將影像骨架化為一 旦像素點寬度之線條,以大量簡化原始影像之像素點使 衫像得以藉由較為精簡與高效率之方式儲存。 根據本發明之一方面,提出一種剝筍式骨架化之影像 理方法,其包括步驟:擷取一字元之一原始影像,其中, 3 201030675 i w)worn 原始影像具有多個像素點,而這些像素點係以一陣列之, 式排列;二值化這些像素點之資料值,使原始影像轉= 一個二值化影像;依序沿著該陣列之四個方向讀取此^ ’、、' 化影像之像素點之資料值,以找出該字元於這些方向3 個邊緣像素點,並根據這些邊緣像素點各別之周圍像夕 之資料值去判斷是否轉換這些邊緣像素點為空白、= 個 及,重複上一步驟,直到影像中之線條寬度減為一 像素點之寬度,藉此以將字元之原始影像轉換為一 1匕影像。 月东 實為讓本發明之上述内容能更明顯易懂,下文特舉較佳 例’並配合所附圖式,作詳細說明如下: 【實施方式】 韌請參照第1圖,其繪示依照本發明較佳實施例的—種 影气月架化之影像處理方法之流程圖。剝筍式骨架化之 =像處理方法包括步驟810至S4〇e首先,如步驟si〇所 像參_取一字元之一原始影像,其中,原始影像具有多個 驟、點,!4些像素點係以一陣列之形式排列。然後,如步 振所不,二值化這些像素點之資料值,使原始影像轉 陣,〜個二值化影像。接著,如步驟S30所示,依序沿著 找】=四個方向讀取此二值化影像之像素點之資料值以 素字元在這些方向之多個邊緣像素點,並根據各邊緣像 點·之周m點之資料值去騎是轉換該邊緣像素 创空白像素點。然後’如步驟S4G所示,重複上一步觸 〜像中之線條寬度減為一個像素點之寬度,以將字元 201030675 X TT 1 之原始影像轉換為一骨架化影像。 請參照第2圖,上述之步驟S30更包括數個步驟S31 至S35。如步驟S31所示,沿著陣列之第一方向找出該字 元於第一方向之邊緣像素點,並根據第一方向之邊緣像素 點其周圍像素點之資料值,判斷是否將第一方向之邊緣像 素點轉換為空白像素點,以將該二值化影像轉換後儲存為 一第一影像。接著,如步驟S32所示,沿著陣列之第二方 向讀取該第一影像,以找出該字元於第二方向之邊緣像素 • 點,並根據第二方向之邊緣像素點其周圍像素點之資料 值,判斷是否將第二方向之邊緣像素點轉換為空白像素 點,以將該第一影像轉換後儲存為一第二影像。 然後,如步驟S33所示,沿著陣列之第三方向讀取第 二影像,以找出該字元於第三方向之邊緣像素點,並根據 第三方向之邊緣像素點其周圍像素點之資料值,判斷是否 將第三方向之邊緣像素點轉換為空白像素點,以將該第二 影像轉換後儲存為一第三影像。接著,如步驟S34所示, ® 沿著陣列之第四方向讀取該第三影像,以找出該字元於第 四方向之邊緣像素點,並根據第四方向之邊緣像素點其周 圍像素點之資料值,判斷是否將第四方向之邊緣像素點轉 換為空白像素點,以將該第三影像轉換後儲存為一第四影 像。 以較佳之實施方式而言,陣列之第二方向係與第一方 向相反,而第三方向係垂直第一方向,且第四方向係與第 三方向相反。當四個方向轉換完成後,如步驟S35所示, 判斷影像中之線條寬度是否為一個像素點之寬度,若是, 5 201030675 表示已完成影像之骨恕各4風^[Technical Field] The present invention relates to an image processing method, and more particularly to an image processing method for stripping a skeleton type. [Prior Art] In many engineering systems, image recognition technology is required as a test or judgment of different steps and blocks in the system. For example, in the semiconductor system 1, after each process is completed, it is necessary to use an image recognition system to inspect the workpiece of the gas component to determine whether the process yield is met, for example, to check the line width of the photoresist. Line spacing and so on. In addition, taking the keyboard as an example, all the text symbols on the keyboard, such as English letters, phonetic symbols, etc., are printed on the keys after all the keys of the keyboard are assembled. After the printing is completed, it is necessary to check these. Whether the text symbol is printed correctly can be sold at the factory. With the development of image recognition technology, the accuracy and processing speed = requirements are increasing. Therefore, how to take the image in a more effective and fast way is a problem worth exploring. SUMMARY OF THE INVENTION The present invention relates to an image processing method for stripping a bamboo skeleton type, which is to strip pixels in a symmetrical manner layer by layer, and to frame the image as a line of the width of the pixel, thereby greatly simplifying the original The pixel of the image allows the image of the shirt to be stored in a more streamlined and efficient manner. According to an aspect of the present invention, a method for image processing of a thinning skeleton is proposed, which comprises the steps of: capturing one original image of one character, wherein: 3 201030675 iw)worn original image has multiple pixels, and these Pixels are arranged in an array; binarizing the data values of the pixels to convert the original image to a binarized image; sequentially reading the ^ ', ' in the four directions of the array The data value of the pixel of the image is obtained to find the three edge pixels of the character in these directions, and according to the data values of the surrounding pixels of the edge pixels, whether to convert the edge pixels to blank, = and, repeat the previous step until the line width in the image is reduced to the width of one pixel, thereby converting the original image of the character into a one-inch image. The above content of the present invention can be more clearly understood. The following is a detailed description of the preferred embodiment of the present invention, and is described in detail below with reference to the accompanying drawings: [Embodiment] Please refer to FIG. 1 for the toughness, which is shown in accordance with A flow chart of an image processing method for a shadowy moon frame according to a preferred embodiment of the present invention. The sculpt-like skeletonization = image processing method includes steps 810 to S4 〇 e first, as in step si 〇 image _ take one of the original images of a character, wherein the original image has multiple steps, points, ! The four pixels are arranged in an array. Then, if the step is not, binarize the data values of these pixels to make the original image into a matrix, and to binarize the image. Then, as shown in step S30, the data values of the pixels of the binarized image are sequentially read along the direction of finding== four directions, and the plurality of edge pixels in the direction of the prime character are in the direction, and according to the edge images. The data value of the point m point of the week is to convert the edge pixel to create a blank pixel point. Then, as shown in step S4G, repeating the width of the line in the previous touch-to-image is reduced to the width of one pixel to convert the original image of the character 201030675 X TT 1 into a skeletonized image. Referring to FIG. 2, the above step S30 further includes a plurality of steps S31 to S35. As shown in step S31, the edge pixel of the character in the first direction is found along the first direction of the array, and the first direction is determined according to the data value of the pixel point around the edge pixel in the first direction. The edge pixel is converted into a blank pixel to convert the binary image into a first image. Then, as shown in step S32, the first image is read along the second direction of the array to find the edge pixel of the character in the second direction, and the pixel around the pixel according to the edge of the second direction The data value of the point is used to determine whether the edge pixel in the second direction is converted into a blank pixel to convert the first image into a second image. Then, as shown in step S33, the second image is read along the third direction of the array to find the edge pixel of the character in the third direction, and the pixel points around the edge of the pixel according to the third direction The data value is used to determine whether the edge pixel in the third direction is converted into a blank pixel to convert the second image into a third image. Then, as shown in step S34, the third image is read along the fourth direction of the array to find the edge pixel of the character in the fourth direction, and the pixel around the pixel according to the edge of the fourth direction The data value of the point is used to determine whether the edge pixel in the fourth direction is converted into a blank pixel to convert the third image into a fourth image. In a preferred embodiment, the second direction of the array is opposite the first direction, and the third direction is perpendicular to the first direction, and the fourth direction is opposite the third direction. After the four directions are converted, as shown in step S35, it is determined whether the line width in the image is the width of one pixel, and if so, 5 201030675 indicates that the image has been completed for 4 winds ^

本實施例在步驟S1Q中所操取之字元例如為字元η 其原始影像例如為—個8 值)係介於0至255之間 如第4A圖所示。-枯外 一個8-bit之影像,而其資料值(灰階 5之間。於二值化後之二值化影像1〇〇 二值化影像100之像素點Pi,j (其中 於則述之步驟S20 +,當二值化時,係先給定一門植 再將像素點之資料值與該⑽值相比。若是一像素點 之資料值大於或等於該門襤值時代表該像素點為一齐 1或代表該像素點為白色背景,可將其資料值設為〇 ; 右疋一像素點之料料於朗檻值時’則代表該像素點 為暗點’或代表為該字元之部分線條所在位置,可 資料值*又為卜如第4A圖下方之陣列所示,二值化影像 議之像素點對應之資料值係為】或〇, 所在位置之資料值為!,其餘則為0。 線條 如第3圖之步驟S401所示,讀取目前處理之影像之 邊緣像素點之資料值。如第4A ®所示,沿著陣列之第— 方向D1找出字TCH於第一方向D1之邊緣像素點例如是 201030675 Μ. Τ 1 «/wvrx Λ- Λ. 像素點 Ρ2,12、Ρ3,12、?4,12 至?3,12、?2,4、?3,4 至?7,4、Ρΐ1,4、 Ρΐ2,4至Ρΐ6,4。轉換時,是逐一讀取並處理這些邊緣像素點。 接著,如步驟S402所示,判斷是否為可處理之像素 點。其中,每當欲轉換一個邊緣像素點時,是使該欲轉換 之邊緣像素點位於一個3x3矩陣之中心位置,並根據位在 該3x3矩陣之其他八個位置之周圍像素點之資料值,去判 斷是否將該欲轉換之邊緣像素點轉換為空白像素點。 以像素點Ρ2,ΐ2為例,以其為中心之3x3矩陣之資料 ❿ 〔0 0 0、 值可以表示成1 1 0,其中,第1列以及第3行之資料The character fetched in step S1Q in this embodiment is, for example, the character η whose original image is, for example, an 8-value value, between 0 and 255 as shown in Fig. 4A. - an 8-bit image outside, and its data value (between grayscales 5. Binarized image after binarization 1 〇〇 binarized image 100 pixel Pi, j (in which Step S20+, when binarizing, first assigning a plant and then comparing the data value of the pixel with the value of (10). If the data value of a pixel is greater than or equal to the threshold, the pixel is represented. To be 1 or to represent the pixel as a white background, the data value can be set to 〇; when the material of the right pixel is at the reading value, it means the pixel is a dark point or represents the character. The position of some of the lines, the data value * is also shown in the array below the 4A picture, the data value corresponding to the pixels of the binary image is 】 or 〇, the data value of the location is !, the rest Then, the line is as shown in step S401 of Fig. 3, and the data value of the edge pixel of the currently processed image is read. As shown in Fig. 4A®, the word TCH is found along the first direction D1 of the array. The edge pixel of one direction D1 is, for example, 201030675 Μ. Τ 1 «/wvrx Λ- Λ. Pixels Ρ2,12,Ρ3,12 ?4,12 to?3,12,?2,4,?3,4 to?7,4,Ρΐ1,4, Ρΐ2,4 to Ρΐ6,4. When converting, these edge pixels are read and processed one by one. Next, as shown in step S402, it is determined whether it is a processable pixel point, wherein each time an edge pixel point is to be converted, the edge pixel to be converted is located at a center position of a 3x3 matrix, and according to the bit position. In the data values of the surrounding pixels of the other eight positions of the 3x3 matrix, to determine whether to convert the edge pixels to be converted into blank pixels. Taking the pixel points Ρ2, ΐ2 as an example, the 3x3 matrix centered on it The data ❿ [0 0 0, the value can be expressed as 1 1 0, of which the data of the first column and the third row

I1 1 〇J 值皆為〇,可判斷出像素點P2,12並非位在單一像素點寬度 之位置,故為一可處理之邊緣像素點。 然後,如步驟S403所示,判斷所處理之像素點是否 為一角落點。當所處理之像素點為一角落點時,若是將該 像素點轉換為空白像素點,則會使字元線條產生缺角的情 Φ 形,因此,若是像素點為一角落點,較佳地保留該像素點。 此步驟中,當欲轉換之邊緣像素點之周圍像素點之資料符 合一角落點資料時,則保留該欲轉換之邊緣像素點。舉例 來說,角落點資料包括下列條件: '0 0 0、 '0 1 0、 ’0 10、 ,0 0 0、 0 1 > 0 1 1 0 1 0 、0 1 oy 、0 0 oy 、0 0 oy 、0 1 0, 上述矩陣中之空白位置是對應所欲轉換之像素點之 資料值。若是周圍像素點之資料符合上述任一條件,則表 示該像素點為一角落點而無須轉換,並回到步驟S401,讀 7 201030675 w^>u\J〇rrv 取下一個邊緣像素p2,12及其周SI像素點。由於像素點 此進行到下一步驟。身枓值並未符合上述任一條件,因接者,如步驟s4 否為連接點。當該像素:::連:::欲轉換之像素點是 若是該像素點為線=不連續的問題。因此, 當欲轉換m2 留觀他。此步驟中 虽欲轉換之邊緣像素點之關像素 ㈣中, 點資料時,則保铵鈹 "之貝枓符合一連接 接點資料包括二:、緣像素點。舉例來說,連 ^ 1 °1 (〇 〇 (0 1 〇x 0 4 、〇 1 〇 x 1 X、 0 0 X x X Ο X χ χ x χThe value of I1 1 〇J is 〇, and it can be judged that the pixel point P2, 12 is not located at the position of a single pixel point, so it is a processing edge pixel point. Then, as shown in step S403, it is judged whether or not the processed pixel point is a corner point. When the processed pixel point is a corner point, if the pixel point is converted into a blank pixel point, the character line is caused to have a corner shape, and therefore, if the pixel point is a corner point, preferably Keep this pixel. In this step, when the data of the surrounding pixel points of the edge pixel to be converted conforms to a corner point data, the edge pixel to be converted is retained. For example, the corner point data includes the following conditions: '0 0 0, '0 1 0, '0 10, 0 0 0, 0 1 > 0 1 1 0 1 0 , 0 1 oy , 0 0 oy , 0 0 oy , 0 1 0, the blank position in the above matrix is the data value corresponding to the pixel to be converted. If the data of the surrounding pixels meets any of the above conditions, it indicates that the pixel is a corner point without conversion, and returns to step S401 to read 7 201030675 w^>u\J〇rrv to remove an edge pixel p2, 12 and its SI pixel points. Since the pixel is taken, this proceeds to the next step. The body value does not meet any of the above conditions, because the recipient, such as step s4 is the connection point. When the pixel :::: even::: The pixel to be converted is the problem if the pixel is line = discontinuous. Therefore, when you want to convert m2, watch him. In this step, although the pixel of the edge pixel to be converted (4) is used, when the data is clicked, the 保 铍 quot quot 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓 枓For example, even ^ 1 °1 (〇 〇 (0 1 〇x 0 4 , 〇 1 〇 x 1 X, 0 0 X x X Ο X χ χ x χ

JJ

JJ

1〇 1 V χ ο χ、 X 1 χ 0 χ. ’χ Ο 1 χ Ο XXX Ο 1° 1 Ο χ X χ Ο χ Ο χ \ ’0 10) \ 1 1 J 〇 0, 1 \ 0 X、 \ 1 X ) 、x 0 X> XXX ο X Ox X 料值上之空白位置對應所1 二1^素h 代表無須比對之資料值 1豕㈣$ ==像素點為-連接點而無續;;=任, 者回到步驟S4G1,讀取下—個邊,換(或移除),ϋ Ρ3,12。 邊緣像素點,例如是像, 於像素點Pm及其周圍像 次 °上述任-條件,表示像素點ρ⑶之胃料值也並身 連接點,因此,如步驟S4G5所;^不是角落點’ T ’移除該像素點 201030675 1 tv i λ 是將像素點〜2其資料值!轉換為〇,以 變為白色背景,並另外儲存1時影像以取代目H Ρ2,12 影像,以用於下-邊緣像素點之轉換。以第4Α^理之 原本圖式上方像素點P2,u之位誉合綴★ 嘲為例’ 方像素…對應之資料值白色背景,圖式下 接著’如步驟漏所示,判斷是否結束該 素點之轉換。由於第—方向⑴上仍有其他邊緣:像 〜、1>4,12至P16,12等未處理,故回到步驟S401,:素點 -個邊緣像素點之資料值’例如是像素點 讀取下 並進一步判斷是否重複上述步驟8402至8406貧料值, 第-方向D1之所有邊緣像素點於處理 一影像200與其資料值如第4B阁辟存之第 所示,讀取另-方向之邊緣像素:所不。之後如步碌⑽ 緊接著,是處理第二方向之邊緣像素點,其儿 著第4B圖的第-影像200其陣列之第二方向d = ,於第二方向D2之邊緣像素點例如是像素點p2,2、p= 15’2、P16,2等。同樣重複上逃步螺S4〇1至S4〇6,以處理 第-影像於第二方向D2之邊緣像素點,處理後所儲存之 第二影像300則如第4C圖所示。 之後是處理第三方向D3之邊緣像素點,如像素點1〇1 V χ ο χ, X 1 χ 0 χ. 'χ Ο 1 χ XXX XXX Ο 1° 1 Ο χ X χ Ο χ Ο χ \ '0 10) \ 1 1 J 〇0, 1 \ 0 X, \ 1 X ) , x 0 X> XXX ο X Ox X The blank position on the material value corresponds to 1 2 1 ^ h represents the data value of the unpaired data 1 豕 (4) $ == pixel point is - connection point without continuation ;; = any, return to step S4G1, read the next edge, change (or remove), ϋ Ρ 3,12. The edge pixel is, for example, imaged at the pixel point Pm and its surroundings. The gastric material value indicating the pixel point ρ(3) is also connected to the point. Therefore, as in step S4G5, ^ is not a corner point 'T 'Remove the pixel point 201030675 1 tv i λ is the pixel value ~ 2 its data value! Convert to 〇 to change to a white background, and store an additional 1 hour image instead of the target H Ρ 2, 12 image for the conversion of the bottom-edge pixel. In the original figure of the fourth figure, the pixel point P2, the position of the u is conjugated ★ ridicule as an example 'square pixel... corresponding data value white background, the pattern is followed by 'as indicated by the step leak, to determine whether to end the Conversion of prime points. Since there are still other edges in the first direction (1): like ~, 1 > 4, 12 to P16, 12, etc. are not processed, so returning to step S401, the data value of the prime point-edge pixel points is, for example, pixel reading. Taking off and further determining whether to repeat the above-mentioned steps 8402 to 8406, the edge value of all the edge pixels in the first direction D1 is processed in the image 200 and its data value as shown in the fourth block, and the other direction is read. Edge pixels: No. Then, as in step (10), the edge pixel in the second direction is processed, wherein the first image of the fourth image in FIG. 4B has a second direction d=, and the edge pixel in the second direction D2 is, for example, a pixel. Point p2, 2, p = 15'2, P16, 2, etc. Similarly, the escape stepped screws S4〇1 to S4〇6 are repeated to process the edge pixels of the first image in the second direction D2, and the second image 300 stored after the processing is as shown in Fig. 4C. Then is to process the edge pixels in the third direction D3, such as pixels

Pi6’3、P1G,4、P1(),5 至 p1G,1G 與 p16 u。所欲處理之像素點 3 '0 10、 或pi6,u其與周圍像素點之資料值可以表示成 0 0 0 此資料值係可判定邊緣像素點p16 3與P1M1皆位在單 9 201030675 x yy ^ woi i~v 一像素點寬度之位置,故不需再進行細化處理。直接處理 其他像素點,例如是像素點P1M。同樣重複上述步驟S401 至S406,以處理第三方向D3上之邊緣像素點,處理後所 儲存之第三影像400則如第4D圖所示,其中,前述像素 點?10,4至P10,10皆已變為白色背景,其對應之資料值則為 0 ° 最後則是對第四方向D4之邊緣像素點P2,3、PM、P8,5 至Ρ8,ιο與Ρ2,ιι做轉換。由於與前述步驟相同,故不再重 複說明,其轉換後所儲存之第四影像500及其對應之資料 值如第4E圖所示。 當四個方向之邊緣像素點皆轉換後,如第2圖之步驟 S35所示,判斷影像中之線條寬度是否為一個像素點之寬 度。由於第4E圖之第四影像500之所有線條寬度係為單 一像素點之寬度,因此,表示已完成影像之骨架化過程。 若否,則回到步驟S31,以繼續下一層像素點之轉換,直 到將影像骨架化成具有單一像素點寬度之線條。 本發明上述實施例所揭露之剝筍式骨架化之影像處 理方法,是先將原始影像轉換為一個二值化影像,再以對 稱之方式逐層剝除影像之像素點,例如是先後從二個相反 之方向將影像線條之邊緣像素點剝除,再從另二個相反之 方向進行一次剝除邊緣像素點的動作,並重複這些步驟, 進而將影像骨架化為一個像素點寬度之線條,且可同時保 留二值化影像之所有圖形化結構性資訊,如線條的位置、 方向和長度。如此一來,可大量簡化原始影像之像素點, 使影像得以藉由較為精簡與高效率之方式儲存。由於進行 201030675Pi6'3, P1G, 4, P1(), 5 to p1G, 1G and p16 u. The pixel value to be processed 3 '0 10, or pi6, u and its surrounding pixel point data value can be expressed as 0 0 0 This data value can be determined that the edge pixel points p16 3 and P1M1 are all in single 9 201030675 x yy ^ woi i~v The position of a pixel width, so no need to refine it. Direct processing of other pixels, such as pixel point P1M. The above steps S401 to S406 are also repeated to process the edge pixels in the third direction D3, and the third image 400 stored after the processing is as shown in FIG. 4D, wherein the pixel points are? 10, 4 to P10, 10 have become white background, the corresponding data value is 0 °, and finally the edge pixels P2, 3, PM, P8, 5 to Ρ8, ιο and Ρ2 for the fourth direction D4 , ιι to do the conversion. Since it is the same as the foregoing steps, the description will not be repeated, and the fourth image 500 stored after the conversion and its corresponding data value are as shown in FIG. 4E. When the edge pixels in all four directions are converted, as shown in step S35 of Fig. 2, it is judged whether the line width in the image is the width of one pixel. Since all the line widths of the fourth image 500 of Fig. 4E are the width of a single pixel point, it indicates that the skeletonization process of the image has been completed. If not, then return to step S31 to continue the conversion of the next layer of pixels until the image is skeletonized into lines having a single pixel dot width. The image processing method for stripping the skeleton skeleton disclosed in the above embodiment of the present invention first converts the original image into a binarized image, and then strips the pixels of the image layer by layer in a symmetrical manner, for example, from two In the opposite direction, the edge pixels of the image line are stripped, and the edge pixels are stripped from the other two opposite directions, and the steps are repeated, and the image is skeletonized into a line of pixel width. All graphical structural information of the binarized image, such as the position, direction and length of the line, can be preserved at the same time. In this way, the pixels of the original image can be greatly simplified, so that the image can be stored in a relatively simple and efficient manner. As a result of 201030675

丄 ” ywi»!· r"V 骨架化與線萃取可大幅降低資料儲存量,且可自動建立點 與線的鄰接位置和相對關係,可更進一步應用在自動檢驗 系統、圖像識別系統等,以有效提升影像識別之效率。 綜上所述,雖然本發明已以較佳實施例揭露如上,然 其並非用以限定本發明。本發明所屬技術領域中具有通常 知識者,在不脫離本發明之精神和範圍内,當可作各種之 更動與潤飾。因此,本發明之保護範圍當視後附之申請專 • 利範圍所界定者為準。 【圖式簡單說明】 第1圖繪示依照本發明較佳實施例的一種剝筍式骨 架化之影像處理方法之流程圖。 第2圖繪示第1圖之步驟S30更包含數個步驟之示意 圖。 第3圖繪示第2圖之步驟中於不同方向之邊緣像素點 之轉換更包含之多個步驟之示意圖。 ⑩ 第4A至4E圖,其繪示一個二值化影像及其對應資 料值逐步轉換之示意圖。 【主要元件符號說明】 100 :二值化影像 200 :第一影像 300 :第二影像 400 :第三影像 500 :第四影像 11丄” ywi»!· r"V Skeletonization and line extraction can greatly reduce the amount of data storage, and can automatically establish the adjacent position and relative relationship of points and lines, and can be further applied to automatic inspection systems, image recognition systems, etc. In order to improve the efficiency of the image recognition, the present invention has been disclosed in the above preferred embodiments, but it is not intended to limit the present invention. Those skilled in the art to which the present invention pertains, without departing from the invention. In the spirit and scope, the various modifications and refinements may be made. Therefore, the scope of protection of the present invention is defined by the scope of the application and the scope of the application. [Simplified description of the drawings] Figure 1 shows A flow chart of a method for processing an image of a thin-skinned skeleton according to a preferred embodiment of the present invention. FIG. 2 is a schematic view showing a step S30 of FIG. 1 further including several steps. FIG. 3 is a diagram showing the steps of FIG. The conversion of edge pixels in different directions further includes a schematic diagram of multiple steps. 10 Figures 4A to 4E, which illustrate a stepwise conversion of a binarized image and its corresponding data values. The main element REFERENCE NUMERALS 100: binarized image 200: first image 300: Second image 400: third image 500: fourth image 11

Claims (1)

201030675 1 VV ^V/UOl ΓΎ ' 七、申請專利範圍: 1. 一種剝筍式骨架化之影像處理方法,包括: a. 擷取一字元之一原始影像,其中,該原始影像具 有複數個像素點,且該些像素點係以一陣列之形式排列; b. 二值化該些像素點之資料值,使該原始影像轉換 為一個二值化影像; c. 依序沿著該陣列之四個方向讀取該二值化影像之 像素點之資料值,以找出該字元於該些方向之複數個邊緣 像素點,並根據各該些邊緣像素點之周圍像素點之資料值 © 去判斷是否轉換各該些邊緣像素點為空白像素點;以及 d. 重複步驟c直到影像中之線條寬度減為一個像素 點之寬度,以將該字元之該原始影像轉換為一骨架化影 像。 2. 如申請專利範圍第1項所述之影像處理方法,其 中,該二值化影像之該些像素點之資料值係為1或0。 3. 如申請專利範圍第1項所述之影像處理方法,其 中,該步驟c包括: ◎ cl.沿著一第一方向找出該字元於該第一方向之邊 緣像素點,並根據該第一方向之邊緣像素點其周圍像素點 之資料值,判斷是否將該第一方向之邊緣像素點轉換為空 白像素點,以將該二值化影像轉換後儲存為一第一影像; c2.沿著一第二方向讀取該第一影像,以找出該字元 於該第二方向之邊緣像素點,並根據該第二方向之邊緣像 素點其周圍像素點之資料值,判斷是否將該第二方向之邊 緣像素點轉換為空白像素點,以將該第一影像轉換後儲存 12 201030675 為一第二影像; c3.沿著一第三方向讀取該第二影像,以找出該字元 於該第三方向之邊緣像素點,並根據該第三方向之邊緣像 素點其周圍像素點之資料值,判斷是否將該第三方向之邊 緣像素點轉換為空白像素點,以將該第二影像轉換後儲存 為一第三影像;以及 c4.沿著一第四方向讀取該第三影像,以找出該字元 於該第四方向之邊緣像素點,並根據該第四方向之邊緣像 • 素點其周圍像素點之資料值,判斷是否將該第四方向之邊 緣像素點轉換為空白像素點,以將該第三影像轉換後儲存 為一第四影像。 4. 如申請專利範圍第3項所述之影像處理方法,其 中,該第二方向係與該第一方向相反,該第三方向係垂直 該第一方向,而該第四方向係與該第三方向相反。 5. 如申請專利範圍第3項所述之影像處理方法,其 中,每轉換一邊緣像素點後,則儲存一暫時影像,用以下 ® —邊緣像素點之轉換。 6. 如申請專利範圍第3項所述之影像處理方法,其 中,每當欲轉換一邊緣像素點時,係使該欲轉換之邊緣像 素點位於一個3x3矩陣之中心位置,並根據位在該3x3矩 陣之其他八個位置之周圍像素點之資料值,去判斷是否將 該欲轉換之邊緣像素點轉換為空白像素點。 7. 如申請專利範圍第3項所述之影像處理方法,其 中,當欲轉換之邊緣像素點之周圍像素點之資料符合一連 接點資料時,則保留該欲轉換之邊緣像素點。 13 201030675 1 w^wor/Λ. 8.如申請專利範圍第3項所述之影像處理方法,其 中,當欲轉換之邊緣像素點之周圍像素點之資料符合一角 落點資料時,則保留該欲轉換之邊緣像素點。201030675 1 VV ^V/UOl ΓΎ ' VII, the scope of application for patents: 1. An image processing method for stripping the skeleton-shaped skeleton, comprising: a. capturing one original image of one character, wherein the original image has a plurality of original images Pixels, and the pixels are arranged in an array; b. binarizing the data values of the pixels to convert the original image into a binarized image; c. sequentially following the array Reading the data values of the pixels of the binarized image in four directions to find a plurality of edge pixels of the character in the directions, and according to the data values of the surrounding pixels of the edge pixels Determining whether to convert each of the edge pixels to a blank pixel; and d. repeating step c until the line width in the image is reduced to a pixel width to convert the original image of the character into a skeleton image . 2. The image processing method of claim 1, wherein the data values of the pixels of the binarized image are 1 or 0. 3. The image processing method of claim 1, wherein the step c comprises: ◎ cl. finding a pixel pixel of the character in the first direction along a first direction, and according to the The edge pixel of the first direction points the data value of the surrounding pixel point, and determines whether the edge pixel of the first direction is converted into a blank pixel point, and the binary image is converted and stored as a first image; c2. Reading the first image along a second direction to find an edge pixel of the character in the second direction, and determining whether the data value of the pixel point around the edge pixel of the second direction is The edge pixel of the second direction is converted into a blank pixel to convert the first image and store 12 201030675 as a second image; c3. reading the second image along a third direction to find the The character is in the edge pixel of the third direction, and according to the data value of the pixel point around the edge pixel of the third direction, determining whether to convert the edge pixel of the third direction into a blank pixel to Second shadow And converting to a third image; and c4. reading the third image along a fourth direction to find an edge pixel of the character in the fourth direction, and according to the edge image of the fourth direction • The data value of the pixels around the pixel is determined to determine whether the edge pixel in the fourth direction is converted into a blank pixel to convert the third image into a fourth image. 4. The image processing method of claim 3, wherein the second direction is opposite to the first direction, the third direction is perpendicular to the first direction, and the fourth direction is The three directions are opposite. 5. The image processing method of claim 3, wherein each time an edge pixel is converted, a temporary image is stored, and the following ® - edge pixel point conversion is performed. 6. The image processing method of claim 3, wherein each time an edge pixel is to be converted, the edge pixel to be converted is located at a center of a 3x3 matrix, and The data values of the surrounding pixels of the other eight positions of the 3x3 matrix are used to determine whether to convert the edge pixels to be converted into blank pixels. 7. The image processing method of claim 3, wherein when the data of the surrounding pixel points of the edge pixel to be converted conforms to a connection point data, the edge pixel to be converted is retained. The image processing method of claim 3, wherein when the data of the surrounding pixel points of the edge pixel to be converted conforms to a corner point data, the method is retained. The edge pixel to be converted.
TW98103946A 2009-02-06 2009-02-06 Peeling skeletonization image processing method TW201030675A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98103946A TW201030675A (en) 2009-02-06 2009-02-06 Peeling skeletonization image processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98103946A TW201030675A (en) 2009-02-06 2009-02-06 Peeling skeletonization image processing method

Publications (1)

Publication Number Publication Date
TW201030675A true TW201030675A (en) 2010-08-16

Family

ID=44854335

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98103946A TW201030675A (en) 2009-02-06 2009-02-06 Peeling skeletonization image processing method

Country Status (1)

Country Link
TW (1) TW201030675A (en)

Similar Documents

Publication Publication Date Title
US7950589B2 (en) Program, information storage medium, two-dimensional code generation system, image generation system and printed material
US11283962B2 (en) Graphical indicator
CN103826031A (en) Method and apparatus for digital-image red-eye correction that facilitates undo operation
EP1431908A3 (en) Non-iterative method of calculating image skew
WO2020125481A1 (en) Method for generating identification pattern, and terminal device
CN101847209B (en) Character image correction method
CN105160343A (en) Information identification method and device applied to film on-demand-printing system
CN102682457A (en) Rearrangement method for performing adaptive screen reading on print media image
RU2009130339A (en) METHOD AND DEVICE FOR DATA PROCESSING
JP2008011135A (en) Image processing device and image processing program
TW201030675A (en) Peeling skeletonization image processing method
CN110119681B (en) Text line extraction method and device and electronic equipment
US20170178351A1 (en) Method for determining missing values in a depth map, corresponding device, computer program product and non-transitory computer-readable carrier medium
CN103201786B (en) Content is utilized to keep distortion to reinvent interface
CN113986152A (en) Ink jet printing method, device, equipment and storage medium for image segment conversion
EP1286300A3 (en) Data acquisition system and method using answer forms
JP5278093B2 (en) Article related information providing method, apparatus, program, and recording medium
CN110996026B (en) OSD display method, device, equipment and storage medium
EP2888699A1 (en) Notebook and method for digitizing notes
JP7478628B2 (en) Image processing device, control method, and control program
CN109819137B (en) Image acquisition and output method
JP2008004116A (en) Method and device for retrieving character in video
CN110490825B (en) Method, device and equipment for correcting coded picture and storage medium
JP7282257B2 (en) Image processing device, control method and control program
CN108460384B (en) Character segmentation method for offline handwriting text