Methods, apparatus, equipment and media for obtaining the tip shape phenotype of plate-bladed blades
By quantifying the tip shape phenotype of plate blades using image processing technology, the problems of low efficiency and low accuracy in DUS testing are solved, and efficient and accurate phenotypic parameter acquisition is achieved.
Patent Information
- Application Number
- CN202410845534.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2044-06-27
AI Technical Summary
In the DUS test of new leafy vegetable varieties with broad leaves, the phenotypic parameters of leaf tip shape are difficult to measure manually due to low efficiency and accuracy, and the subjective judgment bias is large.
By acquiring leaf images, performing preprocessing, edge detection, contour extraction, and ellipse fitting, and utilizing the mapping relationship between eccentricity and tip shape phenotype, the tip shape phenotype of the leaf can be quantified.
It improves the efficiency and accuracy of blade phenotypic information collection and analysis, and provides digital phenotypic indicators to support DUS testing.
Smart Images

Figure CN118865108B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image recognition technology, and more specifically, to a method, apparatus, device, and medium for obtaining the tip shape phenotype of a blade. Background Technology
[0002] Plant variety testing (DUS testing) is the process of conducting cultivation identification tests or indoor analytical tests to assess the distinctiveness, uniformity, and stability of plant varieties for which protection is sought. Based on the results of these tests, it is determined whether the tested variety is a new variety, providing a reliable basis for plant variety protection.
[0003] However, in the DUS test of new leafy vegetable varieties, such as non-heading Chinese cabbage varieties, many phenotypic parameters are measured and judged manually. However, due to the large number of test samples, the test efficiency is low. In addition, the judgment of some descriptive parameters, such as tip shape, is subject to large subjective judgment bias between different people, resulting in low accuracy of DUS test results and a high degree of subjective judgment.
[0004] Therefore, there is an urgent need to study a method, device, equipment, and medium for obtaining the tip shape phenotype of plate-bladed blades. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide a method, apparatus, device and medium for obtaining the tip shape phenotype of blades, so as to improve the efficiency and accuracy of obtaining the tip shape phenotype of blades.
[0006] Firstly, a method for obtaining the tip shape phenotype of a blade is provided, including:
[0007] Acquire raw images of the target leaf;
[0008] The original image is preprocessed to obtain a preprocessed image;
[0009] Edge detection is performed on the preprocessed image to obtain the edge detection image of the target blade;
[0010] The contour image of the target blade is obtained by contour extraction processing based on the edge detection image;
[0011] Ellipse fitting is performed on the contour in the contour image to obtain the fitted ellipse of the target blade.
[0012] The tip shape phenotype of the target blade is determined based on the eccentricity of the fitted ellipse and the preset mapping relationship between the eccentricity and the tip shape phenotype.
[0013] Optionally, preprocessing the original image to obtain a preprocessed image includes:
[0014] The original image is processed to obtain a grayscale image;
[0015] A preprocessed image is obtained by denoising a grayscale image using a preset convolution kernel.
[0016] Optionally, the preset convolution kernel is a 3*3 convolution kernel [1, 2, 1]*[2, 8, 2]*[1, 2, 1].
[0017] Optionally, edge detection is performed on the preprocessed image to obtain the edge detection image of the target blade, including:
[0018] Construct a Sobel operator in the horizontal and vertical directions respectively;
[0019] The horizontal and vertical gradient values of each pixel are calculated using two Sobel operators.
[0020] The gradient intensity and gradient direction of each pixel are calculated based on the horizontal and vertical gradient values.
[0021] The pixel with the largest gradient intensity in each gradient direction is selected as the edge point to obtain the initial set of edge points of the target blade;
[0022] The edge points in the initial edge point set are filtered to obtain the final edge point set and the corresponding edge detection image.
[0023] Optionally, filtering the edge points in the initial set of edge points includes:
[0024] The gradient strength of the edge points in the initial set of edge points is compared with the preset gradient threshold range by traversing the data.
[0025] If the edge point exceeds the lower limit of the preset gradient threshold range, then delete the edge point.
[0026] If the value exceeds the upper limit of the preset gradient threshold range, it is marked as a strong edge point and retained.
[0027] If the value falls within the preset gradient threshold range, it is marked as a virtual edge point.
[0028] Determine whether each virtual edge point is connected to at least one strong edge point. If they are connected, keep the edge point; otherwise, delete it.
[0029] Optionally, the edge detection image includes multiple contours, and the contour extraction processing based on the edge detection image yields the contour image of the target blade, including:
[0030] The total number of pixels for each contour in the image after edge detection;
[0031] The contour with the largest total number of pixels is determined as the contour of the target blade, and the contour image of the target blade is obtained.
[0032] Optionally, ellipse fitting is performed on the contour in the contour image to obtain the fitted ellipse of the target leaf, including:
[0033] Construct pixel coordinates for each pixel in the contour image;
[0034] The leftmost and rightmost points of the blade outline are determined based on pixel coordinates;
[0035] Get the pixel coordinates on the tip contour between the leftmost and rightmost points and store them in a preset linked list;
[0036] Input the pixel coordinates in the preset linked list into the pre-constructed general equation of the ellipse to obtain the parameters of the fitted ellipse;
[0037] The fitted ellipse is drawn based on the parameters of the fitted ellipse.
[0038] Secondly, a device for acquiring the tip shape phenotypic profile of a blade is provided, comprising:
[0039] The acquisition unit is used to acquire raw images of the target blade;
[0040] The preprocessing unit is used to preprocess the original image to obtain a preprocessed image;
[0041] The edge detection unit is used to perform edge detection on the preprocessed image to obtain the edge detection image of the target blade;
[0042] The contour extraction unit is used to perform contour extraction processing based on the edge detection image to obtain the contour image of the target blade;
[0043] Ellipse fitting unit is used to perform ellipse fitting on the contour in the contour image to obtain the fitted ellipse of the target leaf.
[0044] A determination unit is used to determine the tip shape phenotype of the target blade based on the eccentricity of the fitted ellipse.
[0045] Thirdly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0046] Memory, used to store computer programs;
[0047] A processor, when executing a program stored in memory, implements any of the method steps of the first aspect.
[0048] Fourthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, it implements any of the method steps of the first aspect.
[0049] This invention provides a method, apparatus, device, and medium for acquiring the tip shape phenotype of a blade. The invention acquires an original image of the target blade using image processing technology; preprocesses the original image to obtain a preprocessed image; performs edge detection on the preprocessed image to obtain an edge-detected image of the target blade; performs contour extraction processing on the edge-detected image to obtain a contour image of the target blade; performs ellipse fitting on the contour in the contour image to obtain a fitted ellipse of the target blade contour; and determines the tip shape phenotype of the target blade based on the eccentricity of the fitted ellipse and a preset mapping relationship between the eccentricity and the tip shape phenotype. This invention uses eccentricity, a digital phenotypic index, to quantify the tip shape phenotype, which was originally only qualitatively describable, thus improving the efficiency and accuracy of blade phenotypic information acquisition and analysis in DUS testing.
[0050] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0051] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 A flowchart of the method for obtaining the tip shape phenotype of a blade provided in an embodiment of the present invention is shown;
[0053] Figure 2 This diagram illustrates the gradient direction of a pixel as provided in an embodiment of the present invention.
[0054] Figure 3 This diagram illustrates the division of strong edge points and virtual edge points according to an embodiment of the present invention.
[0055] Figure 4 A schematic diagram of an edge detection image provided in an embodiment of the present invention is shown;
[0056] Figure 5 A contour image diagram provided in an embodiment of the present invention is shown;
[0057] Figure 6 This diagram illustrates the blade shape phenotypic grading provided in an embodiment of the present invention.
[0058] Figure 7 This is a schematic diagram of the structure of the blade tip shape phenotype acquisition device provided in an embodiment of the present invention;
[0059] Figure 8 A schematic diagram of the electronic device structure provided in an embodiment of the present invention is shown. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0061] This application provides a method for obtaining the tip shape phenotype of a blade, such as... Figure 1 As shown, it includes the following steps:
[0062] Step S101: Acquire the original image of the target blade.
[0063] In this embodiment, the target leaf refers to the leaf of a new variety of leafy vegetable with broad leaves, such as the leaf of non-heading Chinese cabbage. Non-heading Chinese cabbage is a leafy vegetable native to China, known for its tender green, non-heading leaves. The plant is small yet highly adaptable, with a wide suitable temperature range for growth and strong cold resistance, and is widely cultivated in China and other regions. Its leaves are crisp and tender, with a refreshing taste, and are rich in vitamins and minerals, making it one of the most popular vegetables worldwide. As an important vegetable in agricultural production, breeders have conducted in-depth research on the development patterns of non-heading Chinese cabbage, optimizing breeding strategies by observing its phenotypic traits. They have also used gene mining and gene editing to improve the genes of non-heading Chinese cabbage, resulting in richer nutritional components and stronger growth adaptability.
[0064] In one example, new varieties of non-heading Chinese cabbage include Suzhou Green, Violet, and Heat-resistant 605.
[0065] In this embodiment of the application, images of the harvested leaves can be captured using a digital camera or other image acquisition devices.
[0066] Step S102: Preprocess the original image to obtain a preprocessed image.
[0067] In this embodiment of the application, preprocessing the original image to obtain a preprocessed image includes the following steps:
[0068] Step S1021: Perform grayscale processing on the original image to obtain a grayscale image.
[0069] In one example, the R (Red), G (Green), and B (Blue) values of each pixel in the original image are first obtained. Then, the pixel value of each pixel is processed into a grayscale value using the grayscale formula GRAY = 0.299*R + 0.587*G + 0.114*B, thus obtaining a grayscale image.
[0070] Step S1022: Use a preset convolution kernel to denoise the grayscale image to obtain a preprocessed image.
[0071] Convolution is a commonly used operation in image processing, applied to tasks such as image filtering, edge detection, and feature extraction. In image denoising, convolution can filter images using convolution kernels to remove noise.
[0072] Specifically, the basic idea of convolutional denoising is to use a convolution kernel to perform a convolution operation on an image, thereby smoothing out noise in the image. A convolution kernel is typically a small matrix containing weights used to smooth the image. By performing a convolution operation on the image, each pixel in the image is compared with its surrounding pixels, and a new pixel value is calculated based on the weights in the convolution kernel. This process effectively smooths the image and removes noise.
[0073] Here is a simple example code for implementing convolutional denoising using Python and the OpenCV library:
[0074] Python
[0075] import cv2
[0076] import numpy as np
[0077] #Read image
[0078]
[0079] In this example code, a grayscale image is first read, and then a convolution kernel is defined. This kernel is a 3x3 matrix containing weights used to smooth the image. Next, the image is convolved using the `cv2.filter2D()` function, and the result is stored in the `dst` variable. Finally, the `cv2.imshow()` function is used to display the images before and after denoising.
[0080] It is important to note that the effectiveness of convolutional denoising depends on the design of the convolution kernel. Different convolution kernels can produce different denoising effects. Therefore, the preset convolution kernel in this embodiment is set to a 3*3 convolution kernel [1, 2, 1]*[2, 8, 2]*[1, 2, 1]. Verification has shown that it has a significant denoising effect on leaf-shaped images.
[0081] Step S103: Perform edge detection on the preprocessed image to obtain the edge detection image of the target blade.
[0082] In this embodiment, edge detection can be performed using the Sobel edge detection algorithm. Since the Sobel operator is sensitive to noise, the original image is smoothed through the above step S1022 before using the Sobel operator for edge detection, so as to provide high-quality image support for subsequent edge detection.
[0083] In one embodiment, obtaining an edge detection image of the target leaf by performing edge detection on the preprocessed image includes the following steps:
[0084] Step S1031: Construct a Sobel operator in the horizontal and vertical directions respectively.
[0085] In this step, the horizontal direction X is, for example, P. x ([-1, 0, 1][-2, 0, 2][-1, 0, 1]), where the vertical direction Y is, for example, P. y ([1, 2, 1][0, 0, 0][-1, -2, -1]).
[0086] Step S1032: Calculate the horizontal and vertical gradient values of each pixel using two Sobel operators.
[0087] In this step, a window of the same size as the Sobel operator matrix is first constructed. For example, if the Sobel operator is a 3*3 matrix, then a 3*3 window is constructed accordingly. The window is moved along the horizontal X direction and the vertical Y direction to obtain the horizontal gradient value and the vertical gradient value of each pixel.
[0088] In one example, to calculate the gradient value of pixel e, we first construct a 3x3 moving window B([a, b, c][d, e, f][g, h, i]). Then, we convolve this window B with the Sobel operators in both directions to obtain the horizontal gradient value A_X and the vertical gradient value AY of pixel e. The convolution formula is as follows:
[0089]
[0090] Step S1033: Calculate the gradient intensity and gradient direction of each pixel based on the horizontal and vertical gradient values.
[0091] In this step, the gradient intensity A can be calculated using the following equation 3:
[0092]
[0093] Where AX and AY are the gradient values in the horizontal and vertical directions, respectively. The more drastic the edge change, the larger the value of A.
[0094] In this embodiment of the application, the gradient direction can be calculated using the following formula 4:
[0095] θ = arctan(AY / AX) Equation 4;
[0096] After calculating the gradient direction for each pixel, multiple pixels will have the same gradient direction, such as... Figure 2 As shown, points d, e, and f have the same gradient direction, and this gradient direction is perpendicular to the edge.
[0097] Step S1034: Select the pixel with the largest gradient intensity in each gradient direction as the edge point to obtain the initial edge point set of the target blade.
[0098] In this embodiment, the gradient intensity of each pixel can be compared with the gradient intensity of its left and right adjacent pixels in each gradient direction to select the pixel with the largest gradient intensity. In a specific example, using... Figure 2 For example, along the gradient θ direction, the gradient strength of pixel e is compared with that of pixels d and f on either side. If the gradient strength is the largest, it is retained; otherwise, it is set to 0. The same method is used to determine whether points d and f need to be retained. In this way, a large number of points that are not edges can be eliminated.
[0099] Step S1035: Filter the edge points in the initial edge point set to obtain the final edge point set and the edge detection image corresponding to the final edge point set.
[0100] Although step S1034 above can remove most non-edge points, some non-edge points and noise points will still exist. Therefore, further filtering can further refine the edges.
[0101] Specifically, filtering edge points in the initial set of edge points includes:
[0102] The first step is to compare the gradient strength of the edge points in the initial set of edge points with the preset gradient threshold range by traversing the set.
[0103] In this step, two gradient thresholds are first set, for example, an upper threshold of 100 and a lower threshold of 50, with a gradient threshold range of [50, 100]. Each gradient value in the initial set of edge points is compared with this gradient threshold range [50, 100] to determine the attributes of the edge. The attribute determination is detailed in the subsequent steps.
[0104] The second step is to delete the edge point if it exceeds the lower limit of the preset gradient threshold range.
[0105] In one example, if the gradient strength of an edge point is 30, which is less than the lower threshold of 50, then the edge attribute is not an edge point, and the pixel of that edge point is set to 0.
[0106] The third step is to mark any point that exceeds the upper limit of the preset gradient threshold range as a strong edge point and retain it.
[0107] In one example, if the gradient strength of an edge point is 120, then the edge attribute is a strong edge point. A strong edge point must be a true edge point, so it needs to be retained.
[0108] The fourth step is to mark the point as a virtual edge if it falls within the preset gradient threshold range.
[0109] In one example, if the gradient value of an edge point is 80, then the edge attribute is a dummy edge point. These dummy edge points may be generated from the real image or due to noise. Dummy edge points generated by noise must be removed, so step five further processes the dummy edge points to remove noise points.
[0110] The fifth step is to determine whether each virtual edge point is connected to at least one strong edge point. If they are connected, they are retained; otherwise, the edge point is deleted.
[0111] After the first to fourth steps of screening, several strong edge points and several virtual edge points will be obtained. For each virtual edge point, as long as it is connected to at least one strong edge point, it will be processed as an edge point; otherwise, the pixel of the point will be set to 0, so as to achieve the purpose of eliminating noise points.
[0112] To determine whether virtual edge points and strong edge points are connected, we can check whether they are spatially adjacent and whether their gradient directions are similar or consistent. If virtual edge points and strong edge points are spatially adjacent and their gradient directions are similar or consistent, they can be considered connected.
[0113] In one example, such as Figure 3 As shown, the gradient strength value of point a is greater than 100, therefore a is a strong edge point. The gradient strength value of point d is less than 50, so the pixel value of d is set to 0. The gradient strength values of points b and c are between 50 and 100, therefore b and c are virtual edge points. Although the gradient strength value of point b is between 50 and 100, this point is not connected to the strong edge point a, so its pixel value is set to 0. The gradient value of point c is between 50 and 100, and this point is connected to the strong edge point a, so it is retained.
[0114] After the above steps S103-S104, the edge detection image is obtained, such as Figure 4 As shown, because the leaf has many veins, the edge detection image includes an outer contour and multiple smaller contours within the outer contour. Therefore, to determine the tip shape phenotype of the leaf, irrelevant contours on the leaf surface must be removed.
[0115] Step S104: Perform contour extraction processing based on the edge detection image to obtain the contour image of the target blade.
[0116] In this embodiment of the application, obtaining the contour image of the target blade by contour extraction processing based on the edge detection image includes:
[0117] The total number of pixels for each contour in the image after edge detection;
[0118] The contour with the largest total number of pixels is determined as the contour of the target blade, and the contour image of the target blade is obtained.
[0119] Since the outer contour is the largest, it also corresponds to the largest number of pixels. Therefore, the final contour and contour image are determined by iterating through the total number of pixels for each contour. Figure 5 As shown.
[0120] Step S105: Perform ellipse fitting on the contour in the contour image to obtain the fitted ellipse of the target blade.
[0121] In this embodiment of the application, the process of obtaining the fitted ellipse of the target leaf by ellipse fitting of the contour in the contour image includes the following steps:
[0122] Step S1051: Construct pixel coordinates for each pixel in the contour image.
[0123] In this step, the contour pixels in the contour image are traversed to form (X, Y) point pairs.
[0124] Step S1052: Determine the leftmost and rightmost points of the blade outline based on pixel coordinates.
[0125] In this step, the X values from the previous step are sorted to obtain the maximum value X. max With minimum value X min The pixel corresponding to the minimum value is the leftmost point of the target blade, and the pixel corresponding to the maximum value is the rightmost point of the target blade. That is, pixel (X... min (Y) and (X) max (Y) represents the leftmost and rightmost points of the blade profile.
[0126] Step S1053: Obtain the pixel coordinates on the tip contour between the leftmost and rightmost points and store them in a preset linked list.
[0127] In this step, a linked list is constructed, which stores data located at pixel (X). min ,Y) and (X) max The pixel pairs (X, Y) on the tip contour between X and Y are stored in a linked list List.
[0128] In this embodiment, the tip refers to the top of organs such as leaves, flowers, and fruits. Since this embodiment requires obtaining the tip shape phenotype, it is only necessary to obtain the pixel coordinates of the tip portion, thereby greatly reducing the amount of computation.
[0129] Step S1054: Input the pixel coordinates in the preset linked list into the pre-constructed general equation of the ellipse to obtain the fitting ellipse parameters.
[0130] In one example, the general equation of an ellipse is AX. 2 +BXY+CY 2 +DX+EY+F=0, where A, B, C, D, E, and F are all unknown parameters of the ellipse. The ellipse parameters A, B, C, D, E, and F are calculated by sequentially reading the (X, Y) point pairs in the linked list List.
[0131] Step S1055: Draw the fitted ellipse based on the fitted ellipse parameters.
[0132] Step S106: Determine the tip shape phenotype of the target blade based on the eccentricity of the fitted ellipse and the preset mapping relationship between the eccentricity and the tip shape phenotype.
[0133] In this step, the formula for the eccentricity of the ellipse is C = P / Q, where C is the eccentricity of the fitted ellipse, P is the focal length of the fitted ellipse, and Q is the semi-major axis of the fitted ellipse.
[0134]
[0135] Among them, C tends to be between 0 and 1. The closer C is to 1, the sharper the tip of the non-heading cabbage is; the closer C is to 0, the rounder the tip of the non-heading cabbage is.
[0136] In this embodiment, the eccentricity of the fitted ellipse is first graded according to the grading requirements for blades in the DUS test, and the eccentricity of each target blade is determined to fall within a specific grading interval. The tip shape phenotype is then determined based on a preset mapping relationship between the grading interval and the tip shape phenotype.
[0137] In one example, the eccentricity gradation interval is [0.5, 0.7], corresponding to a broad round tip shape phenotype; [0.7, 0.8] corresponds to a round tip shape phenotype; [0.8, 0.9] corresponds to a blunt tip shape phenotype; and [0.5, 0.7] corresponds to a sharp tip shape phenotype.
[0138] Therefore, by determining the range of eccentricity, the tip shape phenotype of the target blade can be determined. The various tip shape phenotypes are as follows: Figure 6 As shown.
[0139] This invention can quantify the tip shape phenotype, which was originally only qualitatively described, using new digital phenotypic indicators. Based on the quantitative indicators of the acquired tip shape phenotype, it can provide accurate data support for the DUS test of leaf varieties.
[0140] Based on the same inventive concept, a device for obtaining the tip shape phenotypic of a plate-bladed blade is provided, such as... Figure 7 As shown, it includes:
[0141] Acquisition unit 701 is used to acquire raw images of the target blade;
[0142] The preprocessing unit 702 is used to preprocess the original image to obtain a preprocessed image.
[0143] Optionally, the preprocessing unit is specifically used for:
[0144] The original image is processed to obtain a grayscale image;
[0145] A preprocessed image is obtained by denoising a grayscale image using a preset convolution kernel.
[0146] The preset convolution kernel is a 3*3 convolution kernel [1, 2, 1]*[2, 8, 2]*[1, 2, 1].
[0147] The edge detection unit 703 is used to perform edge detection on the preprocessed image to obtain the edge detection image of the target blade.
[0148] The edge detection unit 703 is specifically used for:
[0149] Construct a Sobel operator in the horizontal and vertical directions respectively;
[0150] The horizontal and vertical gradient values of each pixel are calculated using two Sobel operators.
[0151] The gradient intensity and gradient direction of each pixel are calculated based on the horizontal and vertical gradient values.
[0152] The pixel with the largest gradient intensity in each gradient direction is selected as the edge point to obtain the initial set of edge points of the target blade;
[0153] The edge points in the initial edge point set are filtered to obtain the final edge point set and the corresponding edge detection image.
[0154] The process of filtering edge points in the initial set of edge points includes:
[0155] The gradient strength of the edge points in the initial set of edge points is compared with the preset gradient threshold range by traversing the data.
[0156] If the edge point exceeds the lower limit of the preset gradient threshold range, then delete the edge point.
[0157] If the value exceeds the upper limit of the preset gradient threshold range, it is marked as a strong edge point and retained.
[0158] If the value falls within the preset gradient threshold range, it is marked as a virtual edge point.
[0159] Determine whether each virtual edge point is connected to at least one strong edge point. If they are connected, keep the edge point; otherwise, delete it.
[0160] The contour extraction unit 704 is used to perform contour extraction processing based on the edge detection image to obtain the contour image of the target blade.
[0161] The contour extraction unit 704 is specifically used to traverse the total number of pixels for each contour in the image after edge detection;
[0162] The contour with the largest total number of pixels is determined as the contour of the target blade, and the contour image of the target blade is obtained.
[0163] Ellipse fitting unit 705 is used to perform ellipse fitting on the contour in the contour image to obtain the fitted ellipse of the target blade.
[0164] The ellipse fitting unit 705 is specifically used to construct pixel coordinates for each pixel in the contour image;
[0165] The leftmost and rightmost points of the blade outline are determined based on pixel coordinates;
[0166] Get the pixel coordinates on the tip contour between the leftmost and rightmost points and store them in a preset linked list;
[0167] Input the pixel coordinates in the preset linked list into the pre-constructed general equation of the ellipse to obtain the parameters of the fitted ellipse;
[0168] The fitted ellipse is drawn based on the parameters of the fitted ellipse.
[0169] The determination unit 706 is used to determine the tip shape phenotype of the target blade based on the eccentricity of the fitted ellipse.
[0170] Based on the same technical concept, embodiments of the present invention also provide an electronic device, such as... Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0171] Memory 803 is used to store computer programs;
[0172] The processor 801, when executing the program stored in the memory 803, implements the steps of the method for obtaining the tip shape phenotype of the blade.
[0173] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0174] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0175] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0176] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0177] The computer program product for obtaining the tip shape phenotype of a blade provided in this embodiment of the invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0178] The blade tip shape phenotype acquisition device provided in this embodiment of the invention can be specific hardware on a device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this embodiment of the invention are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0179] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0180] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0181] In addition, the functional units in the embodiments provided by the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0182] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0183] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0184] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. All should be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for acquiring a tip shape phenotype of a plate leaf type blade, characterized by, The method comprises the following steps: collecting an original image of a target leaf; preprocessing the original image to obtain a preprocessed image; performing edge detection on the preprocessed image to obtain an edge detection image of the target leaf; performing contour extraction processing based on the edge detection image to obtain a contour image of the target leaf; performing ellipse fitting on the contour in the contour image to obtain a fitted ellipse of the target leaf; determining a tip shape phenotype of the target leaf based on an eccentricity of the fitted ellipse and a preset mapping relationship between the eccentricity and the tip shape phenotype.
2. The method of claim 1, wherein, The preprocessing of the original image to obtain a preprocessed image comprises: performing grayscale processing on the original image to obtain a grayscale image; performing denoising processing on the grayscale image using a preset convolution kernel to obtain a preprocessed image.
3. The method of claim 2, wherein, The preset convolution kernel is a 3*3 convolution kernel [1, 2, 1]*[2, 8, 2]*[1, 2, 1].
4. The method of claim 1, wherein, The edge detection on the preprocessed image to obtain an edge detection image of the target leaf comprises: constructing a Sobel operator in the horizontal direction and the vertical direction respectively; calculating the horizontal direction gradient value and the vertical direction gradient value of each pixel point using the two Sobel operators respectively; calculating the gradient strength and the gradient direction of each pixel point based on the horizontal direction gradient value and the vertical direction gradient value; selecting the pixel point with the maximum gradient strength in each gradient direction as an edge point to obtain an initial edge point set of the target leaf; screening the edge points in the initial edge point set to obtain a final edge point set and an edge detection image corresponding to the final edge point set.
5. The method of claim 4, wherein, The screening of the edge points in the initial edge point set comprises: comparing the gradient strength of the edge points in the initial edge point set with a preset gradient threshold range in a traversal manner; if the gradient strength is below the lower limit of the preset gradient threshold range, the edge point is deleted; if the gradient strength is above the upper limit of the preset gradient threshold range, the edge point is marked as a strong edge point and retained; if the gradient strength is between the lower limit and the upper limit of the preset gradient threshold range, the edge point is marked as a virtual edge point; determining whether each virtual edge point is connected to at least one strong edge point, if yes, the edge point is retained, otherwise, the edge point is deleted.
6. The method of claim 1, wherein, The edge detection image comprises a plurality of contours, and the contour extraction processing based on the edge detection image to obtain a contour image of the target leaf comprises: traversing the total number of pixel points of each contour in the edge detection image; determining the contour with the maximum total number of pixel points as the contour of the target leaf to obtain the contour image of the target leaf.
7. The method of claim 1, wherein, The ellipse fitting on the contour in the contour image to obtain a fitted ellipse of the target leaf comprises: constructing a pixel point coordinate for each pixel point in the contour image; determining the leftmost point and the rightmost point of the leaf contour based on the pixel point coordinate; obtaining the pixel point coordinates on the tip contour between the leftmost point and the rightmost point and storing them in a preset linked list; inputting the pixel point coordinates in the preset linked list into a pre-constructed general equation of an ellipse to obtain ellipse fitting parameters; drawing a fitted ellipse based on the ellipse fitting parameters.
8. A device for acquiring the tip shape phenotypic characteristics of a blade, characterized in that, The method comprises the following steps: An acquisition unit is configured to acquire an original image of a target leaf; A preprocessing unit is configured to perform preprocessing on the original image to obtain a preprocessed image; An edge detection unit is configured to perform edge detection on the preprocessed image to obtain an edge detection image of the target leaf; A contour extraction unit is configured to perform contour extraction processing based on the edge detection image to obtain a contour image of the target leaf; An ellipse fitting unit is configured to perform ellipse fitting on the contour in the contour image to obtain a fitted ellipse of the target leaf; A determination unit is configured to determine a tip shape phenotype of the target leaf based on an eccentricity of the fitted ellipse.
9. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is configured to store a computer program; The processor is configured to execute the program stored in the memory to implement the method steps in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and the computer program is executed by the processor to implement the method steps in any one of claims 1-7.
Citation Information
Patent Citations
Social platform matching method and system based on plant recognition
CN110008912A
Surface target contour acquisition method and system, and 3D information acquisition method
CN114708201A