Ginkgo leaf abnormal phenotype detection method

Through machine learning methods, the steps of data acquisition, contour extraction and shape matching model construction are adopted to realize automatic detection of abnormal phenotypes of ginkgo leaves, solving the problem of fewer detection methods in the existing technology, and improving detection efficiency and accuracy.

CN119600005AActive Publication Date: 2025-03-11QINGDAO AGRI UNIV +2

Patent Information

Application Number
CN202411739300.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-11
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

There are few existing methods for detecting abnormal phenotypes of ginkgo leaves, making it difficult to effectively identify and automatically detect abnormal phenotypes of leaves, affecting the ornamental value of ginkgo and the quality of medicinal ingredients.

Method used

Using machine learning methods, automatic detection of the phenotype of Ginkgo leaf phenotype is achieved through data acquisition, contour extraction and shape matching model construction of Ginkgo leaf. Specific steps include: data preprocessing, contour extraction, construction of shape matching models and detection of abnormal phenotypes.

Benefits of technology

It realizes efficient, accurate and automatic identification of abnormal phenotypes of ginkgo leaves, reduces the time-consuming process of manually removing abnormal leaves, and improves the protection and utilization efficiency of ginkgo resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600005A_ABST
    Figure CN119600005A_ABST
Patent Text Reader

Abstract

The invention relates to a ginkgo leaf abnormal phenotype detection method, and belongs to the field of ginkgo leaf phenotype anomaly recognition. The method comprises the following steps: ginkgo leaf data acquisition: acquiring ginkgo leaf image data through a camera, and preprocessing the ginkgo leaf image data to obtain a ginkgo leaf image data set; extracting the contour of the ginkgo leaf: extracting the contour of the image in the ginkgo leaf data set by using a geodesic distance method to obtain a contour curve of the ginkgo leaf image; constructing a shape matching model: obtaining a matching cost mean value and a matching cost variance of each category of the ginkgo leaf images according to the ginkgo leaf images and the contour curves of the ginkgo leaf images; and ginkgo leaf abnormal phenotype detection: inputting a to-be-detected image in the data set into the shape matching model, and judging whether the to-be-detected image is an abnormal phenotype or not. The method can achieve the precise recognition of the abnormal phenotype of the ginkgo leaf.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of identifying abnormal phenotypes of ginkgo leaves, and in particular relates to a method for detecting abnormal phenotypes of ginkgo leaves. Background Art

[0002] Ginkgo leaves are affected by genetics, environment, nutrients and other factors, and are rich in a variety of natural active substances and nutrients. These ingredients make ginkgo leaves have a wide range of application value in the fields of medicine, cosmetics, and health care. Moreover, the morphology and characteristics of ginkgo leaves also have a certain genetic stability. If the ginkgo leaves are significantly different from normal leaves in terms of morphology, color, size, etc., it indicates that the ginkgo leaves have abnormal phenotypes. Abnormal phenotype leaves not only affect the ornamental value of ginkgo, but may also have adverse effects on the content and quality of its medicinal ingredients. Therefore, the detection of abnormal phenotypes in ginkgo leaves is of great significance for the protection, utilization and development of ginkgo resources. Most of the existing technologies analyze the causes and mechanisms of abnormal phenotypes from the perspectives of morphological observation, molecular biology technology, and physiological ecology technology, but there are few methods for directly detecting abnormal phenotypes of ginkgo. Therefore, this paper, from the perspective of machine learning, invents a ginkgo leaf phenotype detection method that can automatically detect leaves with abnormal phenotypes. Summary of the invention

[0003] In order to solve the above problems, the present invention provides a method for detecting abnormal phenotype of ginkgo leaves.

