TW201419171A - Method of leaf recognition - Google Patents

Method of leaf recognition Download PDF

Info

Publication number
TW201419171A
TW201419171A TW101141028A TW101141028A TW201419171A TW 201419171 A TW201419171 A TW 201419171A TW 101141028 A TW101141028 A TW 101141028A TW 101141028 A TW101141028 A TW 101141028A TW 201419171 A TW201419171 A TW 201419171A
Authority
TW
Taiwan
Prior art keywords
leaf
tested
image
feature
plant species
Prior art date
Application number
TW101141028A
Other languages
Chinese (zh)
Other versions
TWI467499B (en
Inventor
Wen-Ping Chen
Fu-San Chou
Jyh-Horng Chou
Song-Shyong Chen
Ting-Hao Wu
Original Assignee
Univ Nat Kaohsiung Applied Sci
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 Univ Nat Kaohsiung Applied Sci filed Critical Univ Nat Kaohsiung Applied Sci
Priority to TW101141028A priority Critical patent/TWI467499B/en
Publication of TW201419171A publication Critical patent/TW201419171A/en
Application granted granted Critical
Publication of TWI467499B publication Critical patent/TWI467499B/en

Links

Abstract

A method of leaf recognition for identifying the species of a leaf is disclosed. The method comprises: an image accessing step, a pre-processing step, a features extracting step and a comparison step. The image accessing step accesses a input image containing a input leaf. The pre-processing step processes the input image with gray scaling and thresholding operations to generate a binary image, and calculates the centroid of the binary image to isolate the input leaf. The features extracting step extracts features of the input leaf, where the features includes at least one clear feature and at least one fuzzy feature. The comparison step uses the clear features to classify the leaves; then locates all the species of a database with the same clear feature classification of the input leaf; further compares the difference between the fuzzy features of the input leaf and the fuzzy features of the above mentioned species. Accordingly, the species that the input leaf belongs to can be recognized.

Description

樹葉辨識方法 Leaf identification method

本發明係關於一種樹葉辨識方法,尤其是一種藉由影像分析處理技術辨識一樹葉所屬之植物物種之樹葉辨識方法。 The invention relates to a leaf identification method, in particular to a leaf identification method for identifying a plant species to which a leaf belongs by image analysis processing technology.

植物界的物種種類繁多,全世界的植物估計約有35萬種,因此許多特徵相似的物種即便是植物專家都難以識別個種差異,何況對於一般民眾而言,所能分辨的植物種類往往寥寥可數。 There are many species in the plant world, and there are an estimated 350,000 species of plants around the world. Therefore, many species with similar characteristics are difficult for plant experts to identify differences, and for the general public, the types of plants that can be distinguished are often countable.

植物的各項器官當中,樹葉係供辨識植物的重要器官,由於樹葉較花朵以及果實等其它器官更接近二維平面影像,且具備多種幾何特徵之豐富資訊,透過樹葉葉片的外觀形狀、顏色、形態與生長次序等特徵,就能夠分辨多數植物物種。因此,欲辨識一樹葉所屬之植物物種時,樹葉通常是首選的判斷指標。然而,習知樹葉辨識方法皆為透過人力對一樹葉之特徵進行觀察、量測與紀錄,再比對植物圖鑑上的資料以進行植物物種判別,然而對該樹葉葉片進行觀測的過程往往費時費力,加上植物圖鑑上所記載的植物物種不計其數,導致習知樹葉辨識方法效率不彰。此外,人工量測樹葉特徵與肉眼比對圖鑑資料的方式,容易因為人為誤差導致判定結果錯誤。 Among the various organs of the plant, the leaves are important organs for identifying plants. Since the leaves are closer to the two-dimensional plane image than the flowers and other organs, and have a wealth of information on various geometric features, the shape, color, and shape of the leaves through the leaves. Characteristics such as morphology and growth order can distinguish most plant species. Therefore, when it is desired to identify the plant species to which a leaf belongs, the leaves are usually the preferred indicator of judgment. However, the conventional method of leaf identification is to observe, measure and record the characteristics of a leaf by manpower, and then compare the data on the plant map for plant species discrimination. However, the process of observing the leaves is often time-consuming and laborious. In addition, the number of plant species recorded on the plant illustrations is innumerable, leading to the inefficiency of the conventional leaf identification method. In addition, the method of manually measuring the characteristics of the leaves and comparing the data with the naked eye is easy to cause the judgment result to be wrong due to human error.

基於上述原因,有必要進一步提供改良之樹葉辨識方法,以期能夠利用影像分析處理技術辨識樹葉,節省人工 辨識樹葉所耗費之人力、物力與時間,達成快速且精確辨識一樹葉所屬之植物物種之功效。 For the above reasons, it is necessary to further provide an improved leaf identification method, in order to be able to identify leaves using image analysis processing technology and save labor. Identify the manpower, material and time spent on leaves, and achieve the ability to quickly and accurately identify the plant species to which a leaf belongs.

本發明的目的乃改良上述之缺點,以提供一種樹葉辨識方法,藉由一電腦系統對一待測樹葉進行分析處理,辨識該待測樹葉所屬之植物物種,具有降低樹葉辨識成本之功效。 The object of the present invention is to improve the above-mentioned disadvantages, and to provide a leaf identification method, which can analyze the leaf to be tested by a computer system to identify the plant species to which the leaf to be tested belongs, and has the effect of reducing the cost of identifying the leaves.

本發明另一目的係提供一種樹葉辨識方法,該樹葉辨識方法以影像辨識方式辨識一測樹葉所屬之植物物種,辨識時不人為誤差的影響,具有增進樹葉辨識準確性之功效。 Another object of the present invention is to provide a leaf identification method for identifying a plant species to which a leaf belongs according to an image recognition method, which has the effect of improving the accuracy of leaf recognition by eliminating the influence of human error.

本發明樹葉辨識方法,藉由一電腦系統以及該電腦系統所具有之樹葉影像資料庫,辨識一待測樹葉所屬之植物物種,包含:一影像讀取步驟,該電腦系統讀入一待測影像,該待測影像中包含該待測樹葉;一前置處理步驟,係對該待測影像執行灰階處理與二值化處理,產生一二值化圖形,並計算該二值化圖形之質心位置,以分離出該待測影像中的待測樹葉;一特徵擷取步驟,擷取該待測樹葉之特徵值,該特徵值包含至少一明確特徵與至少一統計特徵,該至少一明確特徵為具有一明確數值之樹葉特徵,該至少一統計特徵為具有一數值範圍之樹葉特徵;及一資料比對步驟,篩選出該樹葉影像資料庫中,與該待測樹葉具有相同明確特徵之植物物種,並將各該植物物種之統計特徵與該待測樹葉之統計特徵進行比對運算,以判斷該待測樹 葉所屬之植物物種。 The leaf identification method of the present invention identifies a plant species to which the leaf to be tested belongs by using a computer system and a leaf image database of the computer system, comprising: an image reading step, the computer system reading in a image to be tested The image to be tested includes the leaf to be tested; a pre-processing step is to perform grayscale processing and binarization processing on the image to be tested, generate a binarized graph, and calculate the quality of the binarized graph. a heart position to separate the leaf to be tested in the image to be tested; a feature extraction step of extracting a feature value of the leaf to be tested, the feature value comprising at least one explicit feature and at least one statistical feature, the at least one clear Characterized by a leaf feature having a definite value, the at least one statistical feature is a leaf feature having a range of values; and a data matching step to screen out the image database of the leaf having the same clear characteristics as the leaf to be tested Plant species, and comparing the statistical characteristics of each plant species with the statistical characteristics of the leaf to be tested to determine the tree to be tested The plant species to which the leaf belongs.

本發明之樹葉辨識方法,其中,該資料比對步驟進行比對運算所使用的演算法係包含最小平方法,該最小平方法運算公式如下式(5)所示: 其中,ε為該待測樹葉相較該樹葉影像資料庫中一植物物種的最小平方誤差,i為該統計特徵的編號,n為該統計特徵的數目,d i 為自該待測樹葉擷取之第i個統計特徵,ε i 為該待測樹葉之第i個統計特徵相較於該植物物種的最小平方誤差,max i 為該植物物種於該樹葉影像資料庫中,所記錄之第i個統計特徵的最大值,min i 為該植物物種於該樹葉影像資料庫中,所記錄之第i個統計特徵的最小值。 The leaf identification method of the present invention, wherein the algorithm used for the comparison operation of the data matching step comprises a least square method, and the minimum flat method operation formula is as shown in the following formula (5): Where ε is the least square error of the plant species to be compared with the plant species in the leaf image database, i is the number of the statistical feature, n is the number of the statistical features, and d i is taken from the leaf to be tested The i-th statistical feature, ε i is the least square error of the i-th statistical feature of the leaf to be tested compared to the plant species, and max i is the plant species in the leaf image database, the recorded i The maximum value of the statistical features, min i is the minimum value of the i-th statistical feature recorded by the plant species in the leaf image database.

本發明之樹葉辨識方法,其中,該至少一明確特徵包含上下邊緣點數,該上下邊緣點數係為一水平線與該待測樹葉之葉片上緣及下緣之交點數目。 The leaf identification method of the present invention, wherein the at least one explicit feature comprises a number of points of upper and lower edges, the number of points of the upper and lower edges being the intersection of a horizontal line and the upper and lower edges of the blade of the leaf to be tested.

本發明之樹葉辨識方法,其中,該至少一統計特徵包含緊緻性、圓形比、矩形比、凸形封包面積比、角度、長短軸比、葉端長度、葉柄長度與上下半面積比。 The leaf identification method of the present invention, wherein the at least one statistical feature comprises a compactness, a circular ratio, a rectangular ratio, a convex envelope area ratio, an angle, a length to length axis ratio, a tip length, a petiole length, and an upper and lower half area ratio.

本發明之樹葉辨識方法,其中,該灰階處理係取該待測影像之飽和度作為該待測影像之灰階值。 The method for identifying a leaf of the present invention, wherein the grayscale processing takes the saturation of the image to be tested as a grayscale value of the image to be tested.

本發明之樹葉辨識方法,其中,該灰階處理係取該待 測影像之飽和度,另執行一邊緣偵測運算,計算該待測影像各像素之影像梯度值,並與該飽和度相加作為該待測影像之灰階值。 The leaf identification method of the present invention, wherein the gray scale processing is taken The saturation of the image is measured, and an edge detection operation is performed to calculate an image gradient value of each pixel of the image to be tested, and the saturation is added as the grayscale value of the image to be tested.

本發明之樹葉辨識方法,其中,該前置處理步驟另包含一雜點濾除運算,該雜點濾除運算係針對該二值化圖形,進行膨脹與侵蝕運算填補缺洞及消除雜訊,再計算該二值化圖形之質心位置。 The leaf identification method of the present invention, wherein the pre-processing step further comprises a noise filtering operation, wherein the noise filtering operation performs expansion and erosion operations on the binarized graphics to fill holes and eliminate noise. The centroid position of the binarized graph is then calculated.

本發明之樹葉辨識方法,其中,該二值化處理係使用OTSU自動閥值法進行二值化運算。 The leaf identification method of the present invention, wherein the binarization processing performs binarization operation using an OTSU automatic threshold method.

為讓本發明之上述及其他目的、特徵及優點能更明顯易懂,下文特舉本發明之較佳實施例,並配合所附圖式,作詳細說明如下:本發明全文所述之「像素」(pixels),係指一影像(image)組成的最小單位,用以表示該影像之解析度(resolution),例如:若該影像之解析度為1024×768,則代表該影像共有(1024×768=786432)個像素,係本發明所屬技術領域中具有通常知識者可以理解。 The above and other objects, features and advantages of the present invention will become more <RTIgt; (pixels) is the smallest unit of an image used to represent the resolution of the image. For example, if the resolution of the image is 1024×768, it means that the image is common (1024× 768 = 786432) pixels are understood by those of ordinary skill in the art to which the present invention pertains.

本發明全文所述之「色階」(color level),係指該像素所顯現顏色分量或亮度的濃淡程度,例如:彩色(color)影像之紅色(R)、綠色(G)、藍色(B)分量的色階範圍(range)可為0~255,或者,灰階(gray-level)影像之亮度(luminance)的色階範圍可為0~255,係本發明所屬技術領域中具有通常知識者可以理解。 The "color level" as used throughout the present invention refers to the degree of shading of the color component or brightness exhibited by the pixel, for example, the red (R), green (G), and blue (color) images. B) The range of the color gradation of the component may be 0 to 255, or the gradation range of the luminance of the gray-level image may range from 0 to 255, which is generally in the technical field of the present invention. Knowledge people can understand.

