Rice seed and plant leaf phenotyping method and system based on rgb camera
By using a portable acquisition system based on an RGB camera and standardized image processing, the problems of inefficient manual operation, high equipment cost, and insufficient data accuracy in rice phenotypic analysis have been solved. This has enabled efficient and accurate quantification of seed and leaf phenotypic data, improving breeding efficiency and precision in agricultural production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN GREENPHENO SCI & TECH CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-09
AI Technical Summary
Existing rice phenotypic analysis technologies suffer from problems such as inefficiency and error-prone manual operation, high cost and poor portability of specialized equipment, limited functionality, and insufficient data accuracy, making it difficult to meet the needs of large-scale germplasm resource screening and breeding processes.
A portable acquisition system based on an RGB camera was adopted, combined with standardized image processing and multi-dimensional feature extraction technology. Through image preprocessing and feature extraction methods, efficient and accurate quantification of seed and leaf phenotypic data was achieved.
It has enabled the efficient and accurate quantification of seed and leaf phenotypic data, providing reliable support for breeding screening and germplasm identification, and improving breeding efficiency and the precision level of agricultural production.
Smart Images

Figure CN122176526A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agricultural crop phenotypic detection and data processing technology, and more specifically, relates to a method and system for phenotypic analysis of rice seeds and plant leaves based on an RGB camera. Background Technology
[0002] In the process of agricultural modernization and crop breeding research, rice, as a major global food crop, has its yield and quality directly related to food security and agricultural economic development. Phenotypic characteristics, as a direct reflection of rice's genetic characteristics and environmental adaptability, encompass morphological parameters such as seed length, width, and roundness, as well as key indicators such as leaf geometry, color, texture, and morphological structure. These data are the core basis for variety selection, germplasm resource identification, growth status monitoring, and breeding decisions.
[0003] Currently, rice phenotypic analysis still faces many practical bottlenecks. Traditional phenotypic detection relies heavily on manual measurement and visual judgment, which is not only time-consuming, labor-intensive, and inefficient, but also easily affected by subjective human factors, resulting in poor data consistency and large errors, making it difficult to meet the needs of large-scale germplasm resource screening and accelerated breeding processes. At the same time, manual analysis cannot accurately capture deep phenotypic information such as leaf texture details and subtle differences in seed morphology, limiting the accuracy of breeding research.
[0004] In existing technologies, some phenotypic analyses rely on expensive specialized equipment. This equipment is bulky, complex to operate, and poorly portable, making it difficult to adapt to the application needs of various scenarios such as fields and laboratories, thus hindering its widespread adoption. In addition, most phenotypic analysis systems suffer from limited functionality, either only analyzing a single object such as seeds or leaves, or extracting only a few phenotypic features, failing to achieve multi-dimensional and comprehensive phenotypic data collection and integration.
[0005] More critically, the existing data processing workflow lacks standardized design, and image acquisition is easily affected by environmental factors such as lighting and background, leading to inaccurate target region segmentation. This, in turn, affects the accuracy of subsequent feature extraction, ultimately making it difficult to provide reliable phenotypic data support. These problems severely restrict the improvement of rice breeding efficiency, the efficient utilization of germplasm resources, and the precision development of agricultural production. Therefore, developing a low-cost, portable, high-precision technical solution that can comprehensively cover the needs of rice seed and leaf phenotypic analysis has become an urgent need in the field of agricultural science and technology, and is of great significance to promoting rice breeding research and agricultural modernization. Summary of the Invention
[0006] This invention aims to address the problems of inefficient and error-prone manual operations, high cost and poor portability of specialized equipment, limited functionality, and insufficient data accuracy in existing rice phenotypic analysis. By constructing a portable RGB camera acquisition system and combining standardized image processing and multi-dimensional feature extraction techniques, it achieves efficient and accurate quantification of seed and leaf phenotypic data, providing reliable support for breeding screening, germplasm identification, and other fields, thus contributing to the development of precision agriculture.
[0007] To address the aforementioned deficiencies or improvement needs of existing technologies, as a first aspect of this invention, the present invention provides a method for phenotypic analysis of rice seeds and plant leaves based on an RGB camera, comprising: S1. Construct a portable acquisition system including support components, an image acquisition module, and a supplementary lighting module. Place rice seeds on a preset background, provide an appropriate light source through the supplementary lighting module, and acquire seed images using the image acquisition module. Place plant leaves on an appropriate background carrier, provide multi-angle supplementary lighting through the supplementary lighting module to eliminate shadow interference, and acquire leaf images using the image acquisition module. S2. Perform background adaptation processing and grayscale and binarization processing on the collected seed images to obtain a preprocessed image with prominent seed targets; perform color space conversion on the collected leaf images, extract leaf regions through threshold segmentation, and separate leaf and non-leaf parts by combining morphological operations to obtain a preprocessed image that retains only the effective leaf regions. S3. A target detection model is used to identify targets in the preprocessed seed image. After filtering out invalid detection results, the seed contour is extracted, and the geometric features, morphological features and related statistical parameters of the seed are calculated. The actual feature values are obtained by converting the scale. Image analysis methods are used to identify contours and segment regions in the preprocessed leaf image. The geometric features, color features, texture features and morphological features of the leaf are calculated respectively, and the statistical data of each feature are obtained. S4. Store and output the detailed characteristic parameters and overall statistical data of single samples of seeds and leaves in a preset file format; perform visualization processing on the phenotypic data of seeds and leaves, present the single sample data or statistical data in the form of charts, and mark the target area and related identification information on the original collected images, and output the visualization results.
[0008] Furthermore, the image acquisition module in S1 has a resolution that meets the requirements of phenotypic analysis, and it uses an RGB camera.
[0009] Furthermore, the process of obtaining the preprocessed image with the seed target highlighted in S2 is as follows: After reading the acquired seed image, convert it to a grayscale image. Let the grayscale value of any pixel in the grayscale image be... ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value range is [0, 255]; Calculate the mean grayscale value of all pixels in the grayscale image. : in, This represents the total number of horizontal pixels in the grayscale image. This represents the total number of vertical pixels in the grayscale image. Based on the mean gray value Constructing a binarization threshold : in, This represents the maximum grayscale value of all pixels in the grayscale image. According to the binarization threshold Binarizing a grayscale image yields a binarized image, satisfying the following conditions: when When, the pixel value of this pixel in the binarized image is set to 255, when When this happens, the pixel value of that pixel in the binarized image is set to 0; The binarized image is pixel-fused with a custom-adapted background image. After fusion, the seed target region and the background region show significant pixel differences, resulting in a preprocessed image with prominent seed target.
[0010] Furthermore, the process of extracting the leaf region by threshold segmentation in S2 is as follows: The acquired leaf images were converted from the BGR color space to the HSV color space. The hue value of any pixel in the HSV color space was set to... Saturation value Brightness value ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value range is [0, 179]; and The values are all in the range [0, 255]; calculate all pixels in the image. mean , mean and mean They respectively satisfy: in, This represents the total number of horizontal pixels in the leaf image. This represents the total number of vertical pixels in the leaf image. Based on the above averages, an HSV threshold range is constructed, that is, a hue threshold range based on... Centered on the range of natural fluctuations in the green hue of rice leaves, the saturation threshold range is defined as follows: Centered on the range of effective rice leaf color purity fluctuation characteristics, the brightness threshold range is defined as follows: Centered on the range of reasonable variations in the brightness of rice leaves after exposure to light; Determine each pixel , , If the pixel is simultaneously within the corresponding threshold range, it is determined to be a leaf region pixel and the pixel value is set to 255. Otherwise, it is determined to be a non-leaf region pixel and the pixel value is set to 0. Through the above threshold segmentation operation, the leaf region and non-leaf region are separated, and the preliminary mask image of the leaf region is extracted.
[0011] Furthermore, the process of separating the blade and non-blade parts by combining morphological operations in S2 is as follows: Let the initial mask image of the leaf region obtained by threshold segmentation be... ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value can be 0 or 255. A value of 0 indicates a non-leaf pixel, and a value of 255 indicates a leaf pixel candidate. Constructing structured elements adapted to the texture and minute noise scale of rice leaves. Its size is determined by the characteristics of the leaf texture and the scale of common micro-noise. The set of pixels contained therein is ,in This represents the horizontal pixel count of the structured element. The vertical pixel count of the resulting structured element; right Perform morphological erosion to obtain the eroded image. The corrosion operation meets the requirements. That is, the value of each pixel is updated to its value in the structured element. The minimum value of all pixel values within the neighborhood is used to dissolve and discretize non-leaf micro-impurities and light noise. Based on the same structured element right Perform morphological dilation to obtain the dilated image. The expansion operation satisfies That is, the value of each pixel is updated to its value in the structured element. The maximum value of all pixels in the neighborhood is used to restore the complete outline of the leaf body and compensate for edge pixel loss. After the above corrosion-expansion combined operation, The outline of the blade region is regular and clear, and the non-blade parts are completely stripped away, resulting in a preprocessed image that retains only the effective area of the blade.
[0012] Furthermore, the process of calculating the geometric features, morphological features, and related statistical parameters of the seed in S3 is as follows: Suppose that after target recognition and filtering of invalid results, the extracted contour of a single seed in the preprocessed seed image is... ,contour The corresponding set of pixels is ,in For the outline of the first Image coordinates of 1 pixel, For outline The total number of pixels contained. The pixel-to-actual length conversion factor for image calibration (i.e., the actual length corresponding to a unit pixel); Calculate seed geometric features: Obtain the contour using the minimum bounding rectangle algorithm. The minimum bounding rectangle of the given array has a horizontal side length corresponding to the number of pixels. The number of pixels corresponding to the vertical side length is The actual grain width of the seed Actual particle length ; Contour calculation based on shoelace formula Pixel area of the enclosed region ,in , The actual area of the seed ;contour pixel perimeter The actual perimeter of the seed Seed length-to-width ratio ; Calculate seed morphological characteristics: seed roundness This value reflects how close the seed outline is to a circle; Calculate relevant statistical parameters: seed length for all tested seeds. Particle width ,area ,perimeter Aspect Ratio and roundness Sum them separately, then divide by the total number of seeds tested. The mean of each feature is obtained. The standard deviation is calculated by the deviation of each characteristic value from its corresponding mean. ,Right now ,in For the first A certain characteristic value of a seed. The mean of this feature is used to calculate the seed's geometric features, morphological features, and related statistical parameters.
[0013] Furthermore, the process of calculating the geometric features, color features, texture features, and morphological features of the blade in S3 is as follows: Suppose that after contour recognition and region segmentation, the effective region mask image corresponding to a single leaf is... ,in The image coordinates of the pixel are... Represents the horizontal coordinate value. Represents the vertical coordinate value. The time represents the effective pixels of the leaf. The time frame represents non-blade pixels; blade outline. The set of pixels is , This represents the total number of outline pixels. A pixel-to-actual length conversion factor for image calibration; In terms of geometric feature calculation, leaf pixel area Count the total number of pixels with a value of 255 in the mask, and the actual area. Leaf pixel perimeter ,in , Actual perimeter The contour is obtained using the minimum bounding rectangle algorithm. The minimum bounding rectangle, whose horizontal pixel side length is... Vertical pixel side length Corresponding to actual leaf width Actual leaf length Aspect Ratio Skeleton extraction is performed on the petiole region mask to obtain single-pixel skeleton lines, and the total number of skeleton line pixels is counted. Actual petiole length Contours are obtained using the convex hull algorithm. convex hull contour Calculate the pixel area of the convex hull based on the shoelace formula. , This represents the total number of pixels on the convex hull contour. , Actual convex hull area ; When calculating color features, the mask is traversed. Extract the hue value of each valid pixel from all valid pixels. Saturation value Brightness value The mean values were calculated separately. Set a green HSV detection range and count the number of pixels within the mask that match this range. Green pixel ratio ; Texture feature calculation requires first converting the effective area image of the leaf into a grayscale image. Then calculate the statistical parameters of the grayscale histogram: mean. Standard error Smoothness Third moment Uniformity , grayscale value The probability of occurrence; entropy , The value of this item is 0 at that time; In morphological feature calculation, the fractal dimension is calculated using box counting at different scales. The square box covers the leaf outline Statistical coverage requires the minimum number of boxes. fractal dimension Leaf density is based on the actual area of the leaf blade. Compared with the actual area of the convex hull Calculation, density This reflects the compactness of the blade profile.
[0014] Furthermore, the visualization results in S4 include: Data Charts: Visual charts of seed and leaf phenotypic data presented in preset chart types, covering the numerical distribution and statistical information of geometric features, morphological features, color features, texture features and related statistical data of single samples or all tested samples; Image annotation: Marking target areas and unique identification numbers for each sample on the original images of seeds and leaves to achieve accurate association between samples and data; Feature Identifiers: In the labeled original acquired images, the core phenotypic feature parameters corresponding to the single sample identification number are identified, intuitively presenting the key phenotypic information of the single sample.
[0015] As a second aspect of the present invention, a rice seed and plant leaf phenotypic analysis system based on an RGB camera is also provided, comprising: The acquisition system and image acquisition unit are used to build a portable acquisition system including support components, image acquisition module and supplementary lighting module. Rice seeds are placed on a preset background, and an appropriate light source is provided by the supplementary lighting module. The image acquisition module is used to acquire the seed image. Plant leaves are placed on an appropriate background carrier, and multi-angle supplementary lighting is provided by the supplementary lighting module to eliminate shadow interference. The image acquisition module is used to acquire the leaf image. The seed and leaf image preprocessing unit is used to perform background adaptation processing and grayscale and binarization processing on the acquired seed images to obtain a preprocessed image with prominent seed targets; and to perform color space conversion on the acquired leaf images, extract leaf regions through threshold segmentation, and separate leaf and non-leaf parts by combining morphological operations to obtain a preprocessed image that retains only the effective leaf regions. The phenotypic feature detection and extraction unit is used to perform target recognition on the seed preprocessed image using a target detection model, extract the seed contour after filtering invalid detection results, calculate the geometric features, morphological features and related statistical parameters of the seed, and obtain the actual feature values by combining the scale bar conversion; the image analysis method is used to perform contour recognition and region segmentation on the leaf preprocessed image, calculate the geometric features, color features, texture features and morphological features of the leaf respectively, and obtain the statistical data of each feature at the same time. The data output and visualization unit is used to store and output detailed characteristic parameters and overall statistical data of single samples of seeds and leaves in a preset file format; to visualize the phenotypic data of seeds and leaves, to present single sample data or statistical data in the form of charts, and to mark the target area and related identification information on the original collected image, and output the visualization results.
[0016] As a third aspect of the present invention, a computer-readable storage medium is also provided, on which a computer program is stored, the computer program being executed by a processor of any one of the methods for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera.
[0017] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects: 1. The present invention relates to a method for phenotypic analysis of rice seeds and plant leaves based on an RGB camera. This method utilizes a portable acquisition system comprising support components, an image acquisition module, and a supplementary lighting module, selecting an RGB camera that meets the requirements of phenotypic analysis as the core for image acquisition. For rice seeds, they are placed against a preset background, and the supplementary lighting module provides an appropriate light source to reduce environmental interference. For plant leaves, an appropriate background carrier combined with multi-angle supplementary lighting effectively eliminates the influence of shadows on image acquisition. This design ensures standardized image acquisition and overcomes the limitations of traditional equipment's poor scene adaptability with its portable structure, enabling efficient image acquisition in various scenarios such as fields and laboratories, providing a high-quality and consistent raw data foundation for subsequent phenotypic analysis.
[0018] 2. The present invention provides a method for phenotypic analysis of rice seeds and plant leaves based on an RGB camera, employing a differentiated preprocessing strategy tailored to the image characteristics of seeds and leaves. Seed images undergo background adaptation, grayscale conversion, and binarization. A dynamic threshold constructed based on the mean grayscale value is used to accurately distinguish seeds from the background. Leaf images are first converted from BGR to HSV color space, and then region segmentation is achieved by constructing an adaptation threshold range based on the mean values of each HSV channel. Morphological erosion-dilation operations are then used to remove non-leaf impurities. This targeted preprocessing method effectively filters out background, noise, and other interfering information, making the seed target area prominent and the effective leaf area contour regular, thus clearing obstacles for subsequent feature extraction and significantly improving the accuracy of target area recognition.
[0019] 3. The phenotypic analysis method for rice seeds and plant leaves based on an RGB camera of the present invention achieves accurate quantification of phenotypic parameters through a professional feature extraction and data processing workflow. For seeds, a target detection model is used to identify the contour, and geometric features such as grain length and width, as well as morphological features such as roundness, are obtained by combining scale conversion, while relevant statistical parameters are calculated. For leaves, contour recognition and region segmentation are used to extract multi-dimensional features of geometry, color, texture, and morphology, and statistical data are obtained. Subsequently, the data is stored in a preset format and visualized in the form of charts, image annotations, etc. This workflow achieves standardized processing of phenotypic data from extraction to presentation, ensuring both the comprehensiveness and accuracy of feature parameters and making the data presentation intuitive and easy to understand, providing a reliable quantitative basis for related research and applications. Attached Figure Description
[0020] Figure 1 This is a flowchart of the rice seed and plant leaf phenotypic analysis method based on an RGB camera according to an embodiment of the present invention; Figure 2 This is a detailed flowchart of an embodiment of the present invention; Figure 3 This is a schematic diagram of the seed color segmentation process according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the blade region mask obtained after preprocessing in an embodiment of the present invention; Figure 5 This is a schematic diagram of seed labeling in an embodiment of the present invention; Figure 6 This is a schematic diagram of the system units in an embodiment of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0022] Example 1 Please refer to Figure 1 This embodiment 1 provides a method for phenotypic analysis of rice seeds and plant leaves based on an RGB camera, including: S1. Construct a portable acquisition system including support components, an image acquisition module, and a supplementary lighting module. Place rice seeds on a preset background, provide an appropriate light source through the supplementary lighting module, and acquire seed images using the image acquisition module. Place plant leaves on an appropriate background carrier, provide multi-angle supplementary lighting through the supplementary lighting module to eliminate shadow interference, and acquire leaf images using the image acquisition module. S2. Perform background adaptation processing and grayscale and binarization processing on the collected seed images to obtain a preprocessed image with prominent seed targets; perform color space conversion on the collected leaf images, extract leaf regions through threshold segmentation, and separate leaf and non-leaf parts by combining morphological operations to obtain a preprocessed image that retains only the effective leaf regions. S3. A target detection model is used to identify targets in the preprocessed seed image. After filtering out invalid detection results, the seed contour is extracted, and the geometric features, morphological features and related statistical parameters of the seed are calculated. The actual feature values are obtained by converting the scale. Image analysis methods are used to identify contours and segment regions in the preprocessed leaf image. The geometric features, color features, texture features and morphological features of the leaf are calculated respectively, and the statistical data of each feature are obtained. S4. Store and output the detailed characteristic parameters and overall statistical data of single samples of seeds and leaves in a preset file format; perform visualization processing on the phenotypic data of seeds and leaves, present the single sample data or statistical data in the form of charts, and mark the target area and related identification information on the original collected images, and output the visualization results.
[0023] Please refer to Figure 2This embodiment 1 further elaborates on the above steps.
[0024] (1) Set up the acquisition system and acquire images In the phenotypic analysis of rice seeds and plant leaves, image acquisition is a crucial step in obtaining basic data, and the quality of the acquired images directly affects the accuracy of subsequent processing and analysis results. Considering that phenotypic analysis requires the precise capture of key information such as seed morphological details, leaf texture features, and color differences, the image acquisition module must have a matching resolution to ensure that these subtle phenotypic features are clearly presented and to avoid the loss or blurring of feature information due to insufficient resolution.
[0025] Considering the actual needs and application scenarios of phenotypic analysis, and taking into account factors such as equipment cost, ease of operation, and data acquisition efficiency, an RGB camera was ultimately selected as the core image acquisition device. The RGB camera can accurately reproduce the color information and spatial details of rice seeds and plant leaves. Its imaging effect is perfectly suited to the extraction requirements of parameters such as seed geometry and leaf color characteristics in phenotypic analysis. Furthermore, compared to other professional imaging equipment, the RGB camera has the advantages of small size, simple operation, and high cost-effectiveness, making it more in line with the concept of building a portable acquisition system. This lays a solid foundation for conducting efficient and accurate phenotypic analysis in different scenarios.
[0026] (2) Image preprocessing of seeds and leaves Please refer to Figure 3 as well as Figure 4 In the analysis process of this embodiment, image preprocessing is a crucial step to ensure the accurate extraction of subsequent phenotypic features. Its core purpose is to eliminate irrelevant information such as background interference and illumination noise generated during image acquisition, highlight the target areas of seeds and leaves, and provide high-quality image data support for subsequent feature calculations.
[0027] For the acquired seed images, the core of preprocessing is to highlight the seed target through background adaptation, grayscale conversion, and binarization. The specific operation process is as follows: After reading the acquired seed image, convert it into a grayscale image, and set the grayscale value of any pixel in the grayscale image to be... ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value range is [0, 255]; Calculate the mean grayscale value of all pixels in the grayscale image. : in, This represents the total number of horizontal pixels in the grayscale image. This represents the total number of vertical pixels in the grayscale image. Based on the mean gray value Constructing a binarization threshold : in, This represents the maximum grayscale value of all pixels in the grayscale image. According to the binarization threshold Binarizing a grayscale image yields a binarized image, satisfying the following conditions: when When, the pixel value of this pixel in the binarized image is set to 255, when When this happens, the pixel value of that pixel in the binarized image is set to 0; The binarized image is pixel-fused with a custom-adapted background image. After fusion, the seed target region and the background region show significant pixel differences, resulting in a preprocessed image with prominent seed target.
[0028] For the acquired leaf images, the core of preprocessing is to extract the effective leaf region through color space conversion, threshold segmentation, and morphological operations. The specific operation process is as follows: the acquired leaf image is converted from the BGR color space to the HSV color space, and the hue value of any pixel in the HSV color space is set to... Saturation value Brightness value ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value range is [0, 179]; and The values are all in the range [0, 255]; calculate all pixels in the image. mean , mean and mean They respectively satisfy: in, This represents the total number of horizontal pixels in the leaf image. This represents the total number of vertical pixels in the leaf image. Based on the above averages, an HSV threshold range is constructed, that is, a hue threshold range based on... Centered on the range of natural fluctuations in the green hue of rice leaves, the saturation threshold range is defined as follows: Centered on the range of effective rice leaf color purity fluctuation characteristics, the brightness threshold range is defined as follows: Centered on the range of reasonable variations in the brightness of rice leaves after exposure to light; Determine each pixel , , If the pixel is simultaneously within the corresponding threshold range, it is determined to be a leaf region pixel and the pixel value is set to 255. Otherwise, it is determined to be a non-leaf region pixel and the pixel value is set to 0. Through the above threshold segmentation operation, the leaf region and non-leaf region are separated, and the preliminary mask image of the leaf region is extracted.
[0029] Since the initial mask image may contain discrete, non-leaf micro-impurities and lighting noise, and the leaf contours may be irregular, further morphological operations are needed for optimization. Let the initial mask image of the leaf region obtained from threshold segmentation be... ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value can be 0 or 255. A value of 0 indicates a non-leaf pixel, and a value of 255 indicates a leaf pixel candidate. Constructing structured elements adapted to the texture and minute noise scale of rice leaves. Its size is determined by the characteristics of the leaf texture and the scale of common micro-noise. The set of pixels contained therein is ,in This represents the horizontal pixel count of the structured element. The vertical pixel count of the resulting structured element; right Perform morphological erosion to obtain the eroded image. The corrosion operation meets the requirements. That is, the value of each pixel is updated to its value in the structured element. The minimum value of all pixel values within the neighborhood is used to dissolve and discretize non-leaf micro-impurities and light noise. Based on the same structured element right Perform morphological dilation to obtain the dilated image. The expansion operation satisfies That is, the value of each pixel is updated to its value in the structured element. The maximum value of all pixels in the neighborhood is used to restore the complete outline of the leaf body and compensate for edge pixel loss. After the above corrosion-expansion combined operation, The outline of the blade region is regular and clear, and the non-blade parts are completely stripped away, resulting in a preprocessed image that retains only the effective area of the blade.
[0030] (3) Phenotypic feature detection and extraction After preprocessing the rice seed and leaf images, further phenotypic feature extraction and calculation are required. This step is the core of phenotypic analysis, aiming to provide data support for subsequent applications such as variety identification and growth status assessment by extracting core feature parameters of seeds and leaves. Specifically, for the preprocessed seed images, a target detection model is used to achieve target recognition and feature calculation; for the preprocessed leaf images, image analysis methods are used to complete contour recognition and multi-dimensional feature extraction. The detailed process is as follows: For the preprocessed seed images, the feature calculation process proceeds step-by-step, revolving around target recognition, contour extraction, feature calculation, and statistical analysis: First, a target detection model is used to identify targets in the preprocessed seed images, locating each seed in the image while filtering out invalid detection results caused by image noise, background residue, and other factors, ensuring the accuracy of subsequent analysis. Then, based on the valid detection results, the contour of a single seed is extracted. This contour consists of a series of continuous pixels, each with clearly defined image coordinates. These coordinates form the basis for subsequent feature calculations. To achieve the conversion from image pixel scale to actual physical scale, the image needs to be calibrated beforehand to determine the actual length conversion factor corresponding to each unit pixel.
[0031] Specifically, suppose that after target recognition and invalid result filtering, the extracted single seed contour of the preprocessed seed image is... ,contour The corresponding set of pixels is ,in For the outline of the first Image coordinates of 1 pixel, For outline The total number of pixels contained. The pixel-to-actual length conversion factor for image calibration (i.e., the actual length corresponding to a unit pixel); Calculate seed geometric features: Obtain the contour using the minimum bounding rectangle algorithm. The minimum bounding rectangle of the given array has a horizontal side length corresponding to the number of pixels. The number of pixels corresponding to the vertical side length is The actual grain width of the seed Actual particle length ; Contour calculation based on shoelace formula Pixel area of the enclosed region ,in , The actual area of the seed ;contour pixel perimeter The actual perimeter of the seed Seed length-to-width ratio ; Calculate seed morphological characteristics: seed roundness This value reflects how close the seed outline is to a circle; Calculate relevant statistical parameters: seed length for all tested seeds. Particle width ,area ,perimeter Aspect Ratio and roundness Sum them separately, then divide by the total number of seeds tested. The mean of each feature is obtained. The standard deviation is calculated by the deviation of each characteristic value from its corresponding mean. ,Right now ,in For the first A certain characteristic value of a seed. The mean of this feature is used to calculate the seed's geometric features, morphological features, and related statistical parameters.
[0032] For the preprocessed leaf image, the feature calculation process is based on contour recognition and region segmentation, gradually extracting four types of features: geometry, color, texture, and morphology. First, contour recognition and region segmentation are performed on the preprocessed leaf image to determine the effective region corresponding to a single leaf, and a mask image for that region is generated. In this mask image, the pixel value of the effective leaf region is set to 255, and the pixel value of the non-leaf region is set to 0. This binary distinction precisely limits the range of feature calculation. Simultaneously, the contour of the effective leaf region is extracted. This contour consists of a series of continuous pixels, each with a defined image coordinate system. Furthermore, the pixel-to-actual length conversion factor of the image needs to be pre-calibrated for subsequent physical scale conversion.
[0033] Specifically, let's assume that after contour recognition and region segmentation, the effective region mask image corresponding to a single leaf in the preprocessed leaf image is... ,in The image coordinates of the pixel are... Represents the horizontal coordinate value. Represents the vertical coordinate value. The time represents the effective pixels of the leaf. The time frame represents non-blade pixels; blade outline. The set of pixels is , This represents the total number of outline pixels. A pixel-to-actual length conversion factor for image calibration; In terms of geometric feature calculation, leaf pixel area Count the total number of pixels with a value of 255 in the mask, and the actual area. Leaf pixel perimeter ,in , Actual perimeter The contour is obtained using the minimum bounding rectangle algorithm. The minimum bounding rectangle, whose horizontal pixel side length is... Vertical pixel side length Corresponding to actual leaf width Actual leaf length Aspect Ratio Skeleton extraction is performed on the petiole region mask to obtain single-pixel skeleton lines, and the total number of skeleton line pixels is counted. Actual petiole length Contours are obtained using the convex hull algorithm. convex hull contour Calculate the pixel area of the convex hull based on the shoelace formula. , This represents the total number of pixels on the convex hull contour. , Actual convex hull area ; When calculating color features, the mask is traversed. Extract the hue value of each valid pixel from all valid pixels. Saturation value Brightness value The mean values were calculated separately. Set a green HSV detection range and count the number of pixels within the mask that match this range. Green pixel ratio ; Texture feature calculation requires first converting the effective area image of the leaf into a grayscale image. Then calculate the statistical parameters of the grayscale histogram: mean. Standard error Smoothness Third moment Uniformity , grayscale value The probability of occurrence; entropy , The value of this item is 0 at that time; In morphological feature calculation, the fractal dimension is calculated using box counting at different scales. The square box covers the leaf outline Statistical coverage requires the minimum number of boxes. fractal dimension Leaf density is based on the actual area of the leaf blade. Compared with the actual area of the convex hull Calculation, density This reflects the compactness of the blade profile.
[0034] (4) Data output and visualization After extracting and calculating the phenotypic features of rice seeds and plant leaves, all the obtained data needs to be stored, output, and visualized. The core purpose of this step is to transform the abstract feature parameters into an intuitive and easy-to-understand result format, which not only facilitates long-term data storage and subsequent analysis but also provides a clear reference for related research and production applications. The specific process is as follows: First, data storage and output are carried out. The detailed feature parameters of each single sample and the overall statistical data obtained in the previous calculations are classified and organized. The detailed feature parameters of each single sample include information such as the length, width, area, perimeter, aspect ratio, and roundness of each seed, as well as the geometric, color, texture, and morphological characteristics of each leaf. The overall statistical data covers indicators reflecting population characteristics, such as the mean and standard deviation of various features for all tested seeds and leaves. This classified and organized data is stored according to a preset file format. This preset file format must meet the requirements of convenient data reading and complete information storage, enabling the classification and archiving of single sample data and statistical data. After storage, the files are output to provide data support for subsequent data analysis and applications.
[0035] Subsequently, the visualization of the phenotypic data was carried out, presenting the data content in various forms to ultimately form a complete visualization result, which is divided into three categories: The first category is data charts. Based on the attributes of different characteristic parameters and display requirements, preset types of charts are used to present the phenotypic data of seeds and leaves. For single sample data, charts can intuitively display the specific values of various characteristics of each seed and each leaf. For overall statistical data, charts can present information such as the numerical distribution of various characteristics, population mean, and dispersion. The characteristics covered by the charts include the geometric characteristics, morphological characteristics, and related statistical data of seeds, as well as the geometric characteristics, color characteristics, texture characteristics, morphological characteristics, and related statistical data of leaves, making it easier for researchers to quickly grasp the overall patterns and individual differences in the data.
[0036] Please refer to Figure 5 The second category is image annotation, which involves marking target regions and assigning unique identification numbers to the original images of seeds and leaves. Target region marking accurately locates the specific position of each seed and leaf in the original image, clearly distinguishing the regions of different samples; the unique identification number assigns a unique identifier to each sample, enabling precise association between the sample in the original image and the corresponding feature parameter data, avoiding sample confusion, and ensuring rapid matching of images and data during subsequent review.
[0037] The third category is feature identification. In the original image after labeling the target region and unique identification number, core phenotypic feature parameters corresponding to the single sample identification number are further labeled. These core parameters are indicators that reflect the key characteristics of the sample, such as seed length, width, and roundness; leaf length, width, and green pixel ratio. Directly labeling these parameters next to the corresponding sample's image area enables an intuitive correspondence between the image and the core data. This allows for quick understanding of the sample's key phenotypic information without consulting additional data files, improving the efficiency of data retrieval and analysis.
[0038] Through the above storage output and visualization processing, complete phenotypic analysis results are generated, providing comprehensive and intuitive data support for related research on rice seeds and plant leaves, variety selection, growth status assessment, and other work.
[0039] The analysis method provided in this embodiment, with its flexible deployment of portable acquisition systems, standardized image preprocessing workflow, and precise multi-dimensional feature extraction capabilities, can be widely applied in rice breeding research. This method can quickly acquire key indicators such as the geometric morphology and population dispersion of large batches of seeds, as well as phenotypic parameters such as leaf color, texture, and morphology at different growth stages. This provides objective and quantitative data support for early screening of breeding materials and identification of superior traits, effectively shortening the breeding cycle, improving breeding efficiency, and contributing to the cultivation of high-yield and high-quality new rice varieties.
[0040] Meanwhile, this method can also be extended to the field of rice field cultivation management and growth monitoring. By dynamically tracking and analyzing the phenotypic characteristics of rice leaves under different cultivation conditions, the growth and health status of plants and the level of nutrient supply and demand can be assessed in real time. Combined with seed phenotypic data, a correlation model of phenotype-genotype-environmental factors throughout the entire growth period can be established, providing technical support for intelligent cultivation decision-making, pest and disease early warning and yield prediction in precision agriculture, and promoting the development of rice production towards refinement and efficiency.
[0041] Example 2 Please refer to Figure 6This embodiment 2 provides a rice seed and plant leaf phenotypic analysis system based on an RGB camera, including: The acquisition system and image acquisition unit are used to build a portable acquisition system including support components, image acquisition module and supplementary lighting module. Rice seeds are placed on a preset background, and an appropriate light source is provided by the supplementary lighting module. The image acquisition module is used to acquire the seed image. Plant leaves are placed on an appropriate background carrier, and multi-angle supplementary lighting is provided by the supplementary lighting module to eliminate shadow interference. The image acquisition module is used to acquire the leaf image. The seed and leaf image preprocessing unit is used to perform background adaptation processing and grayscale and binarization processing on the acquired seed images to obtain a preprocessed image with prominent seed targets; and to perform color space conversion on the acquired leaf images, extract leaf regions through threshold segmentation, and separate leaf and non-leaf parts by combining morphological operations to obtain a preprocessed image that retains only the effective leaf regions. The phenotypic feature detection and extraction unit is used to perform target recognition on the seed preprocessed image using a target detection model, extract the seed contour after filtering invalid detection results, calculate the geometric features, morphological features and related statistical parameters of the seed, and obtain the actual feature values by combining the scale bar conversion; the image analysis method is used to perform contour recognition and region segmentation on the leaf preprocessed image, calculate the geometric features, color features, texture features and morphological features of the leaf respectively, and obtain the statistical data of each feature at the same time. The data output and visualization unit is used to store and output detailed characteristic parameters and overall statistical data of single samples of seeds and leaves in a preset file format; to visualize the phenotypic data of seeds and leaves, to present single sample data or statistical data in the form of charts, and to mark the target area and related identification information on the original collected image, and output the visualization results.
[0042] Example 3 This embodiment 3 also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement any step of a method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera.
[0043] The computer-readable storage medium may include 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.
[0044] For a description of the computer-readable storage medium provided in this application, please refer to the above method embodiments; further details will not be repeated here.
[0045] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for phenotypic analysis of rice seeds and plant leaves based on an RGB camera, characterized in that, include: S1. Construct a portable acquisition system including support components, an image acquisition module, and a supplementary lighting module. Place rice seeds on a preset background, provide an appropriate light source through the supplementary lighting module, and acquire seed images using the image acquisition module. Place plant leaves on an appropriate background carrier, provide multi-angle supplementary lighting through the supplementary lighting module to eliminate shadow interference, and acquire leaf images using the image acquisition module. S2. Perform background adaptation processing and grayscale and binarization processing on the acquired seed images to obtain a preprocessed image with prominent seed targets; The acquired leaf images are converted to color space, the leaf region is extracted by threshold segmentation, and the leaf and non-leaf parts are separated by morphological operations to obtain a preprocessed image that retains only the effective leaf region. S3. Use a target detection model to identify targets in the preprocessed seed image, filter out invalid detection results, extract seed contours, calculate the geometric features, morphological features and related statistical parameters of the seed, and convert them with the scale to obtain the actual feature values. Image analysis methods were used to perform contour recognition and region segmentation on the preprocessed leaf images, and the geometric features, color features, texture features and morphological features of the leaves were calculated respectively. At the same time, statistical data of each feature were obtained. S4. Store and output the detailed characteristic parameters of a single sample of seeds and leaves and the overall statistical data in a preset file format; The phenotypic data of seeds and leaves are visualized, and single sample data or statistical data are presented in the form of charts. At the same time, the target area and related identification information are marked on the original collected images, and the visualization results are output.
2. The method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera according to claim 1, characterized in that, The image acquisition module in S1 has a resolution that meets the requirements of phenotypic analysis, and it uses an RGB camera.
3. The method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera according to claim 1, characterized in that, The process of obtaining the preprocessed image with the seed target highlighted in S2 is as follows: After reading the acquired seed image, convert it to a grayscale image. Let the grayscale value of any pixel in the grayscale image be... ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value range is [0, 255]; Calculate the mean grayscale value of all pixels in the grayscale image. : in, This represents the total number of horizontal pixels in the grayscale image. This represents the total number of vertical pixels in the grayscale image. Based on the mean gray value Constructing a binarization threshold : in, This represents the maximum grayscale value of all pixels in the grayscale image. According to the binarization threshold Binarizing a grayscale image yields a binarized image, satisfying the following conditions: when When, the pixel value of this pixel in the binarized image is set to 255, when When this happens, the pixel value of that pixel in the binarized image is set to 0; The binarized image is pixel-fused with a custom-adapted background image. After fusion, the seed target region and the background region show significant pixel differences, resulting in a preprocessed image with prominent seed target.
4. The method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera according to claim 1, characterized in that, The process of extracting the leaf region by threshold segmentation in S2 is as follows: The acquired leaf images were converted from the BGR color space to the HSV color space. The hue value of any pixel in the HSV color space was set to... Saturation value Brightness value ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value range is [0, 179]; and The values are all in the range [0, 255]; calculate all pixels in the image. mean , mean and mean They respectively satisfy: in, This represents the total number of horizontal pixels in the leaf image. This represents the total number of vertical pixels in the leaf image. Based on the above averages, an HSV threshold range is constructed, that is, a hue threshold range based on... Centered on the range of natural fluctuations in the green hue of rice leaves, the saturation threshold range is defined as follows: Centered on the range of effective rice leaf color purity fluctuation characteristics, the brightness threshold range is defined as follows: Centered on the range of reasonable variations in the brightness of rice leaves after exposure to light; Determine each pixel , , If the pixel is simultaneously within the corresponding threshold range, it is determined to be a leaf region pixel and the pixel value is set to 255. Otherwise, it is determined to be a non-leaf region pixel and the pixel value is set to 0. Through the above threshold segmentation operation, the leaf region and non-leaf region are separated, and the preliminary mask image of the leaf region is extracted.
5. The method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera according to claim 1, characterized in that, The process of separating the blade and non-blade parts by combining morphological operations in S2 is as follows: Let the initial mask image of the leaf region obtained by threshold segmentation be... ,in These are the coordinates of the pixel in the image coordinate system. This represents the horizontal coordinate value of a pixel. Represents the vertical coordinate value of a pixel. The value can be 0 or 255. A value of 0 indicates a non-leaf pixel, and a value of 255 indicates a leaf pixel candidate. Constructing structured elements adapted to the texture and minute noise scale of rice leaves. Its size is determined by the characteristics of the leaf texture and the scale of common micro-noise. The set of pixels contained therein is ,in This represents the horizontal pixel count of the structured element. The vertical pixel count of the resulting structured element; right Perform morphological erosion to obtain the eroded image. The corrosion operation meets the requirements. That is, the value of each pixel is updated to its value in the structured element. The minimum value of all pixel values within the neighborhood is used to dissolve and discretize non-leaf micro-impurities and light noise. Based on the same structured element right Perform morphological dilation to obtain the dilated image. The expansion operation satisfies That is, the value of each pixel is updated to its value in the structured element. The maximum value of all pixels in the neighborhood is used to restore the complete outline of the leaf body and compensate for edge pixel loss. After the above corrosion-expansion combined operation, The outline of the blade region is regular and clear, and the non-blade parts are completely stripped away, resulting in a preprocessed image that retains only the effective area of the blade.
6. The method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera according to claim 1, characterized in that, The process of calculating the geometric characteristics, morphological characteristics, and related statistical parameters of the seed in S3 is as follows: Suppose that after target recognition and filtering of invalid results, the extracted contour of a single seed in the preprocessed seed image is... ,contour The corresponding set of pixels is ,in For the outline of the first Image coordinates of 1 pixel, For outline The total number of pixels contained. A pixel-to-actual length conversion factor for image calibration; Calculate seed geometric features: Obtain the contour using the minimum bounding rectangle algorithm. The minimum bounding rectangle of the given array has a horizontal side length corresponding to the number of pixels. The number of pixels corresponding to the vertical side length is The actual grain width of the seed Actual particle length ; Contour calculation based on shoelace formula Pixel area of the enclosed region ,in , The actual area of the seed ;contour pixel perimeter The actual perimeter of the seed Seed length-to-width ratio ; Calculate seed morphological characteristics: seed roundness This value reflects how close the seed outline is to a circle; Calculate relevant statistical parameters: seed length for all tested seeds. Particle width ,area ,perimeter Aspect Ratio and roundness Sum them separately, then divide by the total number of seeds tested. The mean of each feature is obtained. The standard deviation is calculated by the deviation of each characteristic value from its corresponding mean. ,Right now ,in For the first A certain characteristic value of a seed. The mean of this feature is used to calculate the seed's geometric features, morphological features, and related statistical parameters.
7. The method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera according to claim 1, characterized in that, The process of calculating the geometric, color, texture, and morphological features of the blade in S3 is as follows: Suppose that after contour recognition and region segmentation, the effective region mask image corresponding to a single leaf is... ,in The image coordinates of the pixel are... Represents the horizontal coordinate value. Represents the vertical coordinate value. The time represents the effective pixels of the leaf. The time frame represents non-blade pixels; blade outline. The set of pixels is , This represents the total number of outline pixels. A pixel-to-actual length conversion factor for image calibration; In terms of geometric feature calculation, leaf pixel area Count the total number of pixels with a value of 255 in the mask, and the actual area. Leaf pixel perimeter ,in , Actual perimeter The contour is obtained using the minimum bounding rectangle algorithm. The minimum bounding rectangle, whose horizontal pixel side length is... Vertical pixel side length Corresponding to actual leaf width Actual leaf length Aspect Ratio Skeleton extraction is performed on the petiole region mask to obtain single-pixel skeleton lines, and the total number of skeleton line pixels is counted. Actual petiole length Contours are obtained using the convex hull algorithm. convex hull contour Calculate the pixel area of the convex hull based on the shoelace formula. , This represents the total number of pixels on the convex hull contour. , Actual convex hull area ; When calculating color features, the mask is traversed. Extract the hue value of each valid pixel from all valid pixels. Saturation value Brightness value The mean values were calculated separately. ; Define a green HSV detection range and count the number of pixels within the mask that match this range. Green pixel ratio ; Texture feature calculation requires first converting the effective area image of the leaf into a grayscale image. Then calculate the statistical parameters of the grayscale histogram: mean. Standard error Smoothness Third moment Uniformity , grayscale value The probability of occurrence; entropy , The value of this item is 0 at that time; In morphological feature calculation, the fractal dimension is calculated using box counting at different scales. The square box covers the leaf outline Statistical coverage requires the minimum number of boxes. fractal dimension Leaf density is based on the actual area of the leaf blade. Compared with the actual area of the convex hull Calculation, density This reflects the compactness of the blade profile.
8. The method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera according to claim 1, characterized in that, The visualization results in S4 include: Data Charts: Visual charts of seed and leaf phenotypic data presented in preset chart types, covering the numerical distribution and statistical information of geometric features, morphological features, color features, texture features and related statistical data of single samples or all tested samples; Image annotation: Marking target areas and unique identification numbers for each sample on the original images of seeds and leaves to achieve accurate association between samples and data; Feature Identifiers: In the labeled original acquired images, the core phenotypic feature parameters corresponding to the single sample identification number are identified, intuitively presenting the key phenotypic information of the single sample.
9. A phenotypic analysis system for rice seeds and plant leaves based on an RGB camera, characterized in that, include: The acquisition system and image acquisition unit are used to build a portable acquisition system including support components, image acquisition module and supplementary lighting module. Rice seeds are placed on a preset background, and an appropriate light source is provided by the supplementary lighting module. The image acquisition module is used to acquire the seed image. Plant leaves are placed on an appropriate background carrier, and multi-angle supplementary lighting is provided by the supplementary lighting module to eliminate shadow interference. The image acquisition module is used to acquire the leaf image. The seed and leaf image preprocessing unit is used to perform background adaptation processing and grayscale and binarization processing on the acquired seed images to obtain preprocessed images with prominent seed targets. The acquired leaf images are converted to color space, the leaf region is extracted by threshold segmentation, and the leaf and non-leaf parts are separated by morphological operations to obtain a preprocessed image that retains only the effective leaf region. The phenotypic feature detection and extraction unit is used to perform target recognition on the seed preprocessed image using a target detection model, extract the seed contour after filtering out invalid detection results, calculate the geometric features, morphological features and related statistical parameters of the seed, and obtain the actual feature value by combining the scale bar conversion. Image analysis methods were used to perform contour recognition and region segmentation on the preprocessed leaf images, and the geometric features, color features, texture features and morphological features of the leaves were calculated respectively. At the same time, statistical data of each feature were obtained. The data output and visualization unit is used to store and output detailed characteristic parameters and overall statistical data of single samples of seeds and leaves in a preset file format; The phenotypic data of seeds and leaves are visualized, and single sample data or statistical data are presented in the form of charts. At the same time, the target area and related identification information are marked on the original collected images, and the visualization results are output.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor according to any one of claims 1-8, a method for analyzing the phenotypic characteristics of rice seeds and plant leaves based on an RGB camera.