[0004] In order to achieve the above object, the present invention is implemented through the following technical solutions: In a first aspect, the present invention provides a method for detecting abnormal phenotypes of ginkgo leaves, comprising the following steps: S1. Ginkgo leaf data collection: obtain ginkgo leaf image data through a camera, and perform preprocessing to obtain a ginkgo leaf image dataset; S2. Ginkgo leaf contour extraction: Use the geodesic distance method to extract the contour of the image in the Ginkgo leaf dataset to obtain the contour curve of the Ginkgo leaf image; S3. Shape matching model construction: According to the contour curves of the ginkgo leaf image in step S1 and the ginkgo leaf image in step S2, the matching cost mean and matching cost variance of each category of the ginkgo leaf image are obtained; S4. Detection of abnormal phenotype of ginkgo leaves: The image to be detected in the dataset is input into the shape matching model to determine whether the image to be detected has an abnormal phenotype.

[0005] Further, step S1 includes: The background of the acquired ginkgo leaf images is uniformly set to white, the images are cropped into RGB images of uniform size, and the ginkgo leaf image categories are annotated; the ginkgo leaf image categories include fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves, heart-shaped leaves and deformed leaves; fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves and heart-shaped leaves are taken as normal categories, and deformed leaves are taken as abnormal categories; among them, fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves and heart-shaped leaves are each Zhang, deformed leaves Zhang, and obtained the Ginkgo leaf image dataset.

[0006] Furthermore, step S2 specifically includes: S21. Ginkgo leaf images in the dataset Perform grayscale transformation to obtain a grayscale image , the formula is as follows: , in, Refers to images respectively The corresponding R, G, B channels; S22. Grayscale image Perform median filtering to denoise and obtain the denoised grayscale image , the formula is as follows: , in, represents the median operation, Refers to the window size of the median filter, which is set to 3x3 here, (x, y) represents the pixel point in the grayscale image. Represents the pixel point when (x, y) slides along the window W. M refers to the length of the grayscale image, and N refers to the width of the grayscale image.

[0007] S23. Denoised grayscale image Perform histogram equalization to obtain a grayscale image with enhanced contrast , the formula is as follows: = , in, Represents the denoised image The histogram of express The number of gray levels, , Indicates that the number of gray levels is 256. represents the total pixels in the image, ; S24. The contrast-enhanced grayscale image Outline the contour to get the contour curve .

[0008] Further, step S24 specifically includes: S241. Constructing graph structure G: grayscale image after contrast enhancement Building a graph structure , V represents the node set, the grayscale image after contrast enhancement Each pixel Corresponding to a node in the graph structure G , , construct weighted edges based on the 4-connectivity of pixels: , the weight is defined as the gray value difference between adjacent pixels, express 4-connected adjacent pixels, Represents a grayscale image after contrast enhancement Located in The gray value of the pixel at the position; S242. Calculate geodesic distance: Contrast enhanced grayscale image The first 0 value point in is set as the starting point , , Represents the node of the first zero-value point in the graph structure G, defines a geodesic distance queue dist, and sets the starting point Add to the queue and set its distance to 0. Set the distances of other nodes to infinity. When the geodesic distance queue is not empty, take out the node with the smallest distance from the geodesic distance queue. , update the path length of each adjacent node, the formula is as follows: , When the updated Smaller than currently known , then Add the geodesic distance queue and iterate until the geodesic distance queue is empty. Finally, dist will contain the shortest path length from the starting point to each pixel in the image, and the geodesic distance is obtained. S243. Setting threshold , traverse each pixel in dist, if the geodesic distance value is greater than the threshold, the pixel is a boundary point, otherwise, the pixel is considered an internal point; create a mask image , mask image The mask image includes boundary points and internal points, the boundary points are marked as 1, and the internal points are set to 0. The grayscale image after contrast enhancement is obtained by Hough transform The contour curve , the formula is as follows: .