本發明全文所述之「樹葉」,係指植物的營養器官,且包含葉片、葉柄與托葉等三個部份,其中,樹葉靠近葉柄的部份稱作葉基,沿著主葉脈(primary vein)遠離葉柄的部分稱作葉端,係本發明所屬技術領域中具有通常知識者可以理解。 The "leaf" as used throughout the present invention refers to a vegetative organ of a plant, and includes three parts: a leaf, a petiole, and a stipules. The part of the leaf near the petiole is called the leaf base, along the main vein (primary The portion of the vein) away from the petiole is referred to as the tip of the leaf, as will be understood by those of ordinary skill in the art to which the present invention pertains.

請參閱第1圖所示,係為本發明樹葉辨識方法較佳實施例之系統架構圖,藉由一待測影像來源1連接一電腦系統2(例如習知電腦主機、檔案伺服器或雲端伺服器等)作為執行架構。其中,該待測影像來源1可為一相機、攝影機、掃描器或儲存裝置等,可儲存只少一待測影像A,該待測影像A可為彩色或黑白影像,且該待測影像A中包含一待測樹葉B之葉片影像與葉柄影像。該電腦系統2具有一樹葉影像資料庫21,該樹葉影像資料庫21包含複數個植物物種之樹葉影像資料,且該複數個植物物種涵蓋所有該待測樹葉B可能屬於之植物物種。該電腦系統2係耦接該待測影像來源1,以接收該待測影像A,並據以執行本發明樹葉辨識方法較佳實施例所揭示的運作流程,可辨識該待測影像A中所包含之待測樹葉B所屬之植物物種。在此實施例當中,該待測影像A係以一RGB彩色影像作為實施態樣進行後續說明,惟不以此為限,依此類推,可應用於黑白影像或其它種類之彩色影像的樹葉辨識,其係本發明所屬技術領域中具有通常知識者可以理解,在此容不贅述。 Please refer to FIG. 1 , which is a system architecture diagram of a preferred embodiment of the leaf identification method of the present invention, connected to a computer system 2 by a source 1 to be tested (for example, a conventional computer host, a file server, or a cloud server) As an execution architecture. The image source 1 to be tested may be a camera, a camera, a scanner, or a storage device, and may store only one image to be tested A. The image to be tested A may be a color or black and white image, and the image to be tested is A. It contains a leaf image and a petiole image of the leaf B to be tested. The computer system 2 has a leaf image database 21, and the leaf image database 21 includes leaf image data of a plurality of plant species, and the plurality of plant species covers all plant species to which the leaf B to be tested may belong. The computer system 2 is coupled to the image source 1 to be tested to receive the image A to be tested, and according to the operation flow disclosed in the preferred embodiment of the leaf identification method of the present invention, the image to be tested can be identified. Contains the plant species to which the leaf B to be tested belongs. In this embodiment, the image to be tested A is described by using an RGB color image as an implementation aspect, but not limited thereto, and the like, and can be applied to leaf recognition of black and white images or other kinds of color images. It is understood by those of ordinary skill in the art to which the present invention pertains, and is not described herein.

