Zizania aquatica phenotypic feature extraction method, apparatus and device, medium and product
Through deep learning algorithms and image processing technology, the size, shape and color characteristics of water bamboo are automatically extracted, which solves the problems of high labor intensity and large errors in manual measurement of water bamboo phenotypic characteristics, and realizes efficient and accurate water bamboo feature extraction.
Patent Information
- Application Number
- CN202510672911.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-09-12
AI Technical Summary
In the existing technology, the extraction of wild rice phenotypic characteristics relies on manual measurement, which has problems such as labor shortage, high labor intensity, large data errors and inability to accurately extract the characteristics of complex morphological crops.
A deep learning algorithm was used to train a water bamboo region recognition model. Combined with grayscale threshold segmentation and morphological operations, the size, shape and color features of water bamboo were automatically extracted through ruler and colorimetric card correction.
The automated, rapid and high-precision extraction of Zizania latifolia phenotypic characteristics was achieved, overcoming the shortcomings of traditional methods and improving measurement speed and accuracy.
Smart Images

Figure CN120635489A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of feature extraction technology, and in particular to a method, device, equipment, medium and product for extracting wild rice phenotypic features. Background Art
[0002] Zizania latifolia, a unique aquatic vegetable species in my country, is widely cultivated domestically. Currently, phenotypic characterization of Zizania latifolia relies primarily on manual measurement and empirical analysis. However, these traditional methods have numerous drawbacks: First, labor shortages often occur during the peak Zizania latifolia harvest season; second, harvesting and measuring are labor-intensive, and manual inspection is time-consuming and economically inefficient; finally, manual measurement using tools such as tape measures and protractors is susceptible to human error, leading to data errors.
[0003] Early crop phenotyping algorithms were mostly based on simple threshold segmentation and morphological processing. These methods were able to perform preliminary phenotypic analysis on crops with simple shapes, but were unsatisfactory in accurately extracting phenotypic features for crops with complex shapes, such as wild rice. With the rise of deep learning technology, new detection methods and approaches have emerged for capturing wild rice phenotypic features. By combining traditional image segmentation techniques, deep learning algorithms can accurately and rapidly capture and analyze wild rice phenotypic features, such as morphological structure and color, providing solid data support and technical assurance for optimizing wild rice breeding. Summary of the Invention
[0004] The purpose of this application is to provide a method, device, equipment, medium and product for extracting phenotypic characteristics of water bamboo shoots, which can effectively improve the speed and accuracy of extracting phenotypic characteristics of water bamboo shoots.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a method for extracting phenotypic characteristics of wild rice stem, comprising the following steps:
[0007] An original image to be processed is obtained, and preprocessed to obtain an image to be identified; the original image to be processed and the image to be identified both include wild rice stem, background, colorimetric card and ruler.
[0008] The water chestnut area recognition model trained in advance based on the deep learning algorithm is used to identify the water chestnut area in the image to be identified, and several water chestnut area bounding boxes are obtained.
[0009] A wild rice stem area mask is determined based on several wild rice stem area bounding boxes, and mask segmentation is performed in the image to be identified to obtain a wild rice stem area image with the background removed.
[0010] Grayscale threshold segmentation and morphological operations are used to extract the regions of interest of each wild rice stem in the wild rice stem area image to obtain several wild rice stem regions of interest; the several wild rice stem regions of interest correspond one to one with the several wild rice stems in the wild rice stem area image.
[0011] For any Zizania latifolia region of interest corresponding to the Zizania latifolia, the phenotypic characteristics of the Zizania latifolia are extracted according to the characteristic information of the ruler and the color card in the original image to be processed; the phenotypic characteristics include size characteristics, shape characteristics and color characteristics.
[0012] Optionally, extracting the phenotypic characteristics of Zizania latifolia based on the characteristic information of the ruler and the colorimetric card in the original image to be processed specifically includes the following steps:
[0013] The size characteristics of wild rice stem are determined according to the relationship between the actual size of the ruler and the size of the pixels in the original image to be processed.
[0014] The shape characteristics of water bamboo are determined according to the size characteristics of water bamboo and the size characteristics of typical water bamboo.
[0015] According to the actual color matrix of the colorimetric card and the image color matrix of the colorimetric card, the color in the wild rice stem area of interest corresponding to the wild rice stem is color corrected, and the color characteristics of the wild rice stem are determined.
[0016] Optionally, the colorimetric card includes a plurality of color blocks; color correction is performed on the color of the wild rice stem in the region of interest corresponding to the wild rice stem according to the actual color matrix of the colorimetric card and the image color matrix of the colorimetric card, and the color characteristics of the wild rice stem are determined, specifically comprising the following steps:
[0017] For any color block on the color chart, the average color value of the color block is collected in the original image to be processed as the image color value of the color block.
[0018] According to the image color matrix of the colorimetric card and the actual color matrix of the colorimetric card, a least square solution is solved to obtain a color correction matrix; the image color matrix of the colorimetric card includes the image color values of each color block of the colorimetric card; the actual color matrix of the colorimetric card includes the actual color values of each color block of the colorimetric card.
[0019] Color correction is performed on the color of the wild rice stem region of interest corresponding to the wild rice stem according to the color correction matrix to obtain a color-corrected wild rice stem region of interest.
[0020] The color characteristics of wild rice stem were obtained by performing correlation analysis on the wild rice stem color in the region of interest after color correction and the typical wild rice stem color.
[0021] Optionally, color correction is performed on the color in the wild rice stem region of interest corresponding to the wild rice stem according to the following formula:
[0022] [R',G',B']=[R,G,B,1]*ccm.
[0023] Among them, [R, G, B] is the color vector of the wild rice region of interest corresponding to wild rice, [R', G', B'] is the color vector of the wild rice region of interest after color correction, and ccm is the color correction matrix.
[0024] The color correction matrix is calculated according to the following formula:
[0025]
[0026] Among them, refRGB is the actual color matrix of the colorimetric card, cameraRGB is the image color matrix of the colorimetric card, ones(m,1) generates an all-one matrix with m rows and 1 column, and m is the number of color blocks in the colorimetric card.
[0027] Optionally, the preprocessing of the original image to be processed includes: converting the absolute coordinates of each pixel in the original image to be processed into relative coordinates; the absolute coordinates are the coordinates of the pixel in the original image to be processed relative to the origin of the image coordinate system, and the relative coordinates are the coordinates calculated based on the ratio of the absolute coordinates of the pixel to the size of the original image to be processed.
[0028] Optionally, the wild rice stem area recognition model is a model trained in advance based on the YOLOv8 deep learning algorithm.
[0029] In a second aspect, the present application provides a wild rice phenotypic feature extraction system, comprising the following functional modules:
[0030] The image acquisition and preprocessing module is used to acquire the original image to be processed and preprocess the original image to be processed to obtain the image to be identified; the original image to be processed and the image to be identified both include wild rice stem, background, colorimetric card and ruler.
[0031] The wild rice region bounding box recognition module is used to identify the wild rice region in the image to be identified using a wild rice region recognition model that has been pre-trained based on a deep learning algorithm, and obtain several wild rice region bounding boxes.
[0032] The wild rice region and background separation module is used to determine the wild rice region mask based on several wild rice region bounding boxes, and perform mask segmentation in the image to be identified to obtain a wild rice region image with the background removed.
[0033] The wild rice region of interest extraction module is used to extract the regions of interest of each wild rice in the wild rice region image by using grayscale threshold segmentation and morphological operations to obtain a number of wild rice regions of interest; the several wild rice regions of interest correspond to the several wild rice in the wild rice region image.
[0034] The Zizania latifolia phenotypic feature analysis and extraction module is used to extract the phenotypic features of Zizania latifolia from any Zizania latifolia region of interest according to the feature information of the ruler and the colorimetric card in the original image to be processed; the phenotypic features include size features, shape features and color features.
[0035] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method for extracting phenotypic characteristics of water chestnut provided above.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for extracting the phenotypic characteristics of water chestnut provided above.
[0037] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method for extracting the phenotypic characteristics of water chestnuts provided above.
[0038] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0039] The present application provides a method, apparatus, device, medium and product for extracting phenotypic features of water chestnuts. In the method, a water chestnut region in an image to be identified is identified by using a water chestnut region recognition model that has been trained in advance based on a deep learning algorithm to obtain a number of water chestnut region bounding boxes. Subsequently, a water chestnut region mask is determined based on these water chestnut region bounding boxes, and mask segmentation is performed in the original image to remove the background. Grayscale threshold segmentation and morphological operations are then used to extract the region of interest of each water chestnut. Finally, the size characteristics, shape characteristics and color characteristics of each water chestnut are extracted based on the characteristic information of the ruler and colorimetric card in the original image as a reference. The solution provided in this application can fully automatically realize the extraction of phenotypic characteristics of water bamboo. By adopting a deep learning algorithm to identify water bamboo areas, the recognition accuracy of water bamboo areas can be improved. Compared with traditional manual measurement, the measurement speed is greatly improved, and the defect of the existing technology based on simple threshold segmentation and morphological processing, which cannot be applied to crops with complex morphology, is overcome. It can well realize the analysis and extraction of water bamboo size characteristics, shape characteristics and color characteristics. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 This is a diagram of the application environment of a method for extracting wild rice phenotypic characteristics provided in one embodiment of the present application.
[0042] Figure 2 This is a flowchart of a method for extracting wild rice phenotypic characteristics provided in one embodiment of the present application.
[0043] Figure 3 This is a flowchart of step S5 in a method for extracting wild rice phenotypic characteristics provided in one embodiment of the present application.
[0044] Figure 4 This is a flowchart of step S53 in a method for extracting wild rice phenotypic characteristics provided in one embodiment of the present application.
[0045] Figure 5 This is a schematic diagram of the functional modules of a water chestnut phenotypic feature extraction system provided in one embodiment of the present application.
[0046] Figure 6 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0049] The present invention provides a method for extracting wild rice stem phenotypic characteristics, which can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the server 104 via a network. The data storage system can store data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers.
[0050] The terminal 102 can send a processing request for extracting the phenotypic features of the water chestnut to the server 104. After receiving the request, the server 104 obtains the original image to be processed and pre-processes the original image to be processed to obtain the image to be identified. The original image to be processed and the image to be identified both include water chestnuts, background, colorimetric card and ruler. The water chestnut region in the image to be identified is identified by a water chestnut region recognition model pre-trained based on a deep learning algorithm to obtain a plurality of water chestnut region boundary boxes. The water chestnut region is determined based on the plurality of water chestnut region boundary boxes. A region mask is generated and mask segmentation is performed in the image to be identified to obtain a background-removed rice stem region image. Grayscale threshold segmentation and morphological operations are used to extract regions of interest (ROIs) of each rice stem in the rice stem region image to obtain a plurality of rice stem regions of interest. Each of the plurality of RIOs of interest corresponds to a plurality of rice stems in the rice stem region image. For each RIO corresponding to a rice stem, phenotypic characteristics of the rice stem are extracted based on the characteristic information of the ruler and color chart in the original image to be processed. Phenotypic characteristics include size, shape, and color. Server 104 can then provide feedback to terminal 102 on the size, shape, and color characteristics of the rice stem.
[0051] In addition, in some embodiments, the method for extracting the phenotypic characteristics of water chestnuts can also be implemented independently by the server 104 or the terminal 102. For example, the terminal 102 can directly obtain the original image to be processed and perform processing, feature analysis and extraction, or the server 104 can obtain the original image to be processed from the data storage system and perform processing, feature analysis and extraction on the original image to be processed.
[0052] Terminal 102 may include, but is not limited to, various desktop computers, laptops, smartphones, tablet computers, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, and smart car devices. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Server 104 may be implemented as a standalone server or a server cluster consisting of multiple servers, or may be a cloud server.
[0053] In an exemplary embodiment, Figure 2 As shown, a method for extracting wild rice phenotypic characteristics is provided. The method is executed by a computer device, specifically a computer device such as a terminal or a server, or a terminal and a server. In the embodiment of the present application, the method is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0054] S1. Acquire an original image to be processed, and pre-process the original image to be processed to obtain an image to be identified; the original image to be processed and the image to be identified both include wild rice stem, background, color chart, and ruler.
[0055] In a specific embodiment, step S1 preprocesses the original image to be processed, including converting the absolute coordinates of each pixel in the original image to be processed into relative coordinates; the absolute coordinates are the coordinates of the pixel in the original image to be processed relative to the origin of the image coordinate system, and the relative coordinates are the coordinates calculated based on the ratio of the absolute coordinates of the pixel to the size of the original image to be processed. The specific conversion formula is as follows:
[0056]
[0057] Where x and y with the subscript "absolute" are the absolute coordinates of the pixel, that is, the coordinates of the pixel relative to the image origin, which is generally the upper left or lower left of the image; x and y with the subscript "relative" are the relative coordinates of the pixel, that is, the absolute coordinates of the pixel are normalized to the ratio of the image size; W is the width of the original image to be processed, and H is the height of the original image to be processed. This method can adapt to image inputs of different sizes, maintain the target position ratio, and accurately locate the coordinates even if the image is scaled. It also avoids algorithm sensitivity issues caused by absolute pixel differences.
[0058] Furthermore, to facilitate subsequent processing with OpenCV and other libraries, the masked tensor on the GPU is converted to a NumPy array on the CPU. This is to accommodate libraries that rely on CPU processing, such as OpenCV. By migrating devices, converting data types, and adjusting shapes, data compatibility is ensured, allowing for seamless integration into subsequent image processing pipelines.
[0059] S2. Using a wild rice stem area recognition model pre-trained based on a deep learning algorithm, the wild rice stem area in the image to be identified is identified to obtain several wild rice stem area bounding boxes. In this embodiment, the wild rice stem area recognition model is a model pre-trained based on the YOLOv8 deep learning algorithm. The training process is similar to a conventional training process. Based on a large number of data sets obtained by shooting, the wild rice stem areas are manually marked so that the wild rice stem area recognition model can accurately identify the wild rice stem area and the background area.
[0060] S3. Determine a wild rice stem area mask based on a plurality of wild rice stem area bounding boxes, and perform mask segmentation in the image to be identified to obtain a wild rice stem area image with the background removed.
[0061] In step S3, the wild rice region bounding box [x, y, w, h] in YOLO format, obtained by the wild rice region recognition model, is first converted to the [x1, y1, x2, y2] format required by the SAM (SegmentAnything Model). [x, y, w, h] represents the coordinates of the center point of the bounding box as well as its width and height, while [x1, y1, x2, y2] represents the coordinates of the top left and bottom right corners of the bounding box. The SAM auxiliary function is then called to obtain the mask of all wild rice region bounding boxes. Multiple masks are stacked and merged to obtain the wild rice region mask data. This mask is then applied to the image to be recognized to obtain the final wild rice region image, achieving separation of the wild rice from the background.
[0062] S4. Using grayscale threshold segmentation and morphological operations, extract the regions of interest of each wild rice stem in the wild rice stem area image to obtain a plurality of wild rice stem regions of interest; the plurality of wild rice stem regions of interest correspond to the plurality of wild rice stems in the wild rice stem area image in a one-to-one manner.
[0063] In this step S4, first the wild rice stem regional image is gray-scaled and binarized by the first threshold value. Retain the first N block areas (assuming that there are N wild rice stems when the image is taken) by area sorting, generate a rectangular frame and mark the position for each outline. Secondly, the image at each position is threshold segmented, and the wild rice stem region is further separated from the background. Subsequently, morphological operations are applied, a 4*4 matrix is predefined, starting from the upper left corner of the image, pixel by pixel slides, covering the local area centered around the current pixel, each RGB channel is independently expanded, and the outline fracture edge is repaired. According to the size and shape of the outline, suitable area is screened to obtain the minimum bounding rectangle that fits the actual segmentation shape. Finally, the ROI (region of interest) of the wild rice stem is extracted, and these ROIs are sorted and graded.
[0064] S5. For any wild rice stem area of interest corresponding to wild rice stem, extract the phenotypic characteristics of wild rice stem according to the characteristic information of the scale and color chart in the original image to be processed; the phenotypic characteristics include size characteristics, shape characteristics and color characteristics. In order to simplify the calculation process, the extracted wild rice stem area of interest can be grayscaled and binarized before the following process is carried out. In this embodiment, if Figure 3 As shown, step S5 specifically includes the following steps:
[0065] S51, based on the relationship between the actual size of the ruler and the size of the pixels in the original image to be processed, determine the size characteristics of the wild rice stem. Specifically, the length calculation formula is as follows:
[0066]
[0067] Among them, l plantis the actual length of wild rice stem, l rul is the actual length of the ruler, p plant is the number of pixels in the length direction of the wild rice stem area of interest, p rul The actual length of the ruler is the number of pixels in the image.
[0068] S52, determining the shape characteristics of the wild rice stem based on the size characteristics of the wild rice stem and the size characteristics of the typical shape wild rice stem. After determining the size characteristics of each wild rice stem, using the typical shape wild rice stem as a standard, performing a correlation analysis of width and height to determine the shape characteristics of each wild rice stem (such as bamboo shoot shape, candlestick shape, etc.).
[0069] S53, performing color correction on the color in the wild rice stem area of interest corresponding to the wild rice stem according to the actual color matrix of the colorimetric card and the image color matrix of the colorimetric card, and determining the color characteristics of the wild rice stem.
[0070] The above color correction steps can be corrected by Matlab's colorChecker algorithm. Specifically, the colorimetric card includes several color blocks. For example, the colorimetric card with 24 color blocks is used in this embodiment; Figure 4 As shown, step S53 specifically includes the following steps:
[0071] S531 . For any color block on the color chart, collect the average color value of the color block in the original image to be processed as the image color value of the color block.
[0072] S532: Based on the image color matrix of the color chart and the actual color matrix of the color chart, a least squares solution is obtained to obtain a color correction matrix. The image color matrix of the color chart includes the image color values of each color block of the color chart; the actual color matrix of the color chart includes the actual color values of each color block of the color chart. Specifically, in step S532, the color correction matrix is calculated according to the following formula:
[0073]
[0074] Where ccm is the color correction matrix, refRGB is the actual color matrix of the colorimetric card, cameraRGB is the image color matrix of the colorimetric card, both cameraRGB and refRGB are 24*3 matrices, ones(m,1) generates an all-one matrix with m rows and 1 column, and m is the number of color blocks on the colorimetric card.
[0075] S533, color correction is performed on the color of the wild rice stem region of interest corresponding to the wild rice stem according to the color correction matrix to obtain a color-corrected wild rice stem region of interest. Specifically, in step S533, color correction can be performed on the color of the wild rice stem region of interest corresponding to the wild rice stem according to the following formula:
[0076] [R',G',B']=[R,G,B,1]*ccm.
[0077] Among them, [R, G, B] is the color vector of the wild rice region of interest corresponding to wild rice, and [R', G', B'] is the color vector of the wild rice region of interest after color correction.
[0078] S534, performing correlation analysis on the wild rice stem color in the color-corrected wild rice stem region of interest and the typical wild rice stem color to obtain a color feature of the wild rice stem. Performing correlation analysis on the RGB values in the color-corrected wild rice stem region of interest and the standard RGB values of the typical wild rice stem color to obtain actual colors (e.g., white, yellowish white, etc.) corresponding to different RGB values in the acquired data.
[0079] The above-mentioned solution provided by the present application can fully automatically realize the extraction of the phenotypic characteristics of water chestnuts. By adopting a deep learning algorithm to identify the water chestnut area, the recognition accuracy of the water chestnut area can be improved. Compared with traditional manual measurement, the measurement speed is greatly improved, and the defect of the existing technology based on simple threshold segmentation and morphological processing that cannot be applied to complex morphological crops is overcome. It can well realize the analysis and extraction of water chestnut size characteristics, shape characteristics and color characteristics. Compared with the existing technology, the solution provided by the present application has at least the following advantages: (1) Fast detection speed: After the water chestnut area recognition model is loaded at the beginning, the detection rate of a single image is 2-10s, which is faster than manual measurement. (2) High accuracy: The size error of the recognizable image is ±5mm. (3) Strong anti-interference ability: By configuring a colorimetric card, standard color calibration can be performed.
[0080] Based on the same inventive concept, embodiments of the present application also provide a system for implementing the aforementioned method for extracting wild rice phenotypic characteristics. The solution provided by this system is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the wild rice phenotypic characteristics extraction system provided below can be found in the aforementioned limitations of the wild rice phenotypic characteristics extraction method and will not be further elaborated here.
[0081] In an exemplary embodiment, Figure 5 As shown, a wild rice phenotypic feature extraction system is provided, including the following functional modules:
[0082] The image acquisition and preprocessing module is used to acquire the original image to be processed and preprocess the original image to be processed to obtain the image to be identified; the original image to be processed and the image to be identified both include wild rice stem, background, colorimetric card and ruler.
[0083] The wild rice region bounding box recognition module is used to identify the wild rice region in the image to be identified using a wild rice region recognition model that has been pre-trained based on a deep learning algorithm, and obtain several wild rice region bounding boxes.
[0084] The wild rice region and background separation module is used to determine the wild rice region mask based on several wild rice region bounding boxes, and perform mask segmentation in the image to be identified to obtain a wild rice region image with the background removed.
[0085] The wild rice region of interest extraction module is used to extract the regions of interest of each wild rice in the wild rice region image by using grayscale threshold segmentation and morphological operations to obtain a number of wild rice regions of interest; the several wild rice regions of interest correspond to the several wild rice in the wild rice region image.
[0086] The Zizania latifolia phenotypic feature analysis and extraction module is used to extract the phenotypic features of Zizania latifolia from any Zizania latifolia region of interest according to the feature information of the ruler and the colorimetric card in the original image to be processed; the phenotypic features include size features, shape features and color features.
[0087] certainly, Figure 5 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different functions. Figure 5 One or at least two components of the system shown.
[0088] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the size characteristics, shape characteristics and color characteristics of typical wild rice stems. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for extracting wild rice stem phenotypic characteristics provided in the above embodiment can be implemented.
[0089] Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0090] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0091] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0092] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0093] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0094] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
[0095] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0096] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for extracting wild rice phenotypic characteristics, characterized in that: include: Acquire an original image to be processed, and pre-process the original image to be processed to obtain an image to be identified; the original image to be processed and the image to be identified both include wild rice stem, background, color chart and ruler; The wild rice region in the image to be identified is identified using a wild rice region identification model that has been pre-trained based on a deep learning algorithm to obtain a plurality of wild rice region bounding boxes; Determining a wild rice stem area mask based on a plurality of said wild rice stem area boundary boxes, and performing mask segmentation in the image to be identified to obtain a wild rice stem area image with the background removed; Grayscale threshold segmentation and morphological operation are used to extract the regions of interest of each wild rice stem in the wild rice stem area image to obtain a plurality of wild rice stem regions of interest; the plurality of wild rice stem regions of interest correspond to a plurality of wild rice stems in the wild rice stem area image in a one-to-one manner; For any wild rice stem area of interest corresponding to the wild rice stem, the phenotypic characteristics of the wild rice stem are extracted according to the characteristic information of the ruler and the color chart in the original image to be processed; the phenotypic characteristics include size characteristics, shape characteristics and color characteristics.
2. The method for extracting wild rice stem phenotypic characteristics according to claim 1, wherein The phenotypic characteristics of the wild rice stem are extracted based on the characteristic information of the ruler and the color chart in the original image to be processed, specifically including: Determining the size feature of the wild rice stem according to the relationship between the actual size of the ruler and the size of the pixels in the original image to be processed; Determining the shape characteristics of the wild rice stem according to the size characteristics of the wild rice stem and the size characteristics of the typical shape wild rice stem; According to the actual color matrix of the colorimetric card and the image color matrix of the colorimetric card, color correction is performed on the color of the wild rice stem area of interest corresponding to the wild rice stem, and the color characteristics of the wild rice stem are determined.
3. The method for extracting wild rice stem phenotypic characteristics according to claim 2, wherein The colorimetric card includes a plurality of color blocks; according to the actual color matrix of the colorimetric card and the image color matrix of the colorimetric card, color correction is performed on the color of the wild rice stem in the region of interest corresponding to the wild rice stem, and the color characteristics of the wild rice stem are determined, specifically comprising: For any color block of the color chart, collecting an average color value of the color block in the original image to be processed as the image color value of the color block; Solving the least squares solution to obtain a color correction matrix based on the image color matrix of the color chart and the actual color matrix of the color chart; the image color matrix of the color chart includes the image color values of each color block of the color chart; the actual color matrix of the color chart includes the actual color values of each color block of the color chart; Performing color correction on the color of the wild rice stem region of interest corresponding to the wild rice stem according to the color correction matrix to obtain a color-corrected wild rice stem region of interest; Correlation analysis is performed on the color of the wild rice stem in the region of interest of the color-corrected wild rice stem and the typical wild rice stem color to obtain the color characteristics of the wild rice stem.
4. The method for extracting wild rice stem phenotypic characteristics according to claim 3, wherein Color correction is performed on the color of the wild rice stem area of interest corresponding to the wild rice stem according to the following formula: [R',G',B']=[R,G,B,1]*ccm; Wherein, [R, G, B] is the color vector in the wild rice region of interest corresponding to the wild rice, [R', G', B'] is the color vector in the wild rice region of interest after color correction, and ccm is the color correction matrix; The color correction matrix is calculated according to the following formula: Wherein, refRGB is the actual color matrix of the colorimetric card, cameraRGB is the image color matrix of the colorimetric card, ones(m,1) is to generate an all-one matrix with m rows and 1 column, and m is the number of color blocks of the colorimetric card.
5. The method for extracting wild rice stem phenotypic characteristics according to claim 1, wherein The preprocessing of the original image to be processed includes: converting the absolute coordinates of each pixel in the original image to be processed into relative coordinates; the absolute coordinates are the coordinates of the pixel in the original image to be processed relative to the origin of the image coordinate system, and the relative coordinates are coordinates calculated based on the ratio of the absolute coordinates of the pixel to the size of the original image to be processed.
6. The method for extracting wild rice stem phenotypic characteristics according to claim 1, wherein The wild rice stem area recognition model is a model trained in advance based on the YOLOv8 deep learning algorithm.
7. A wild rice phenotypic feature extraction system, characterized in that: include: An image acquisition and preprocessing module is used to acquire an original image to be processed and preprocess the original image to be processed to obtain an image to be identified; the original image to be processed and the image to be identified both include wild rice stem, background, color chart and ruler; A wild rice stem region bounding box recognition module is used to recognize the wild rice stem region in the image to be recognized by using a wild rice stem region recognition model trained in advance based on a deep learning algorithm to obtain a plurality of wild rice stem region bounding boxes; A wild rice stem area and background separation module is used to determine a wild rice stem area mask based on a plurality of said wild rice stem area boundary boxes, and perform mask segmentation in the image to be identified to obtain a wild rice stem area image with the background removed; a wild rice stem region of interest extraction module, configured to extract regions of interest of each wild rice stem in the wild rice stem region image by using grayscale threshold segmentation and morphological operations, thereby obtaining a plurality of wild rice stem regions of interest; wherein the plurality of wild rice stem regions of interest correspond to a plurality of wild rice stems in the wild rice stem region image in a one-to-one manner; The water chestnut phenotypic feature analysis and extraction module is used to extract the phenotypic features of the water chestnut corresponding to any water chestnut region of interest based on the feature information of the ruler and the color chart in the original image to be processed; the phenotypic features include size features, shape features and color features.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for extracting wild rice phenotypic characteristics according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for extracting wild rice phenotypic characteristics according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for extracting wild rice phenotypic characteristics according to any one of claims 1 to 6 is implemented.