[0009] Further, step S3 includes: S31. Template construction: Select four types of ginkgo leaf images in the normal class of the dataset: fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves, and heart-shaped leaves. Zhang, by manually drawing its shape and extracting the ginkgo leaf as an independent image region, flipping the leaves uniformly so that the petiole faces downward, a total of templates, each category has templates; S32. Obtain the contour curves of all templates through step S2, traverse the templates in step S31, and record the contour curve of the kth template in the cth category as , the selected 4 types of ginkgo leaf images The extracted contour curve is recorded as ,calculate and The overall matching cost between is expressed as follows: , , in, , Respectively and The point in and Respectively and The maximum value of the boundary point, Indicate point ( and Point The matching cost value between express and The overall matching cost between them; traverse each template and calculate the overall average matching cost between each type of template and the corresponding image contour curve of that category And the matching cost variance , the formula is as follows: , , in, represents the cth category of the ginkgo leaf image selected in step S31 images, represents the overall average matching cost between the c-th category template and the corresponding image contour curve of this category, Represents the matching cost variance between the c-th category template and the corresponding image contour curve of this category.

[0010] Further, in step S3, the four types of ginkgo leaf images, namely, fan-shaped leaf, wedge-shaped leaf, wishful-shaped leaf and heart-shaped leaf, remaining in the data set after step S31 are selected. Zhang, traverse the remaining ginkgo leaf images in the cth category images, calculate the c-th category The image and the image belonging to the cth category obtained in step S31 The average matching cost between templates and variance , the formula is as follows: , , in, Represents the remaining ginkgo leaf images of the categories images, represents the ginkgo leaf image category, , They represent fan-shaped leaves, wedge-shaped leaves, wish-shaped leaves, and heart-shaped leaves respectively; represents the mean matching cost of the cth category of the remaining ginkgo leaf image after step S31, represents the matching cost variance of the cth category of the ginkgo leaf image remaining after step S31.

[0011] Furthermore, step S4 specifically includes: For the image to be detected , randomly select one template from each of the four types of templates and calculate the image to be detected Matching cost with 4 templates ,in Indicated in A template randomly selected from each category, express The contour curve of and If the value of The value of - , + ], then it is determined is the normal class, otherwise, it is an abnormal phenotype.

[0012] In a second aspect, a device for detecting abnormal phenotype of ginkgo leaves comprises: Data acquisition unit: used to obtain ginkgo leaf image data and pre-process the image data; Contour extraction unit: used to extract the contour of the ginkgo leaf image using the geodesic distance method to obtain the contour curve of the ginkgo leaf image; Shape matching model construction: used to obtain the matching cost mean and matching cost variance of each category of the ginkgo leaf image based on the ginkgo leaf image and the contour curve of the ginkgo leaf image; Abnormal phenotype detection unit: used to input the image to be detected into the shape matching model to determine whether the image to be detected is an abnormal phenotype.

[0013] In a third aspect, an electronic device comprises: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the above-mentioned method for detecting abnormal phenotype of ginkgo leaves is performed.

[0014] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting abnormal phenotype of ginkgo leaves is executed.

[0015] The advantages of the present invention are: The present invention designs a Ginkgo leaf phenotype anomaly detection algorithm, which realizes the complete segmentation between the background and the outline of the Ginkgo leaf by extracting the complete outline of the Ginkgo leaf using the geodesic distance, and then solves the problem of insufficient data volume of the traditional single-type template by constructing multiple types of Ginkgo leaf templates, and finally, by defining the matching cost value and the overall matching cost mean, constructs a normal class template to realize the recognition of abnormal phenotypes, and solves the problem that there are too many types of abnormal phenotypes and it is impossible to reasonably define and extract abnormal phenotype templates. The automatic recognition of abnormal phenotypes of Ginkgo leaves is realized efficiently and accurately, and the time-consuming problem of manually removing abnormal leaves when Ginkgo leaves are used for medicinal purposes is effectively solved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0017] Figure 1 is a flow chart of the method of the present invention; Figure 2 It is the effect diagram of the method of the present invention. DETAILED DESCRIPTION