請參閱第2圖所示,其係本發明樹葉辨識方法較佳實施例之運作流程圖。其中,該樹葉辨識方法包含一影像讀 取步驟S1、一前置處理步驟S2、一特徵擷取步驟S3以及一資料比對步驟S4,分別敘述如後。 Please refer to FIG. 2, which is a flow chart of the operation of the preferred embodiment of the leaf identification method of the present invention. Wherein the leaf identification method comprises an image reading Step S1, a pre-processing step S2, a feature extraction step S3, and a data matching step S4 are respectively described as follows.

該影像讀取步驟S1,首先係藉由該電腦系統2,自該待測影像來源1讀入一待測影像A,該待測影像A中包含一待測樹葉B之葉片影像與葉柄影像,且該待測樹葉B之葉端朝向該待測影像A之上方,該待測樹葉B之葉基朝向該待測影像A之下方。在本實施例當中該待測影像A為一RGB影像,惟本發明不以此為限。當該影像讀取步驟S1完成後,開始進行該前置處理步驟步驟S2。 The image reading step S1 first reads, by the computer system 2, a to-be-tested image A from the image source 1 to be tested, and the image to be tested A includes a leaf image and a petiole image of the leaf B to be tested. The leaf end of the leaf B to be tested faces the image A to be tested, and the leaf base of the leaf B to be tested faces the image A to be tested. In the embodiment, the image to be tested A is an RGB image, but the invention is not limited thereto. After the image reading step S1 is completed, the pre-processing step S2 is started.

一般而言讀入的待測影像A來源通常為相機拍攝或掃描之圖檔,該待測影像A內容除了所包含的待測樹葉B外,時常參雜其它外在環境因子或是雜訊成份,例如:亮度分布不均、光線入射角度造成陰影、葉片部分缺損或葉柄斷裂等不利於辨識該樹葉的狀況,因此必須針對該待測影像A進行前置處理步驟S2,其包含一灰階處理子步驟S21、一二值化子步驟S22以及一物件搜尋子步驟S24,且較佳包含一雜點濾除子步驟S23,分別詳細說明如下。 Generally, the source of the image to be tested that is read in is usually a picture taken or scanned by the camera. The content of the image to be tested A is often mixed with other external environmental factors or noise components in addition to the leaf B to be tested. For example, the uneven brightness distribution, the shadow of the light incident angle, the partial defect of the blade or the rupture of the petiole are not conducive to the identification of the leaf. Therefore, the pre-processing step S2 must be performed for the image A to be tested, which includes a gray scale processing. Sub-step S21, a binarization sub-step S22 and an object search sub-step S24, and preferably comprise a noise filtering sub-step S23, which are described in detail below.

由於樹葉的顏色會因為外在光源的顏色而改變,因此需要對該待測影像A進行灰階處理,在該灰階處理子步驟S21中,係取該待測影像A的飽和度(saturation)S作為灰階值,以生成一灰階影像,相較傳統將RGB影像之紅、綠、藍三種色域之色階值分別乘上權重的色階轉換方式,可有效避免將陰影誤判為葉片輪廓的情形。其中,計算該待測影像A之飽和度S的方式如下式(1)所示: 其中(x,y)為像素座標值,R(x,y)、G(x,y)、B(x,y)分別代表紅、綠、藍三種色域之色階值。 Since the color of the leaf changes due to the color of the external light source, the image to be tested A needs to be subjected to gray scale processing. In the gray scale processing substep S21, the saturation of the image to be tested A is taken. S is used as the grayscale value to generate a grayscale image. Compared with the traditional gradation value of the RGB image, the color gradation values of the red, green and blue gamuts are respectively multiplied by the weight gradation conversion mode, which can effectively avoid the shadow being mistakenly judged as the blade. The situation of the outline. The manner of calculating the saturation S of the image to be tested A is as follows: (1): Where (x, y) is the pixel coordinate value, and R(x, y), G(x, y), and B(x, y) represent the gradation values of the red, green, and blue color gamuts, respectively.

除了直接以飽和度S作為灰階值生成該灰階影像外,該灰階處理子步驟S21較佳包含一邊緣偵測運算,主要原理係計算該待測影像A中各像素之影像梯度(gradient)值▽I,該影像梯度值▽I之計算方法方式如下式(2)所示: 接著將該影像梯度值▽I與該灰階處理子步驟S21產生之飽和度S相加,以產生該灰階影像。含有該影像梯度值▽I之灰階影像,相較於單純以飽和度S作為灰階值之灰階影像,具有較清晰之輪廓。 In addition to directly generating the grayscale image with the saturation S as the grayscale value, the grayscale processing substep S21 preferably includes an edge detection operation, and the main principle is to calculate the image gradient of each pixel in the image to be tested A (gradient) The value ▽ I , the calculation method of the image gradient value ▽ I is as shown in the following formula (2): The image gradient value ▽ I is then added to the saturation S generated by the gray-scale processing sub-step S21 to generate the gray-scale image. The gray-scale image containing the image gradient value ▽ I has a clearer outline than the gray-scale image with the saturation S as the gray-scale value.

由於本發明樹葉辨識方法僅利用樹葉的形狀特徵來辨識樹葉所屬之植物物種,葉片上的紋路、葉脈、以及顏色深淺皆屬無效特徵資訊,因此需要對該灰階影像進行二值化轉換。該二值化子步驟S22係選定一閥值,並將該灰階影像各像素之灰階值與該閥值進行比對,該灰階影像中灰階值大於該閥值之像素將轉換成1(白色),灰階值小於該閥值之像素將轉換成0(黑色),以產生一二值化圖形。其中,選定該閥值的方法可為雙峰法、疊代法或OTSU自動閥值法等,且在本實施例當中較佳使用OTSU自動閥值法。 Since the leaf identification method of the present invention only uses the shape characteristics of the leaves to identify the plant species to which the leaves belong, the lines, veins, and color depths on the leaves are invalid feature information, so the gray scale image needs to be binarized. The binarization sub-step S22 selects a threshold value, and compares the gray scale value of each pixel of the gray scale image with the threshold value, and the pixel with the gray scale value greater than the threshold value in the gray scale image is converted into 1 (white), pixels with grayscale values less than this threshold will be converted to 0 (black) to produce a binarized graph. The method for selecting the threshold may be a bimodal method, an iterative method or an OTSU automatic threshold method, and the OTSU automatic threshold method is preferably used in the embodiment.

該雜點濾除子步驟S23對該二值化圖形進行濾除雜點 處理,主要原理係使用膨脹(dilation)侵蝕(erosion)兩種基礎型態學運算,填補缺洞或消除雜訊,將該二值化圖形中的待測樹葉B內外部之雜點消除。惟,該雜點濾除子步驟S23係可選擇性執行,例如當一待測影像A足夠清晰,使得據以產生之二值化圖形未包含可能影響後續步驟運算結果之雜點時,可省略本步驟。 The noise filtering sub-step S23 filters the binary image Processing, the main principle is to use dilation erosion (erosion) two basic morphological operations, fill the hole or eliminate noise, eliminate the noise inside and outside the leaf B to be tested in the binarized graph. However, the noise filtering sub-step S23 can be selectively performed, for example, when a to-be-tested image A is sufficiently clear that the binarized pattern generated thereby does not include a noise point that may affect the operation result of the subsequent step, may be omitted. This step.

由於該待測影像A除了包含該待測樹葉B外,尚可能攝入其它物體,因此需要對該待測影像A之二值化圖形進行物件搜尋處理以找出該待測樹葉B,該物件搜尋子步驟S24首先計算一質心位置,該質心位置計算方式如下式(3)所示: 其中,N為色階值為1之像素的數量,Q(x,y)為質心位置,p x (i)為第i個色階值為1之像素的x座標值,p y (i)為第i個色階值為1之像素的y座標值。接著將該二值化圖形中最接近該質心位置的圖形判定為該待測樹葉B,並且將該待測樹葉B分離出來,供後續步驟進行樹葉辨識。 Since the image to be tested A may contain other objects in addition to the leaf B to be tested, it is necessary to perform an object search process on the binarized image of the image to be tested A to find the leaf B to be tested. The search sub-step S24 first calculates a centroid position, which is calculated as shown in the following equation (3): Where N is the number of pixels with a gradation value of 1, Q ( x , y ) is the centroid position, p x ( i ) is the x coordinate value of the pixel with the ith gradation value of 1, p y ( i ) is the y coordinate value of the pixel whose i-th gradation value is 1. Next, the pattern closest to the centroid position in the binarized pattern is determined as the leaf B to be tested, and the leaf B to be tested is separated for subsequent recognition of the leaves.