[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0019] Example 1 In this embodiment, Figure 1 As shown, the present invention provides a method for detecting abnormal phenotype of ginkgo leaves, and the specific steps include: S1. Ginkgo leaf data collection: obtain ginkgo leaf image data through a camera, and perform preprocessing to obtain a ginkgo leaf image dataset; Specifically, during data collection, we first randomly selected 10 trees from the 100 mature ginkgo trees in the sampling site, took mature leaves that were intact and fully expanded on the crown of each tree, took pictures with a digital camera, set the background of the acquired ginkgo leaf images to white, and cropped the images to RGB images with a length of M=260 and a width of N=400, and labeled the ginkgo leaf image categories; the ginkgo leaf image categories include fan-shaped leaves, wedge-shaped leaves, ruyi-shaped leaves, heart-shaped leaves and deformed leaves; fan-shaped leaves, wedge-shaped leaves, ruyi-shaped leaves, and heart-shaped leaves were taken as normal classes, and deformed leaves were taken as abnormal classes; among them, there were 100 fan-shaped leaves, 100 wedge-shaped leaves, ruyi-shaped leaves, and heart-shaped leaves, and 600 deformed leaves, resulting in a ginkgo leaf image dataset with 1000 ginkgo leaf images.

[0020] S2. Ginkgo leaf contour extraction: Use the geodesic distance method to extract the contour of the image in the Ginkgo leaf dataset to obtain the contour curve of the Ginkgo leaf image; Specifically, S21. The ginkgo leaf images in the dataset Perform grayscale transformation to obtain a grayscale image , the formula is as follows: , in, Refers to images respectively The corresponding R, G, B channels; S22. Grayscale image Perform median filtering to denoise and obtain the denoised grayscale image , the formula is as follows: , in, represents the median operation, Refers to the window size of the median filter, which is set to 3x3 here, (x, y) represents the pixel point in the grayscale image. Represents the pixel point when (x, y) slides along the window W. M refers to the length of the grayscale image, and N refers to the width of the grayscale image.

[0021] S23. Denoised grayscale image Perform histogram equalization to obtain a grayscale image with enhanced contrast , the formula is as follows: = , in, Represents the denoised image The histogram of express The number of gray levels, , Indicates that the number of gray levels is 256. represents the total pixels in the image, ; S24. The contrast-enhanced grayscale image Outline the contour to get the contour curve .

[0022] Specifically, step S24 includes: S241. Constructing graph structure G: grayscale image after contrast enhancement Building a graph structure , V represents the node set, the grayscale image after contrast enhancement Each pixel Corresponding to a node in the graph structure G , , construct weighted edges based on the 4-connectivity of pixels: , the weight is defined as the gray value difference between adjacent pixels, express 4-connected adjacent pixels, Represents a grayscale image after contrast enhancement Located in The gray value of the pixel at the position; S242. Calculate geodesic distance: Contrast enhanced grayscale image The first 0 value point in is set as the starting point , , Represents the node of the first zero-value point in the graph structure G, defines a geodesic distance queue dist, and sets the starting point Add to the queue and set its distance to 0. Set the distances of other nodes to infinity. When the geodesic distance queue is not empty, take out the node with the smallest distance from the geodesic distance queue. , update the path length of each adjacent node, the formula is as follows: , When the updated Smaller than currently known , then Add the geodesic distance queue and iterate until the geodesic distance queue is empty. Finally, dist will contain the shortest path length from the starting point to each pixel in the image, and the geodesic distance is obtained. S243. Setting threshold , traverse each pixel in dist, if the geodesic distance value is greater than the threshold, the pixel is a boundary point, otherwise, the pixel is considered an internal point; create a mask image , mask image The mask image includes boundary points and internal points, the boundary points are marked as 1, and the internal points are set to 0. The grayscale image after contrast enhancement is obtained by Hough transform The contour curve , the formula is as follows: .

[0023] S3. Shape matching model construction: According to the contour curves of the ginkgo leaf image in step S1 and the ginkgo leaf image in step S2, the matching cost mean and matching cost variance of each category of the ginkgo leaf image are obtained; Specifically, S31. construct templates: select 50 images of four types of ginkgo leaf images, namely, fan-shaped leaf, wedge-shaped leaf, wishful-shaped leaf and heart-shaped leaf, from the normal class of the data set, manually draw their morphology and extract the ginkgo leaf as an independent image region, and uniformly flip the leaves so that the petioles face downwards, generating a total of 200 templates, with 50 templates for each category; S32. Obtain the contour curves of all templates through step S2, traverse the templates in step S31, and record the contour curve of the kth template in the cth category as , the selected 4 types of ginkgo leaf images The extracted contour curve is recorded as ,calculate and The overall matching cost between is expressed as follows: , , in, , Respectively and The point in and Respectively and The maximum value of the boundary point, Indicate point ( and Point The matching cost value between express and The overall matching cost between them; traverse each template and calculate the overall average matching cost between each type of template and the corresponding image contour curve of that category And the matching cost variance, the formula is as follows: , , in, represents the overall average matching cost between the c-th category template and the corresponding image contour curve of this category, Represents the matching cost variance between the c-th category template and the corresponding image contour curve of this category.

[0024] S33. Select 50 images of each of the four categories of ginkgo leaf images, namely, fan-shaped leaf, wedge-shaped leaf, wishful leaf, and heart-shaped leaf, remaining in the data set after step S31, traverse the remaining 50 images of the cth category of ginkgo leaf images, and calculate the average matching cost between the 50 images in the cth category and the 50 templates belonging to the cth category obtained in step S31. and variance , the formula is as follows: , , in, Represents the remaining ginkgo leaf images of the categories images, represents the ginkgo leaf image category, , They represent fan-shaped leaves, wedge-shaped leaves, wish-shaped leaves, and heart-shaped leaves respectively; represents the mean matching cost of the cth category of the remaining ginkgo leaf image after step S31, represents the matching cost variance of the cth category of the ginkgo leaf image remaining after step S31.

[0025] S4. Detection of abnormal phenotype of ginkgo leaves: The image to be detected in the dataset is input into the shape matching model to determine whether the image to be detected has an abnormal phenotype.

[0026] Specifically, for the image to be detected , randomly select one template from each of the four types of templates and calculate the image to be detected Matching cost with 4 templates ,in Indicated in A template randomly selected from each category, express The contour curve of and If the value of The value of - , + ], then it is determined is the normal class, otherwise, it is an abnormal phenotype.

[0027] Example 2 In this embodiment, Figure 2 The effect and process of the method proposed in the present invention are illustrated by comparing the template shape of the fan-shaped ginkgo leaf with the normal and abnormal phenotypes. First, for the image to be detected 1 and the image to be detected 2, the contour extraction algorithm is applied respectively to obtain the extracted contours, and then the template matching detection is performed between the image and the fan-shaped template of the normal class to obtain the matching cost values ​​respectively, which are compared with the overall matching mean and variance obtained on the fan-shaped category to draw a conclusion on whether it is an abnormal phenotype. The red font "non-abnormal phenotype" is the detection result of the image to be detected 1, and the blue font "abnormal phenotype" is the detection result of the image to be detected 2.

[0028] Example 3 This embodiment provides a device for detecting abnormal phenotypes of ginkgo leaves, comprising: Data acquisition unit: used to obtain ginkgo leaf image data and pre-process the image data; Contour extraction unit: used to extract the contour of the ginkgo leaf image using the geodesic distance method to obtain the contour curve of the ginkgo leaf image; Shape matching model construction: used to obtain the matching cost mean and matching cost variance of each category of the ginkgo leaf image based on the ginkgo leaf image and the contour curve of the ginkgo leaf image; Abnormal phenotype detection unit: used to input the image to be detected into the shape matching model to determine whether the image to be detected is an abnormal phenotype.

[0029] Example 4 This embodiment provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the above-mentioned method for detecting abnormal phenotype of ginkgo leaves is executed.

[0030] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0031] Example 5 This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned method for detecting abnormal phenotype of ginkgo leaves is executed.

[0032] Storage media include: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks, and other media that can store programs.