該特徵擷取步驟S3係擷取該待測樹葉B中的複數個特徵值C,該複數個特徵值C為樹葉形狀的各種特徵,包含至少一明確特徵C1與至少一統計特徵C2。其中,明確特徵C1指的是具有一明確數值的樹葉特徵,例如葉緣或葉基的端點數、葉片邊緣為凸出或凹陷等;統計特徵C2指的是具有一範圍值的樹葉特徵,例如葉片面積、樹葉長度等。由於該待測樹葉B中包含葉片影像與葉柄影像,因 此該特徵擷取步驟S3於開始擷取該複數個特徵值C前,需透過一葉柄分離運算分辨該待測樹葉B之葉片與葉柄。已知該待測樹葉B之葉端朝向該待測影像A之上方,葉基朝向該待測影像A之下方,據此該葉柄分離運算係自該待測樹葉B之下端點取一葉柄寬,並向上比對該待測樹葉B每一水平位置之寬度,直至找到一水平高度下,該待測樹葉B之寬度大於四倍的該葉柄寬為止,判定該待測樹葉B於該水平高度以下的部份為葉柄,於該水平高度以上的部份為葉片。 The feature extraction step S3 captures a plurality of feature values C in the leaf B to be tested, and the plurality of feature values C are various features of the leaf shape, and include at least one explicit feature C1 and at least one statistical feature C2. Wherein, the explicit feature C1 refers to a leaf feature having a definite value, such as the number of endpoints of the leaf edge or the leaf base, the edge of the blade being convex or concave, and the like; the statistical feature C2 refers to the feature of the leaf having a range of values. For example, blade area, leaf length, and the like. Since the leaf B to be tested contains the image of the blade and the image of the petiole, The feature extraction step S3 is to distinguish the blade and the petiole of the leaf B to be tested by a petiole separation operation before starting to capture the plurality of feature values C. It is known that the leaf end of the leaf B to be tested is directed above the image to be tested A, and the leaf base is directed below the image to be tested A, according to which the petal separation operation system takes a leaf handle width from the lower end of the leaf B to be tested. And upwardly comparing the width of each horizontal position of the leaf B to be tested until a level is found, the width of the leaf B to be tested is greater than four times the width of the petiole, and the leaf B to be tested is determined to be at the level The following part is the petiole, and the part above the level is the blade.

在本實施例當中,該明確特徵C1為該待測樹葉B之上下邊緣點數,惟本發明不以此為限,該明確特徵C1亦可為一樹葉之上下端點數等其它特徵,或者可同時包含複數個特徵。請參照第4圖所示,該上下邊緣點數係藉由找出該待測樹葉B、B’之葉片之上端點與下端點,並據以分別畫出一條水平線作為一上邊界LU與一下邊界LD,再以一水平檢測線TU自該上邊界LU向下掃描,以另一水平檢測線TD自該下邊界LD向上掃描,其中,掃描的距離較佳小於該上端點與下端點之間距的一半。分別紀錄掃描過程中該水平檢測線TU、TD與該待測樹葉B之交點數目,並統計得出出現次數最多的交點數目,作為該待測樹葉B之上邊緣點數與下邊緣點數,合併該上邊緣點數與下邊緣點數即為該上下邊緣點數。例如如圖所示之待測樹葉B,該水平檢測線TU自該上邊界LU向下掃描時,與該待測樹葉B之交點數目出現次數最多的為4個,而該水平檢測線TD自該下邊界LD向上掃描時,與該待測樹葉B之交點數目 出現次數最多的為2個,因此該待測樹葉B具有上下邊緣點數(4,2);同理該待測樹葉B’具有上下邊緣點數(2,2)。該樹葉影像資料庫21係依據該明確特徵C1將樹葉所屬之植物物種分類,因此在本實施例當中,該樹葉影像資料庫21可具有上下邊緣點數為(2,2)、(4,2)、(6,2)、(2,4)...等分類。 In this embodiment, the explicit feature C1 is the number of points on the lower edge of the leaf B to be tested, but the invention is not limited thereto, and the explicit feature C1 may also be other features such as the number of upper and lower ends of a leaf, or Can contain multiple features at the same time. Referring to FIG. 4, the upper and lower edge points are obtained by finding the upper and lower end points of the leaves of the leaves B and B' to be tested, and respectively drawing a horizontal line as an upper boundary L U and The boundary L D is further scanned downward from the upper boundary L U by a horizontal detection line T U , and scanned upward from the lower boundary L D by another horizontal detection line T D , wherein the scanning distance is preferably smaller than the upper end Half the distance between the point and the lower end point. Recording the number of intersections between the horizontal detection lines T U and T D and the leaf B to be tested during the scanning process, and counting the number of intersections with the most occurrences as the number of edge points and lower edge points of the leaf B to be tested. The number of the upper edge points and the lower edge points is the number of the upper and lower edge points. For example, as shown in the leaf B to be tested, when the horizontal detection line T U is scanned downward from the upper boundary L U , the number of intersections with the leaf B to be tested is the highest, and the horizontal detection line When T D is scanned upward from the lower boundary L D , the number of intersections with the leaf B to be tested is the most frequently occurring, so the leaf B to be tested has the number of points on the upper and lower edges (4, 2); The leaf B' is measured to have the number of points on the upper and lower edges (2, 2). The leaf image database 21 classifies the plant species to which the leaves belong according to the explicit feature C1. Therefore, in the embodiment, the leaf image database 21 can have the number of points on the upper and lower edges (2, 2), (4, 2). ), (6, 2), (2, 4), etc.

在本實施例當中,該至少一統計特徵C2包含該待測樹葉B之緊緻性(compactness)、圓形比(circularity ratio)、矩形比(rectangularity ratio)、凸型封包面積比(convex hull ratio)、角度(angle)、長短軸比、葉端長度、葉柄長度與上下半面積比等共11個統計特徵C2,惟不以此為限。 In this embodiment, the at least one statistical feature C2 includes a compactness, a circularity ratio, a rectangularity ratio, and a convex hull ratio of the leaf B to be tested. ), angle (angle), length to short axis ratio, tip length, petiole length and upper and lower half area ratio, etc., a total of 11 statistical characteristics C2, but not limited to this.

該緊緻性係為該待測樹葉B之葉片周長的平方與葉片面積的比值,計算公式如下式(4)所示: 其中,CP為緊緻性,P B 為該待測樹葉B之葉片周長,A B 為該待測樹葉B之葉片面積,等同於該待測樹葉B之像素個數總和。 The compactness is the ratio of the square of the blade circumference of the leaf B to be tested to the leaf area, and the calculation formula is as shown in the following formula (4): Wherein, CP is compactness, P B is the blade circumference of the leaf B to be tested, and A B is the leaf area of the leaf B to be tested, which is equivalent to the sum of the number of pixels of the leaf B to be tested.

該圓形比係為該待測樹葉B之葉片與一圓之面積比,該圓之圓周長和該待測樹葉B之葉片周長相同,計算公式如下式(5)所示: 其中,CR為圓形比,P B 為該待測樹葉B之葉片周長,A B 為該待測樹葉B之葉片面積。 The circular ratio is the area ratio of the blade of the leaf B to be tested to a circle, and the circumference of the circle is the same as the blade circumference of the leaf B to be tested, and the calculation formula is as shown in the following formula (5): Wherein, CR is a circular ratio, P B is the blade circumference of the leaf B to be tested, and A B is the leaf area of the leaf B to be tested.