[0033] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for detecting abnormal phenotype of ginkgo leaves, characterized in that: The following steps are involved: S1. Ginkgo leaf data collection: obtain ginkgo leaf image data through a camera, and perform preprocessing to obtain a ginkgo leaf image dataset; S2. Ginkgo leaf contour extraction: Use the geodesic distance method to extract the contour of the image in the Ginkgo leaf dataset to obtain the contour curve of the Ginkgo leaf image; S3. Shape matching model construction: According to the contour curves of the ginkgo leaf image in step S1 and the ginkgo leaf image in step S2, the matching cost mean and matching cost variance of each category of the ginkgo leaf image are obtained; S4. Detection of abnormal phenotype of ginkgo leaves: The image to be detected in the dataset is input into the shape matching model to determine whether the image to be detected has an abnormal phenotype.

2. The method for detecting abnormal phenotype of ginkgo leaf according to claim 1, characterized in that: Step S1 specifically includes: The background of the acquired ginkgo leaf images is uniformly set to white, the images are cropped into RGB images of uniform size, and the ginkgo leaf image categories are annotated; the ginkgo leaf image categories include fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves, heart-shaped leaves and deformed leaves; fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves and heart-shaped leaves are taken as normal categories, and deformed leaves are taken as abnormal categories; among them, fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves and heart-shaped leaves are each Zhang, deformed leaves Zhang, and obtained the Ginkgo leaf image dataset.

3. A method for detecting abnormal phenotype of ginkgo leaf according to claim 2, characterized in that: Step S2 specifically includes: S21. Ginkgo leaf images in the dataset Perform grayscale transformation to obtain a grayscale image , the formula is as follows: , in, Refers to images respectively The corresponding R, G, B channels; S22. Grayscale image Perform median filtering to denoise and obtain the denoised grayscale image , the formula is as follows: , in, represents the median operation, Refers to the window size of the median filter, which is set to 3x3 here, (x,y) represents the pixel point in the grayscale image, represents the pixel point when (x, y) slides along the window W, M represents the length of the grayscale image, and N represents the width of the grayscale image; S23. Denoised grayscale image Perform histogram equalization to obtain a grayscale image with enhanced contrast , the formula is as follows: = , in, Represents the denoised image The histogram of express The number of gray levels, , Indicates that the number of gray levels is 256. represents the total pixels in the image, ; S24. The contrast-enhanced grayscale image Outline the contour to get the contour curve .