該矩形比係為該待測樹葉B之葉片面積與一最小矩形面積的比值,其中該最小矩形面積之產生方式為藉由將該待測樹葉之葉片以1°為單位旋轉,且每旋轉1°即計算一次該待測樹葉B之葉片於旋轉過程中所涵蓋的矩形面績,最後取最小值以得到該最小矩形面積。該矩形比計算公式如下式(6)所示:: 其中,RR為矩形比,A B 為該待測樹葉B之葉片面積,A rect 為該最小矩形面積。 The rectangular ratio is the ratio of the blade area of the leaf B to be tested to a minimum rectangular area, wherein the minimum rectangular area is generated by rotating the blade of the leaf to be tested in units of 1°, and each rotation is 1 ° Calculate the rectangular footprint of the blade of the leaf B to be tested during the rotation, and finally take the minimum value to obtain the minimum rectangular area. The calculation formula of the rectangle ratio is as shown in the following formula (6): Wherein RR is a rectangular ratio, A B is the blade area of the leaf B to be tested, and A rect is the minimum rectangular area.

該凸型封包面積比係為該待測樹葉B之葉片面積與一凸形封包面積的比值,其中該凸型封包為一封閉區域涵蓋該待測樹葉B之葉片,且該待測樹葉B之葉片內任意兩點的連線,不會超出該凸型封包的範圍。該凸型封包可透過習知凸形封包演算法對該待測樹葉B之葉片進行運算產生,習知凸形封包演算法主要包含增量式演算法(Incremental coven hull algorithm)、Jarvis步進法(Jarvis march)、Graham掃描法(Graham scan)、單調鏈(Monotone chain)、分冶法(Divide and conquer)或快包法(Quick hull)等,在本實施例當中較佳使用快包法。該凸型封包面積比計算公式如下式(7)所示:: 其中,CHA為凸型封包面積比,A B 為該待測樹葉B之葉片面積,A conv 為該凸型封包面積。 The convex package area ratio is a ratio of the blade area of the leaf B to be tested to a convex package area, wherein the convex type package is a closed area covering the blade of the leaf B to be tested, and the leaf to be tested B is The connection of any two points in the blade will not exceed the range of the convex package. The convex package can be operated by the conventional convex package algorithm to calculate the blade of the leaf B to be tested. The conventional convex package algorithm mainly includes an incremental algorithm (Incremental coven hull algorithm) and a Jarvis step method. (Jarvis march), Graham scan, Monotone chain, Divide and conquer, or Quick hull, etc., in this embodiment, the fast packet method is preferably used. The calculation formula of the convex package area ratio is as shown in the following formula (7): Wherein, CHA is a convex package area ratio, A B is the blade area of the leaf B to be tested, and A conv is the convex package area.

請參照第5圖所示,已知該待測樹葉B之葉片之上端點o與下端點p,並測得該待測樹葉B之待測樹葉長度H,於該上端點o垂直向下延伸一自定長度h之高度處,繪製一水平線與該待測樹葉B邊緣具有兩交點m、n,該兩交點m、n分別與該上端點o相連接所形成之夾角,係為該角度θ;以及於該下端點p垂直向上延伸一自定長度h之高度處,繪製一水平線與該待測樹葉B邊緣具有兩交點q、r,該兩交點q、r分別與該下端點p相連接所形成之夾角,係為該角度θ’。在本實施例當中,該自定長度h較佳為該待測樹葉長度H之四分之一及十六分之一,因此將產生四個該角度特徵值。 Referring to FIG. 5, the end point o and the lower end point p of the blade of the leaf B to be tested are known, and the length H of the leaf to be tested of the leaf B to be tested is measured, and the upper end o extends vertically downward. At a height of a custom length h, a horizontal line is drawn and the edge of the leaf B to be tested has two intersections m, n, and the angle between the two intersections m and n respectively connected to the upper end point o is the angle θ And at a height at which the lower end point p extends vertically upwards by a custom length h, a horizontal line is drawn with two intersections q and r of the edge of the leaf B to be tested, and the two intersections q and r are respectively connected to the lower end p The angle formed is the angle θ'. In this embodiment, the custom length h is preferably one quarter and one sixth of the length H of the leaf to be tested, so four angle feature values will be generated.

請再參照第4圖所示之待測樹葉B,若欲擷其角度時,由於該待測樹葉B之上端點有兩個,因此該電腦系統2將任選一點作為參考點。此外,於該參考點垂直向下延伸一自定長度h之高度處,繪製一水平線時,可能與該待測樹葉B邊緣具有4個交點,將無法依據前述方法計算角度特徵值,因此該電腦系統2將計算該水平線與該待測樹葉B相交之總長度,作為一底邊,並取一端點與該底邊組成一標準三角形,該標準三角形可為直角三角型或等腰三角形等,且該端點與該底邊相距該自定長度h,該標準三角形以該端點為頂點之角,可作為所欲擷取之角度特徵值。 Please refer to the leaf B to be tested shown in FIG. 4. If the angle is to be smashed, since there are two end points on the leaf B to be tested, the computer system 2 uses an optional point as a reference point. In addition, when the reference point extends vertically downwards at a height of a custom length h, when drawing a horizontal line, there may be 4 intersections with the edge of the leaf B to be tested, and the angle feature value cannot be calculated according to the foregoing method, so the computer The system 2 calculates a total length of the horizontal line intersecting the leaf B to be tested as a bottom edge, and takes an end point and the bottom edge to form a standard triangle, and the standard triangle may be a right triangle or an isosceles triangle, and the like The end point is spaced from the bottom edge by the custom length h, and the standard triangle has the angle of the end point as the apex, and can be used as the angle feature value to be extracted.

該長短軸比係指該待測樹葉B之長軸rL與短軸rS的比值。其中,長軸rL指的是該待測樹葉B之質心位置與邊緣的最長距離,短軸rS指的是該待測樹葉B之質心位置與邊緣的最短距離。該待測樹葉B之質心位置的計算方式與該 前置處理步驟S2之物件搜尋子步驟S24中所述相同。 The long axis ratio refers to the ratio of the long axis r L to the short axis r S of the leaf B to be tested. Wherein, the long axis r L refers to the longest distance between the centroid position and the edge of the leaf B to be tested, and the short axis r S refers to the shortest distance between the centroid position and the edge of the leaf B to be tested. The centroid position of the leaf B to be tested is calculated in the same manner as described in the object search sub-step S24 of the pre-processing step S2.

該葉端長度之計算方法與該葉柄分離運算相似,係自該待測樹葉B之上端點取一葉端寬,並向下比對該待測樹葉B每一水平位置之寬度,直至找到一水平高度下,該待測樹葉B之寬度大於四倍的該葉端寬為止,該水平高度以上的部份皆視為該待測樹葉B之葉端,因此該待測樹葉B之上端點與該水平高度之垂直距離即為該葉端長度。 The calculation method of the length of the leaf end is similar to the separation operation of the petiole, and takes a leaf end width from the upper end of the leaf B to be tested, and compares the width of each horizontal position of the leaf B to be tested downward until a level is found. The height of the leaf B to be tested is greater than four times the width of the leaf end, and the portion above the horizontal height is regarded as the leaf end of the leaf B to be tested, so the upper end of the leaf B to be tested is The vertical distance of the horizontal height is the length of the tip end.

請再參照第4圖所示之待測樹葉B,若欲擷其葉端長度時,由於該待測樹葉B之上端點有兩個,因此該電腦系統2將任選一點作為參考點,依據該參考點之葉端取一葉端寬。此外,向下比對該待測樹葉B每一水平位置之寬度時,應於每一水平位置繪製一水平線,計算該水平線與該待測樹葉B相交之總長度,作為該待測樹葉B於每一水平位置之寬度,與該葉端寬進行比對。 Please refer to the leaf B to be tested shown in Fig. 4. If you want to lengthen the leaf end, since there are two end points on the leaf B to be tested, the computer system 2 will select any point as a reference point. The leaf end of the reference point takes a leaf end width. In addition, when the width of each horizontal position of the leaf B to be tested is downward, a horizontal line should be drawn at each horizontal position, and the total length of the horizontal line intersecting the leaf B to be tested is calculated as the leaf B to be tested. The width of each horizontal position is compared to the width of the tip end.

該葉柄長度之計算方法係將該待測樹葉B之葉柄左半部輪廓的像素數量,與右半部輪廓的像素數量相加並取其平均,如此即使該待測樹葉B之葉柄為彎曲狀亦能正確計算出該葉柄長度。 The length of the petiole is calculated by adding the number of pixels of the left half of the petiole of the leaf B to be tested to the number of pixels of the right half of the contour, and averaging even if the petiole of the leaf B to be tested is curved. The length of the petiole can also be calculated correctly.

該上下半面積比之計算方法係將擷取該葉端長度時,所判定之該待測樹葉B的葉端去除。接著計算該待測樹葉B之葉片去除葉端後之長度,並依據該長度將該待測樹葉B之葉片劃分為一上半部與一下半部,該上半部與下半部之面積比值即為該上下半面積比。 The calculation method of the upper and lower half area ratios is to determine the length of the leaf end, and the determined leaf end of the leaf B to be tested is removed. Then calculating the length of the leaf of the leaf B to be tested after removing the leaf end, and dividing the leaf of the leaf B to be tested into an upper half and a lower half according to the length, the ratio of the area of the upper half to the lower half That is, the upper and lower half area ratio.

如上所述,該電腦系統2擷取該待測樹葉B之複數個特徵值C後,執行該資料比對步驟S4,依據該該複數個特 徵值C,與該樹葉影像資料庫21複數個植物物種之樹葉影像資料進行比對,以辨識該待測樹葉B所屬之植物物種。 As described above, after the computer system 2 captures the plurality of feature values C of the leaf B to be tested, the data comparison step S4 is performed, according to the plurality of special The levy value C is compared with the leaf image data of the plurality of plant species of the leaf image database 21 to identify the plant species to which the leaf B to be tested belongs.

該樹葉影像資料庫21之樹葉影像資料係包含各個植物物種之特徵值C資料,亦即同樣包含該明確特徵C1與該統計特徵C2。其中,由於該統計特徵C2指的是具有一範圍值的樹葉特徵,因此該統計特徵C2具有一最大值與一最小值。該資料比對步驟S4首先依據該待測樹葉B之明確特徵C1,在本實施例當中為該上下邊緣點數,篩選出該樹葉影像資料庫21中與該待測樹葉B具有相同該上下邊緣點數,因而歸屬於相同分類之植物物種。藉此,可忽略與該待測樹葉B具有不同該上下邊緣點數之植物物種,避免後續步驟針對不可能為該待測樹葉B之植物物種進行冗餘的比對運算。 The leaf image data of the leaf image database 21 contains the characteristic value C data of each plant species, that is, the explicit feature C1 and the statistical feature C2 are also included. Wherein, since the statistical feature C2 refers to a leaf feature having a range of values, the statistical feature C2 has a maximum value and a minimum value. The data comparison step S4 is firstly based on the explicit feature C1 of the leaf B to be tested, and in the present embodiment, the number of the upper and lower edge points is selected, and the leaf image database 21 is selected to have the same upper and lower edges as the leaf B to be tested. Points are therefore attributed to plant species of the same classification. Thereby, the plant species having different numbers of the upper and lower edge points from the leaf B to be tested can be ignored, and the subsequent steps are avoided for redundant comparison operations of the plant species that cannot be tested for the leaf B to be tested.

接著,該資料比對步驟S4藉由一最小平方法運算,將該待測樹葉B之統計特徵C2,與該樹葉影像資料庫21中,和該待測樹葉B屬於相同分類之每一植物物種的統計特徵C2進行逐一比對運算,該最小平方法運算公式如下式(8)所示: 其中,ε為該待測樹葉B相較該樹葉影像資料庫21中一植物物種的最小平方誤差,i為該統計特徵C2的編號,因此 在本實施例當中共有i=1,2,...,11共11個統計特徵C2,d i 為自該待測樹葉B擷取之第i個統計特徵C2,ε i d i 相較於該植物物種之第i個統計特徵C2的最小平方誤差,max i 為該植物物種於該樹葉影像資料庫21中,所記錄之第i個統計特徵C2的最大值,min i 為該植物物種於該樹葉影像資料庫21中,所記錄之第i個統計特徵C2的最小值。透過上述公式(8),計算該樹葉影像資料庫21中和該待測樹葉B屬於相同分類之每一植物物種,相較於該待測樹葉B之最小平方誤差ε,其中所產生最小平方誤差ε值最低之植物物種,即可判定為該待測樹葉B所屬之植物物種。 Then, the data comparison step S4 is operated by a least square method, and the statistical feature C2 of the leaf B to be tested is associated with each plant species of the same classification as the leaf image database 21 and the leaf B to be tested. The statistical feature C2 performs a one-by-one comparison operation, and the minimum flat method operation formula is as shown in the following formula (8): Where ε is the least square error of the leaf species B to be compared with a plant species in the leaf image database 21, i is the number of the statistical feature C2, so in the present embodiment, there are i=1, 2, .. ., 11 of 11 statistical features C2, D i is the i-th measured from the statistical feature leaves fetched C2 B, D i [epsilon] i is the least squares as compared to the i-th statistical characteristics of the plant species of C2 The error, max i is the maximum value of the i-th statistical feature C2 recorded by the plant species in the leaf image database 21, and min i is the plant species in the leaf image database 21, the recorded i The minimum value of the statistical feature C2. Through the above formula (8), each plant species in the leaf image database 21 and the leaf B to be tested belong to the same classification, and the least square error ε generated in the leaf B to be tested is calculated. The plant species with the lowest ε value can be determined as the plant species to which the leaf B to be tested belongs.

此外,由於各個統計特徵C2的數值範圍並不相同,造成各個統計特徵C2的最小平方誤差ε i 值大小也不同,導致在上述公式(5)中最小平方誤差ε受到各個統計特徵C2的影響幅度也可能不同。因此,該資料比對步驟S4在進行該最小平方法運算前較佳包含一正規化運算,係針對該樹葉影像資料庫21所包含之每一植物物種的統計特徵C2,將其最大值與一最小值分別除去該樹葉影像資料庫21的所有植物物種中,該統計特徵C2的最大值,並且將自該待測樹葉B擷取之統計特徵C2,同樣除去該樹葉影像資料庫21的所有植物物種中,該統計特徵C2的最大值。據此,可避免各個統計特徵C2對該最小平方誤差ε所造成的影響幅度不同。 In addition, since the numerical range of each statistical feature C2 is not the same, the magnitude of the least square error ε i of each statistical feature C2 is also different, resulting in the influence of the least square error ε on each statistical feature C2 in the above formula (5). It may also be different. Therefore, the data comparison step S4 preferably includes a normalization operation before performing the least squares operation, and the maximum value of the statistical feature C2 of each plant species included in the leaf image database 21 is The minimum value is respectively removed from all plant species of the leaf image database 21, the maximum value of the statistical feature C2, and the statistical feature C2 extracted from the leaf B to be tested is also removed, and all plants of the leaf image database 21 are also removed. The maximum value of this statistical characteristic C2 in the species. Accordingly, it is possible to avoid the influence of the different statistical characteristics C2 on the least square error ε .