4. A method for detecting abnormal phenotype of ginkgo leaf according to claim 3, characterized in that: Step S24 specifically includes: S241. Constructing graph structure G: grayscale image after contrast enhancement Building a graph structure , V represents the node set, the grayscale image after contrast enhancement Each pixel Corresponding to a node in the graph structure G , , construct weighted edges based on the 4-connectivity of pixels: , the weight is defined as the gray value difference between adjacent pixels, express 4-connected adjacent pixels, Represents a grayscale image after contrast enhancement Located in The gray value of the pixel at the position; S242. Calculate geodesic distance: Contrast enhanced grayscale image The first 0 value point in is set as the starting point , , Represents the node of the first zero-value point in the graph structure G, defines a geodesic distance queue dist, and sets the starting point Add to the queue and set its distance to 0. Set the distances of other nodes to infinity. When the geodesic distance queue is not empty, take out the node with the smallest distance from the geodesic distance queue. , update the path length of each adjacent node, the formula is as follows: , When the updated Smaller than currently known , then Add the geodesic distance queue and iterate until the geodesic distance queue is empty. Finally, dist will contain the shortest path length from the starting point to each pixel in the image, and the geodesic distance is obtained. S243. Setting threshold , traverse each pixel in dist, if the geodesic distance value is greater than the threshold, the pixel is a boundary point, otherwise, the pixel is considered an internal point; create a mask image , mask image The mask image includes boundary points and internal points, the boundary points are marked as 1, and the internal points are set to 0. The grayscale image after contrast enhancement is obtained by Hough transform The contour curve , the formula is as follows: 。 5. A method for detecting abnormal phenotype of ginkgo leaf blades according to claim 4, characterized in that: Step S3 specifically includes: S31. Template construction: Select four types of ginkgo leaf images in the normal class of the dataset: fan-shaped leaves, wedge-shaped leaves, wish-fulfilling leaves, and heart-shaped leaves. Zhang, by manually drawing its shape and extracting the ginkgo leaf as an independent image region, flipping the leaves uniformly so that the petiole faces downward, a total of templates, each category has templates; S32. Obtain the contour curves of all templates through step S2, traverse the templates in step S31, and record the contour curve of the kth template in the cth category as , the selected 4 types of ginkgo leaf images The extracted contour curve is recorded as ,calculate and The overall matching cost between is expressed as follows: , , in, , Respectively and The point in and Respectively and The maximum value of the boundary point, Indicate point ( and Point The matching cost value between express and The overall matching cost between them; traverse each template and calculate the overall average matching cost between each type of template and the corresponding image contour curve of that category And the matching cost variance , the formula is as follows: , , in, represents the cth category of the ginkgo leaf image selected in step S31 images, represents the overall average matching cost between the c-th category template and the corresponding image contour curve of this category, Represents the matching cost variance between the c-th category template and the corresponding image contour curve of this category.

6. A method for detecting abnormal phenotype of ginkgo leaf blades according to claim 5, characterized in that: Step S3 also includes: Select the remaining fan-shaped leaves, wedge-shaped leaves, wishful-shaped leaves and heart-shaped leaves in the data set after step S31. Zhang, traverse the remaining ginkgo leaf images in the cth category images, calculate the c-th category The image and the image belonging to the cth category obtained in step S31 The average matching cost between templates and variance , the formula is as follows: , , in, Represents the remaining ginkgo leaf images of the categories images, represents the ginkgo leaf image category, , They represent fan-shaped leaves, wedge-shaped leaves, wish-shaped leaves, and heart-shaped leaves respectively; represents the mean matching cost of the cth category of the remaining ginkgo leaf image after step S31, represents the matching cost variance of the cth category of the ginkgo leaf image remaining after step S31.

7. A method for detecting abnormal phenotype of ginkgo leaf leaves according to claim 6, characterized in that: Step S3 also includes: For the image to be detected , randomly select one template from each of the four types of templates and calculate the image to be detected Matching cost with 4 templates ,in Indicated in A template randomly selected from each category, express The contour curve of and If the value of The value of - , + ], then it is determined is the normal class, otherwise, it is an abnormal phenotype.

8. A device for detecting abnormal phenotype of ginkgo leaves, characterized in that: include: Data acquisition unit: used to obtain ginkgo leaf image data and pre-process the image data; Contour extraction unit: used to extract the contour of the ginkgo leaf image using the geodesic distance method to obtain the contour curve of the ginkgo leaf image; Shape matching model construction: used to obtain the matching cost mean and matching cost variance of each category of the ginkgo leaf image based on the ginkgo leaf image and the contour curve of the ginkgo leaf image; Abnormal phenotype detection unit: used to input the image to be detected into the shape matching model to determine whether the image to be detected is an abnormal phenotype.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, a method for detecting abnormal phenotypes of ginkgo leaves as described in any one of claims 1 to 7 is executed.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting abnormal phenotype of ginkgo leaves according to any one of claims 1 to 7 is executed.

Citation Information

Patent Citations

  • DLLE model-based data dimension reduction and characteristic understanding method

    CN106127112A

  • Method and system for detecting to-be-detected object

    CN109978829A

  • Method for quickly screening massive power defect photos based on template matching

    CN111126431A

  • Construction method of leaf image recognition model

    CN111860567A

  • Method and system for detecting whether part is missing or not under condition of uneven illumination

    CN115587966A

Cited By

  • Garden plant health intelligent monitoring system based on image recognition

    CN121392579A

  • Intelligent monitoring system for health of garden plants based on image recognition

    CN121392579B