綜上所述,本發明之樹葉辨識方法始於該影像讀取步驟S1,係由該電腦系統2讀入一待測影像A,經由該前置處理步驟S2,對該待測影像A進行影像分析處理,以將該 待測影像A轉換為一二值化圖形,並擷取出該待測樹葉B,供該特徵擷取步驟S2擷取該待測樹葉B之特徵值C,再交由該資料比對步驟S6,將該特徵值C與該樹葉影像資料庫21之複數個植物物種之樹葉影像資料進行比對運算,以辨識該待測樹葉B所屬之植物物種。據此,本發明之樹葉辨識方法可達成透過影像分析處理技術辨識樹葉之目的。 In summary, the leaf identification method of the present invention begins with the image reading step S1, in which the computer system 2 reads an image to be tested A, and performs image processing on the image to be tested A through the pre-processing step S2. Analytical processing to The image A to be tested is converted into a binary image, and the leaf B to be tested is taken out, and the feature extraction step B is taken for the feature extraction step S2, and then the data comparison step S6 is performed. The feature value C is compared with the leaf image data of the plurality of plant species of the leaf image database 21 to identify the plant species to which the leaf B to be tested belongs. Accordingly, the leaf identification method of the present invention achieves the purpose of identifying leaves through image analysis processing techniques.

藉此,本發明樹葉辨識方法較佳實施例僅需藉由該待測影像來源1所提供之待測影像A配合一電腦系統2即可辨識樹葉,效率相較於傳統人工量測樹葉特徵再以肉眼比對圖鑑資料具有大幅度提升,並能夠節省人工辨識樹葉所耗費之人力、物力與時間,以降低樹葉辨識所需成本。 Therefore, the preferred embodiment of the leaf identification method of the present invention only needs to cooperate with a computer system 2 to identify the leaves by the image A to be tested provided by the image source 1 to be tested, and the efficiency is compared with the traditional artificial measurement of the leaf features. The visual comparison of the image data is greatly improved, and the labor, material resources and time spent manually identifying the leaves can be saved to reduce the cost of leaf identification.

再者,本發明樹葉辨識方法較佳實施例使用影像辨識方式,辨識一待測樹葉B所屬之植物物種,可避免人為量測及判斷所產生之誤差,增進樹葉辨識的準確度。 Furthermore, the preferred embodiment of the leaf identification method of the present invention uses an image recognition method to identify a plant species to which the leaf B to be tested belongs, thereby avoiding errors caused by human measurement and judgment, and improving the accuracy of leaf recognition.

本發明樹葉辨識方法較佳實施例,僅需藉由分析處理一影像,即可快速而有效地量測該影像A中的樹葉所屬之植物物種,因此,可以提高樹葉辨識效率與準確度,進而達到「降低樹葉辨識成本」及「增加樹葉辨識準確性」等功效。 In the preferred embodiment of the leaf identification method of the present invention, the plant species to which the leaves belong to the image A can be quickly and efficiently measured by analyzing and processing an image, thereby improving the efficiency and accuracy of leaf identification, and further Achieve the effects of "reducing the cost of identifying leaves" and "increasing the accuracy of leaf identification".

雖然本發明已利用上述較佳實施例揭示,然其並非用以限定本發明,任何熟習此技藝者在不脫離本發明之精神和範圍之內,相對上述實施例進行各種更動與修改仍屬本發明所保護之技術範疇,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。 While the invention has been described in connection with the preferred embodiments described above, it is not intended to limit the scope of the invention. The technical scope of the invention is protected, and therefore the scope of the invention is defined by the scope of the appended claims.

〔本發明〕 〔this invention〕

1‧‧‧待測影像來源 1‧‧‧Source of image to be tested

2‧‧‧電腦系統 2‧‧‧ computer system

3‧‧‧樹葉影像資料庫 3‧‧‧Foliage Image Database

A‧‧‧待測影像 A‧‧‧ image to be tested

B‧‧‧待測樹葉 B‧‧‧ leaves to be tested

B’‧‧‧待測樹葉 B’‧‧‧ leaves to be tested

C‧‧‧特徵值 C‧‧‧ eigenvalue

C1‧‧‧明確特徵 C1‧‧‧clear features

C2‧‧‧統計特徵 C2‧‧‧ statistical characteristics

S1‧‧‧影像讀取步驟 S1‧‧‧Image reading step

S2‧‧‧前置處理步驟 S2‧‧‧ pre-processing steps

S21‧‧‧灰階處理子步驟 S21‧‧‧ Grayscale processing substeps

S22‧‧‧二值化子步驟 S22‧‧‧ Binarization substep

S23‧‧‧雜點濾除子步驟 S23‧‧‧Hard filter substeps

S24‧‧‧物件搜尋子步驟 S24‧‧‧Object Search Substep

S3‧‧‧特徵擷取步驟 S3‧‧‧Character extraction steps

S4‧‧‧資料比對步驟 S4‧‧‧ data comparison steps

LU‧‧‧上邊界 L U ‧‧‧ upper border

LD‧‧‧下邊界 L D ‧‧‧ lower border

TU‧‧‧水平檢測線 T U ‧‧‧ horizontal test line

TD‧‧‧水平檢測線 T D ‧‧‧ horizontal test line

H‧‧‧樹葉長度 H‧‧‧Lower length

h‧‧‧自定長度 h‧‧‧Custom length

θ‧‧‧角度 Θ‧‧‧ angle

θ’‧‧‧角度 ’’‧‧‧ angle

o‧‧‧上端點 o‧‧‧Upper endpoint

p‧‧‧下端點 P‧‧‧ lower end

m、n‧‧‧交點 m, n‧‧‧ intersection

q、r‧‧‧交點 q, r‧‧‧ intersection

S‧‧‧飽和度 S‧‧‧Saturation

I‧‧‧影像梯度值 I ‧‧‧ image gradient values

第1圖:本發明樹葉辨識方法較佳實施例之系統架構圖 Figure 1 is a system architecture diagram of a preferred embodiment of the leaf identification method of the present invention

第2圖:本發明樹葉辨識方法較佳實施例之運作流程圖 Figure 2 is a flow chart showing the operation of the preferred embodiment of the leaf identification method of the present invention

第3圖:本發明樹葉辨識方法較佳實施例之前置處理步驟之內部流程圖 Figure 3: Internal flow chart of the pre-processing steps of the preferred embodiment of the leaf identification method of the present invention

第4圖:本發明樹葉辨識方法較佳實施例之上下邊緣點數計算示意圖 Figure 4: Schematic diagram of the calculation of the number of points on the lower edge above the preferred embodiment of the leaf identification method of the present invention

第5圖:本發明樹葉辨識方法較佳實施例之角度計算示意圖 Figure 5 is a schematic diagram showing the angle calculation of the preferred embodiment of the leaf identification method of the present invention

S1‧‧‧影像讀取步驟 S1‧‧‧Image reading step

S2‧‧‧前置處理步驟 S2‧‧‧ pre-processing steps

S3‧‧‧特徵擷取步驟 S3‧‧‧Character extraction steps

S4‧‧‧資料比對步驟 S4‧‧‧ data comparison steps

Claims (8)

一種樹葉辨識方法,藉由一電腦系統以及該電腦系統所具有之樹葉影像資料庫,辨識一待測樹葉所屬之植物物種,包含:一影像讀取步驟,該電腦系統讀入一待測影像,該待測影像中包含該待測樹葉;一前置處理步驟,係對該待測影像執行灰階處理與二值化處理,產生一二值化圖形,並計算該二值化圖形之質心位置,以分離出該待測影像中的待測樹葉;一特徵擷取步驟,擷取該待測樹葉之特徵值,該特徵值包含至少一明確特徵與至少一統計特徵,該至少一明確特徵為具有一明確數值之樹葉特徵,該至少一統計特徵為具有一數值範圍之樹葉特徵;及一資料比對步驟,篩選出該樹葉影像資料庫中,與該待測樹葉具有相同明確特徵之植物物種,並將各該植物物種之統計特徵與該待測樹葉之統計特徵進行比對運算,以判斷該待測樹葉所屬之植物物種。 A leaf identification method for identifying a plant species to which a leaf to be tested belongs by using a computer system and a leaf image database of the computer system, comprising: an image reading step, the computer system reading in a image to be tested, The image to be tested includes the to-be-tested leaf; a pre-processing step performs grayscale processing and binarization processing on the image to be tested, generates a binarized graph, and calculates a centroid of the binarized graph Positioning to separate the leaves to be tested in the image to be tested; a feature extraction step of extracting feature values of the leaf to be tested, the feature value comprising at least one explicit feature and at least one statistical feature, the at least one explicit feature For a leaf feature having a definite value, the at least one statistical feature is a leaf feature having a numerical range; and a data matching step to screen out a plant having the same clear characteristics as the leaf to be tested in the leaf image database Species, and comparing the statistical characteristics of each plant species with the statistical characteristics of the leaves to be tested to determine the plant species to which the leaves to be tested belong. 如申請專利範圍第1項所述之樹葉辨識方法,其中,該資料比對步驟進行比對運算所使用的演算法係包含最小平方法,該最小平方法運算公式如下式所示: 其中,ε為該待測樹葉相較該樹葉影像資料庫中一植物物 種的最小平方誤差,i為該統計特徵的編號,n為該統計特徵的數目,d i 為自該待測樹葉擷取之第i個統計特徵,ε i 為該待測樹葉之第i個統計特徵相較於該植物物種的最小平方誤差,max i 為該植物物種於該樹葉影像資料庫中,所記錄之第i個統計特徵的最大值,min i 為該植物物種於該樹葉影像資料庫中,所記錄之第i個統計特徵的最小值。 The leaf identification method according to claim 1, wherein the algorithm used in the comparison operation includes a least square method, and the minimum flat method operation formula is as follows: Where ε is the least square error of the plant species to be compared with the plant species in the leaf image database, i is the number of the statistical feature, n is the number of the statistical features, and d i is taken from the leaf to be tested The i-th statistical feature, ε i is the least square error of the i-th statistical feature of the leaf to be tested compared to the plant species, and max i is the plant species in the leaf image database, the recorded i The maximum value of the statistical features, min i is the minimum value of the i-th statistical feature recorded by the plant species in the leaf image database. 如申請專利範圍第1或2項所述之樹葉辨識方法,其中,該至少一明確特徵包含上下邊緣點數,該上下邊緣點數係為一水平線與該待測樹葉之葉片上緣及下緣之交點數目。 The method for identifying leaves according to claim 1 or 2, wherein the at least one explicit feature comprises a number of upper and lower edge points, wherein the upper and lower edge points are a horizontal line and the upper and lower edges of the blade of the leaf to be tested. The number of intersections. 如申請專利範圍第3項所述之樹葉辨識方法,其中,該至少一統計特徵包含緊緻性、圓形比、矩形比、凸形封包面積比、角度、長短軸比、葉端長度、葉柄長度與上下半面積比。 The leaf identification method according to claim 3, wherein the at least one statistical feature comprises a compactness, a circular ratio, a rectangular ratio, a convex package area ratio, an angle, a long axis ratio, a leaf end length, and a petiole. The length is compared with the upper and lower half areas. 如申請專利範圍第1或2項所述之樹葉辨識方法,其中,該灰階處理係取該待測影像之飽和度作為該待測影像之灰階值。 The method for identifying leaves according to claim 1 or 2, wherein the grayscale processing takes the saturation of the image to be tested as a grayscale value of the image to be tested. 如申請專利範圍第1或2項所述之樹葉辨識方法,其中,該灰階處理係取該待測影像之飽和度,另執行一邊緣偵測運算,計算該待測影像各像素之影像梯度值,並與該飽和度相加作為該待測影像之灰階值。 The method for identifying leaves according to claim 1 or 2, wherein the grayscale processing takes the saturation of the image to be tested, and performs an edge detection operation to calculate an image gradient of each pixel of the image to be tested. The value is added to the saturation as the grayscale value of the image to be tested. 如申請專利範圍第1或2項所述之樹葉辨識方法,其中,該前置處理步驟另包含一雜點濾除運算,該雜點濾除運算係針對該二值化圖形,進行膨脹與侵蝕運算填補缺洞及消除雜訊,再計算該二值化圖形之質心位置。 The method for identifying leaves according to claim 1 or 2, wherein the pre-processing step further comprises a noise filtering operation, wherein the noise filtering operation performs expansion and erosion on the binarized image. The operation fills the hole and eliminates the noise, and then calculates the centroid position of the binarized figure. 如申請專利範圍第1或2項所述之樹葉辨識方法,其中,該二值化處理係使用OTSU自動閥值法進行二值化運算。 The leaf identification method according to claim 1 or 2, wherein the binarization processing is performed by an OTSU automatic threshold method.
TW101141028A 2012-11-05 2012-11-05 Method of leaf recognition TWI467499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW101141028A TWI467499B (en) 2012-11-05 2012-11-05 Method of leaf recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW101141028A TWI467499B (en) 2012-11-05 2012-11-05 Method of leaf recognition

Publications (2)

Publication Number Publication Date
TW201419171A true TW201419171A (en) 2014-05-16
TWI467499B TWI467499B (en) 2015-01-01

Family

ID=51294380

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101141028A TWI467499B (en) 2012-11-05 2012-11-05 Method of leaf recognition

Country Status (1)

Country Link
TW (1) TWI467499B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065014A (en) * 2020-12-05 2021-07-02 泰州市朗嘉馨网络科技有限公司 Drop tree body type identification platform and method
CN113854284A (en) * 2021-09-23 2021-12-31 惠州市惠城区健生生态农业基地有限公司 Method and system for intelligently manufacturing plant leaf specimen

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
NZ553345A (en) * 2004-08-23 2010-01-29 Intergraph Software Tech Co Real-time image stabilization
US20090210086A1 (en) * 2007-12-20 2009-08-20 Mks Instruments, Inc. Systems and methods for sorting irregular objects
CN101916382B (en) * 2010-07-30 2012-05-30 广州中医药大学 Method for recognizing image of plant leaf

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113065014A (en) * 2020-12-05 2021-07-02 泰州市朗嘉馨网络科技有限公司 Drop tree body type identification platform and method
CN113065014B (en) * 2020-12-05 2021-12-17 林周容 Drop tree body type identification device and method
CN113854284A (en) * 2021-09-23 2021-12-31 惠州市惠城区健生生态农业基地有限公司 Method and system for intelligently manufacturing plant leaf specimen

Also Published As

Publication number Publication date
TWI467499B (en) 2015-01-01

Similar Documents

Publication Publication Date Title
CN110349126B (en) Convolutional neural network-based marked steel plate surface defect detection method
CN115082419B (en) Blow-molded luggage production defect detection method
CN108629775B (en) Thermal state high-speed wire rod surface image processing method
CN109978822B (en) Banana maturity judging modeling method and judging method based on machine vision
US6954550B2 (en) Image processing method and apparatus
CN113592861B (en) Bridge crack detection method based on dynamic threshold
CN104636706B (en) One kind is based on gradient direction uniformity complex background bar code image automatic division method
CN111915704A (en) Apple hierarchical identification method based on deep learning
CN110210448B (en) Intelligent face skin aging degree identification and evaluation method
CN108181316B (en) Bamboo strip defect detection method based on machine vision
CN106855951A (en) A kind of grain kind quality detecting method based on computer vision
CN115082451B (en) Stainless steel soup ladle defect detection method based on image processing
CN112699876A (en) Automatic reading method for various meters of gas collecting station
CN110596120A (en) Glass boundary defect detection method, device, terminal and storage medium
CN103852034B (en) A kind of method for measuring perendicular
CN109035227A (en) The system that lung tumors detection and diagnosis is carried out to CT image
CN113706490B (en) Wafer defect detection method
CN111950654B (en) Magic cube color block color reduction method based on SVM classification
KR101813223B1 (en) Method and apparatus for detecting and classifying surface defect of image
TWI467499B (en) Method of leaf recognition
KR101782366B1 (en) Vision inspection method based on learning data using normalization of sample scale
CN105678795B (en) A kind of field shoe watermark image method of inspection
CN114881984A (en) Detection method and device for rice processing precision, electronic equipment and medium
CN110443811B (en) Full-automatic segmentation method for complex background leaf image
CN109658382B (en) Tongue positioning method based on image clustering and gray projection

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees