Artificial intelligence-based stem canola type measurement method and system

CN122821147APending Publication Date: 2026-09-25CHONGQING YUDONGNAN ACAD OF AGRI SCI (CHONGQING FULING MUSTARD RES INST)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611205412.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-10
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0005]针对现有茎瘤芥人工测量效率低、接触损伤、激光标定方案硬件成本高的问题,本发明提供一种基于人工智能的茎瘤芥菜型测量方法及系统,已达到低成本、无损、多维度菜型参数自动测量的目的

Benefits of technology

[0008]摒弃游标卡尺、直尺人工夹持接触式测量方式,仅通过手机RGB图像视觉采集,全程不触碰、不挤压茎瘤芥瘤块,避免表皮划伤、破损腐烂问题,既减少商品损耗,又能完好保存稀缺育种试验材料,适用于高价值种质资源批量性状采集。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122821147A_ABST
    Figure CN122821147A_ABST
Patent Text Reader

Abstract

The application discloses a stem and tumor mustard type measuring method and system based on artificial intelligence, and relates to the technical field of nondestructive testing of vegetable phenotypes. The application takes a national standard A4 paper as a general size calibration reference object, only adopts an intelligent mobile phone to collect an RGB image, realizes stem and tumor mustard and A4 paper pixel-level mask extraction through a light-weight YOLO semantic segmentation model, solves a homography transformation matrix by using an A4 standard physical size to complete perspective distortion correction, and establishes pixel / millimeter physical coordinate mapping. Based on the corrected stem and tumor mustard contour, long axis, short axis, projected area, circumference, roundness and volume estimation values are calculated in batches. The application does not need additional hardware such as a laser and a customized calibration plate, is portable and can be deployed in the field, solves the problems of low efficiency and contact damage in traditional manual measurement, and is suitable for stem and tumor mustard breeding screening, field purchase and processing grading scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-destructive visual measurement technology of vegetable crop phenotypes, and in particular to a multi-dimensional measurement method and system for stem-nodled mustard tuber based on artificial intelligence, which is applicable to scenarios such as pickled mustard tuber breeding trait screening, field acquisition and grading, and raw material quality testing in processing plants. Background Technology

[0002] Stem tuber mustard is a specialty economic vegetable in southwestern my country. The size and regularity of the tubers directly determine the market price and processing utilization rate. Breeding and purchasing processes require the collection of large quantities of vegetable shape indicators such as long and short axes, projected area, and roundness. Currently, stem tuber mustard size detection methods include manual measurement, underwater laser vision measurement, and fixed calibration plate vision measurement, all of which have significant technical shortcomings.

[0003] Traditional manual measurement relies on rulers and calipers to measure each specimen individually, which has three major drawbacks: 1. The efficiency of batch sample measurement is extremely low, with measurement of hundreds of samples taking more than 2 hours, which cannot meet the needs of high-throughput breeding screening; 2. The calipers can easily scratch the surface of the nodules, causing decay and loss, and precious breeding materials are easily damaged; 3. Only linear length and width can be obtained, and complex morphological parameters such as projected area, outline perimeter, and roundness cannot be accurately calculated, resulting in a lack of dimensions of breeding trait data.

[0004] Other conventional crop visual measurement solutions use customized calibration boards as size benchmarks, but these boards are bulky and inconvenient to carry in the field. Some solutions only use target detection boxes to locate crops, which cannot extract complete entity outlines, resulting in area and perimeter calculation deviations exceeding 8%. They also lack automatic batch data export and commodity grading functions, and manual record keeping is still required after measurement, resulting in low automation. Summary of the Invention

[0005] To address the problems of low efficiency, contact damage, and high hardware cost of existing manual measurement methods for stem mustard, this invention provides an artificial intelligence-based method and system for measuring stem mustard vegetable type, achieving low-cost, non-destructive, and multi-dimensional automatic measurement of vegetable type parameters.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a method for measuring stem nodule type in mustard greens based on artificial intelligence, comprising the following steps: Step S1, Standardized Image Acquisition Step: Lay a standard A4 white paper flat on a hard table, and place the stem mustard to be tested completely inside the boundary of the A4 paper, with no area exceeding the edge of the paper; use a smartphone RGB camera to take a picture under natural light or supplemental light conditions to obtain an original RGB image containing the complete A4 paper and stem mustard; Step S2, Image Preprocessing and Artificial Intelligence Semantic Segmentation: Gaussian smoothing filtering is applied to the original RGB image to remove noise, and the image is uniformly scaled to the fixed input resolution of the model; a lightweight YOLO semantic segmentation model is used to complete pixel-level binary classification inference, and two types of pixel masks, namely A4 paper mask and stem mustard mask, are output; morphological opening and closing operations are used to remove mask holes and edge noise, and continuous and complete contours are extracted. Step S3, Perspective Correction and Pixel-Physical Coordinate Mapping: Extract the pixel coordinates of the four corners of the image of the minimum bounding quadrilateral of the A4 paper mask; establish a physical coordinate system based on the standard size of A4 paper (210mm × 297mm), match the standard physical coordinates of the four corners of the paper, and solve the 3×3 homography transformation matrix using the least squares method; map all the contour pixels of the stem mustard to the millimeter standard physical plane through the homography matrix to eliminate perspective distortion during shooting; a built-in corner missing fault tolerance mechanism is used to interpolate and complete the fourth corner point based on the length and width constraints of the paper when only 3 corner points are extracted; Step S4, Batch Calculation of Multi-Dimensional Stem-Nodular Mustard Type Parameters: Based on the corrected physical contour point set of stem-nodular mustard, call the contour analysis function to calculate the linear size, area contour, morphological features, and estimated volume of the complete set of vegetable type parameters. Step S5, Batch Result Output and Data Management: Supports automatic serial processing of single / batch images, binding sample numbers and shooting time to store all measurement parameters; visualizes the output of segmentation masks and dimension annotation effect diagrams; generates structured tables and exports measurement reports in CSV or Excel format; has a built-in grading threshold library to automatically determine the product grade based on the dish type parameters and write it into the report.

[0007] The beneficial effects of this solution are as follows: This invention uses only the general national standard A4 white paper as the dimensional calibration benchmark, without the need for customized calibration boards, laser rangefinders, industrial cameras and other expensive special equipment. The data acquisition hardware is just an ordinary smartphone, and a portable small ring soft light can be added as an option. The whole set of equipment is lightweight and easy to carry, and can be used on-site in breeding laboratories, open field collection points and raw material workshops of processing plants, which greatly reduces the investment and transportation costs of phenotypic measurement equipment.

[0008] Abandoning the manual contact measurement method using vernier calipers and rulers, this method acquires data solely through visual acquisition of RGB images from a mobile phone. The entire process is conducted without touching or squeezing the stem mustard tubercle, avoiding issues such as epidermal scratches, damage, and rot. This reduces product loss and preserves rare breeding experimental materials intact, making it suitable for the batch collection of traits from high-value germplasm resources.

[0009] The lightweight YOLOv8-seg model is deployed on the mobile NPU to complete local offline segmentation inference. Images do not need to be uploaded to the cloud, eliminating the problem of processing interruptions caused by lack of network or poor signal in the field. At the same time, it avoids the data security risks of transmitting sample images outside the field. Breeding test data and raw material acquisition data are stored locally, which enhances confidentiality.

[0010] Breaking through the limitations of traditional manual measurement which can only measure linear dimensions of length and width, this system simultaneously outputs a complete set of morphological indicators, including major axis, minor axis, aspect ratio, projected area, perimeter, roundness, and estimated volume of the ellipsoid. The roundness quantification of nodule regularity and ellipsoid volume can be used to predict the yield of a single plant, providing complete quantitative phenotypic data for stem mustard germplasm selection and quality evaluation of processed raw materials, filling the gap in the lack of complex morphological parameters in manual measurement.

[0011] The measurement process synchronously outputs segmentation mask images and dimension annotation effect images for local storage, allowing operators to intuitively check whether the segmentation outlines of A4 paper and stem mustard are complete; when shooting fails, it outputs a visual image of mask noise, intuitively indicating problems such as insufficient lighting, paper wrinkles, and soil obstruction, allowing beginners to quickly adjust shooting conditions and lowering the barrier to entry; historical images and annotation images are cached locally for a long time, and measurement data can be traced and reviewed.

[0012] Preferably, step S1 is equipped with a portable ring soft light filler module to eliminate local shadows caused by backlighting and sidelighting, and reduce the reshoot rate.

[0013] Preferably, the lightweight YOLO semantic segmentation model in step S2 is a YOLOv8-seg network, deployed on a mobile NPU for offline inference; the model training dataset includes labeled images of scenes with wrinkled A4 paper, soil-covered stems and mustard, multiple lighting conditions, and a small number of overlapping samples; training hyperparameters: foreground IoU (Intersection over Union) threshold of 0.7, background IoU threshold of 0.3, weight decay coefficient of 0.0005, batch size of 4, number of iterations ≥ 300,000, and model input resolution of 640×640.

[0014] Beneficial effects: The lightweight model is adapted to mobile NPU hardware, enabling fast offline inference and short processing time for single image segmentation, supporting high-throughput batch processing; the training dataset covers real and complex field scenarios such as wrinkled A4 paper, soil nodules, multiple lighting conditions, and overlapping samples, demonstrating strong generalization ability, and the ability to extract continuous contours even with slight soil occlusion and paper deformation; matching dedicated training hyperparameters optimizes segmentation accuracy, clearly distinguishes foreground and background IoU thresholds, minimizes mask noise, and significantly reduces the risk of contour distortion in subsequent morphological processing; the fixed input resolution of 640×640 balances inference speed and detailed segmentation accuracy, and more than 300,000 iterations ensure the stability of field sample recognition.

[0015] Preferably, the vegetable shape parameters in step S4 include: the major axis and minor axis of the smallest circumscribed rectangle, the maximum Feret diameter, the projected area, the perimeter of the outline, the aspect ratio, roundness, and the estimated volume of the ellipsoid; the roundness calculation formula.

[0016] , For the projected area, The perimeter of the outline; formula for estimating the volume of an ellipsoid.

[0017] , The length of the major axis. This is the length of the minor axis.

[0018] Beneficial effects: The roundness formula quantifies the regularity of the nodule's shape; the closer the value is to 1, the better the product's appearance quality, providing an objective quantitative indicator for appearance grading and replacing subjective human judgment. The ellipsoidal volume estimation formula quickly estimates the actual volume of the nodule based on its major and minor axis dimensions, eliminating the need for complex volume measurement methods such as underwater drainage. It can be quickly used for field yield prediction of individual plants and screening for yield traits in breeding, obtaining yield-related phenotypic data at low cost.

[0019] Preferably, if the extraction of the four corners of the A4 paper fails completely in step S3, the system will pop up a window to prompt the operator to retake the shot, and simultaneously output a mask noise visualization image to assist in adjusting the shooting lighting and angle.

[0020] Preferably, the built-in fields of the report exported in step S5 include sample ID, shooting time, major axis, minor axis, projected area, perimeter, roundness, estimated volume, product grading label, and measurement error reference value.

[0021] The report integrates all dimensions of fields, including sample ID, shooting time, size, morphology, volume, grading, and error. The data is structured and standardized, and can be directly imported into breeding data analysis software and enterprise acquisition management systems without the need for manual secondary data entry. It also has built-in measurement error reference values, which allow for intuitive judgment of the reliability of single-sample measurements during scientific research experiments, thereby improving the reliability of experimental data.

[0022] In addition, this application provides an artificial intelligence-based stem nodule mustard type measurement system, based on the aforementioned stem nodule mustard type measurement method; the system is divided into a hardware acquisition unit and a software processing unit; The hardware acquisition unit includes a smartphone with RGB image acquisition capabilities, a standard A4 calibration paper, and a ring-shaped soft light supplement lamp. The software processing unit is integrated into the mobile client and includes an image acquisition and preprocessing module, a YOLO artificial intelligence semantic segmentation and reasoning module, a perspective correction coordinate mapping module, a multi-dimensional dish type calculation and grading module, and a batch data management and export module. The image acquisition preprocessing module is used to perform image smoothing and resolution scaling preprocessing in steps S1 and S2. The YOLO AI semantic segmentation and reasoning module is used to output A4 paper and stem mustard double mask and complete morphological post-processing. The perspective correction coordinate mapping module is used to extract corner points of A4 paper, solve the homography matrix, and complete the physical coordinate transformation and corner point fault-tolerant completion of the stem mustard outline; The multi-dimensional vegetable type calculation and grading module is used to calculate all vegetable type parameters in batches and automatically grade stem mustard products based on built-in thresholds. The batch data management and export module is used for batch serial processing of images, local storage of original images and labeled effect diagrams, and generation and export of standardized measurement reports.

[0023] Beneficial effects: The system features modular hardware and software design, with all hardware components being readily available commercial products, eliminating the need for customization and reducing procurement and replacement costs. The software client's five functional modules are decoupled, allowing for independent iterative optimization of the segmentation algorithm, correction logic, grading thresholds, and report templates, resulting in strong scalability. Except for stem mustard, only the model training dataset needs to be changed, the calibration paper size modified, and the grading threshold library adjusted to adapt to A3 / A5 standard paper for phenotypic measurements of other root and tuberous vegetables (radishes, turnips, etc.). The solution is highly versatile and has a wide range of applications. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the complete process steps of the stem nodule-type measurement method of the present invention.

[0025] Figure 2 This is a functional block diagram of the software processing unit of the present invention.

[0026] Figure 3 This is a schematic diagram of the overall measurement system hardware composition of the present invention.

[0027] The attached figures are labeled as follows: 1. Smartphone; 2. RGB camera; 3. Soft light; 4. Phone holder; 5. A4 paper; 6. Desktop; 7. Stem mustard. Detailed Implementation

[0028] The following detailed description illustrates the specific implementation method: Example 1: like Figure 1 As shown in this embodiment, the artificial intelligence-based method for measuring stem nodules in mustard greens includes the following steps: Step S1, Standardized Image Acquisition: Lay a standard 210mm×297mm A4 white paper flat on a smooth, hard surface. Place a single stem-nodular mustard plant completely within the boundary of the A4 paper, ensuring that no area of ​​the nodule extends beyond the edge of the paper. Use the built-in RGB camera of a smartphone to capture an original RGB image containing the complete A4 paper and the stem-nodular mustard plant under natural light or uniform illumination from a ring light. Avoid large areas of shadow, severely wrinkled paper, and large areas of soil obscuring the nodule outline during the shooting process. A portable ring soft light module can be optionally installed to eliminate interference from backlighting and sidelighting.

[0029] Step S2, image preprocessing and artificial intelligence semantic segmentation, includes the following specific steps: Step S21: Image preprocessing: Apply a 5×5 Gaussian kernel smoothing filter to the original RGB image to remove shooting noise, and uniformly scale it to the fixed input resolution of 640×640 of the model.

[0030] Step S22, YOLO semantic segmentation inference: A lightweight YOLOv8-seg network finely tuned with the stem mustard dataset is used to perform pixel-level binary classification inference on the preprocessed image, outputting two-class masks: category "A4 paper" and category "stem mustard"; the model backbone network is lightweight and supports offline inference on the mobile NPU without uploading images over the network.

[0031] Step S23, Mask Post-processing: 3×3 erosion and dilation morphological operators are used to sequentially operate on the two types of masks to eliminate internal holes and discrete noise at the edges, and to extract the continuous closed outer contour of A4 paper and the solid contour of stem mustard. The model training dataset contains 1500 labeled images, divided into a training set of 85% and a validation set of 15%. The samples cover flat indoor scenes, fields with soil, wrinkled A4 paper, low light and backlight, and scenes with a small number of overlapping samples. The training parameters are set as follows: foreground IoU threshold 0.7, background IoU threshold 0.3, weight decay coefficient 0.0005, Batch Size=4, and total number of iterations 300,000.

[0032] Step S3, perspective correction and pixel / physical coordinate mapping, includes the following specific steps: Step S31: Extract the smallest bounding quadrilateral of the A4 paper mask and obtain the coordinates of the four corner points of the paper image pixel plane. .

[0033] Step S32: Establish an A4 standard physical coordinate system: with the bottom left corner of the paper as the physical origin, the longer side (297mm) as the X-axis, and the shorter side (210mm) as the Y-axis, set the standard physical four-corner coordinates. .

[0034] Step S33: Solve for the homography transformation matrix. By matching two sets of four-corner coordinates and iteratively solving the 3×3 homography matrix using the least squares method, the perspective mapping of the image pixel plane to the A4 standard millimeter physical plane is realized, eliminating the size distortion caused by the tilt and pitch of the mobile phone.

[0035] Step S34, Corner Point Missing Error Handling: If only 3 valid corner points are extracted from the A4 paper mask, the coordinates of the fourth corner point are interpolated based on the fixed length and width of the A4 paper to complete the perspective transformation normally; if all four corners fail to be extracted, the system pops up a window to prompt the operator to retake the photo and outputs a visual image of the mask noise to assist in adjusting the lighting and shooting angle.

[0036] Step S35, Contour Coordinate Transformation: Transform all contour pixels of the stem mustard mask using a transformation matrix. Mapping to the standard physical plane yields a distortion-free set of physical contour points for the stem mustard.

[0037] Step S4, Batch Calculation of Multi-Dimensional Stem-Nodular Mustard Type Parameters: Based on the corrected physical contour point set of stem-nodular mustard, the OpenCV contour parsing function is called to batch calculate the complete set of vegetable type indicators. Linear dimension parameters: major axis (maximum Feret diameter) and minor axis (minimum Feret diameter) of the minimum circumscribed rectangle, aspect ratio = major axis / minor axis.

[0038] Area contour parameters: Projected area of ​​the nodule (unit) ), Total perimeter of the outline (unit: mm).

[0039] Morphological characteristic parameters: roundness , For the projected area, The circumference is the outline; the closer the roundness is to 1, the more regular the shape of the nodule.

[0040] Volume estimation parameters: approximate volume of an ellipsoid , The length of the major axis. The short axis length is used for field yield estimation per plant.

[0041] Step S5, Batch Result Output and Data Management: Single Sample Storage: Bind image file name, shooting time, and custom sample number; locally cache all size, shape, and volume parameters; synchronously save segmentation mask and size annotation visualization.

[0042] Batch serial processing: It has the function of importing multiple images from a local folder and automatically loops through the entire process from S2 to S4, without the need for manual operation of each image.

[0043] Product grading determination: The built-in stem mustard product grading threshold library automatically determines first-grade, second-grade, and substandard products based on the long axis, roundness, and projected area, and the grading label is synchronously bound to the sample.

[0044] Report Export: Generates all sample measurement data into a structured table, supporting local export in two common formats: CSV and Excel. Built-in report fields include: Sample ID, Shooting Time, Major Axis, Minor Axis, Aspect Ratio, Projected Area, Perimeter, Roundness, Estimated Volume, Product Classification, and Measurement Error Reference Value.

[0045] Example 2: This embodiment introduces an artificial intelligence-based stem-nodled mustard-type measurement system for performing the measurement method in embodiment 1. The system is divided into a hardware acquisition unit and a software processing unit.

[0046] The hardware acquisition unit includes an image acquisition submodule, which is a smartphone equipped with an NPU chip and a built-in RGB camera; optional accessories include a portable soft light and a phone holder.

[0047] The standard calibration reference material used is: national standard A4 paper (210mm×297mm).

[0048] like Figure 2 As shown, the software processing unit is integrated into the mobile APP client, including an image acquisition and preprocessing module, a YOLO artificial intelligence semantic segmentation and inference module, a perspective correction coordinate mapping module, a multi-dimensional dish type calculation and grading module, and a batch data management and export module.

[0049] The image acquisition and preprocessing module executes the following steps: S1 image capture, S21 image smoothing and resolution scaling, and local image caching.

[0050] The YOLO AI semantic segmentation inference module is used to deploy a lightweight YOLOv8-seg segmentation model, complete pixel-level binary classification of images, output A4 paper and stem mustard masks, and perform morphological post-processing to optimize the contours.

[0051] The perspective correction coordinate mapping module extracts the pixel coordinates of the four corners of an A4 sheet of paper, solves the homography transformation matrix, and completes the physical coordinate transformation of the stem mustard outline. It also includes built-in corner point missing interpolation completion and shooting failure prompt error tolerance logic.

[0052] The multi-dimensional vegetable type calculation and grading module integrates OpenCV contour parsing functions to batch calculate a complete set of parameters, including linear dimensions, area, roundness, and estimated volume. It also calls the built-in grading threshold library to automatically determine the commercial grade of stem mustard.

[0053] Batch data management and export module: Switch between single-image shooting and batch folder import modes, locally store original images, segmentation masks, and dimension annotation effect diagrams, and generate and export standardized measurement reports in CSV / Excel format.

[0054] Example 3: like Figure 3 As shown, the measurement of indoor standardized stem mustard breeding samples was carried out using: a smartphone 1 equipped with an NPU, a built-in RGB camera 2, a soft light supplement lamp 3, standard A4 paper 5, 10 stem mustard breeding samples of different sizes 7, and a digital vernier caliper with an accuracy of 0.01mm (for true value control).

[0055] Lay an A4 sheet of paper flat on the table 6. Install a mobile phone holder 4 on the table. The table can be used as a fill light for the soft light lamp 3. Place a single stem mustard 7 in the center of the paper. Turn on the soft light lamp 3 and take a vertical shot. Save 10 original images to the local folder on the mobile phone. When shooting, ensure that the nodule is completely within the boundary of the paper and there is no large area of ​​shadow.

[0056] The APP loads the YOLOv8-seg lightweight model, imports 10 images in batches, performs 5×5 Gaussian filtering for noise reduction, and uniformly scales them to 640×640 resolution; the model inference outputs A4 paper and stem mustard double mask, and uses 3×3 morphological operators to remove mask holes and noise, and extract complete closed contours.

[0057] Extract the pixel coordinates of the four corners of each A4 sheet, match them with the standard physical coordinates of 210mm×297mm, and solve the homography matrix H using the least squares method; map all the outline pixels of the stem mustard to the millimeter physical plane to eliminate the slight tilt distortion caused by vertical shooting.

[0058] Automatically outputs the major axis, minor axis, aspect ratio, projected area, contour perimeter, roundness, and estimated volume of the ellipsoid for each sample, and determines the grade 1 / 2 / substandard products based on the built-in grading threshold.

[0059] Generate an Excel measurement report, which includes sample number, shooting time, all dish parameters, and grading labels; simultaneously save the segmentation mask and dimension annotation effect of each image.

[0060] The automatic measurement results were compared with the manual true values ​​measured by vernier calipers. The average measurement error of the major and minor axes was 2.13%, and the average error of the projected area was 2.41%, which meets the accuracy requirements for breeding research.

[0061] Example 4: For high-throughput measurement of open-field bulk stem mustard harvesting, a smartphone and a stack of A4 paper were carried on a leveled cement ridge in the field.

[0062] Under natural light, individual stem mustard plants were placed inside an A4 sheet of paper and photographed sequentially, resulting in 120 consecutive images of field samples. Some samples had a thin layer of soil on their surface, and the paper had slight wrinkles. A small number of images had a corner of the A4 paper slightly obscured by soil.

[0063] For A4 paper images with one corner obscured, the system interpolates and completes the fourth corner point based on the paper's length and width constraints, thus successfully completing perspective correction. For samples of mustard tubercle with soil, the YOLO segmentation model completely extracts the tubercle's solid outline without large-area segmentation loss.

[0064] The mobile phone can process all 120 images offline in batches, taking about 8 minutes in total; manual measurement with calipers for the same sample would take more than 2 hours, improving efficiency by more than 20 times.

[0065] The product grade is automatically determined based on the vegetable type parameters, and the grade label is simultaneously written into the Excel purchase ledger. The raw material grading is completed directly on-site, without the need for secondary manual screening.

[0066] This invention is not limited to the above embodiments. The YOLO semantic segmentation model can be replaced with lightweight segmentation networks of the same series such as YOLOv5-seg and YOLOv9-seg; the ring supplement light can be replaced with a fixed indoor top light or a field soft light tent; the calibration reference can be replaced with standard A3 or A5 paper, only requiring synchronous modification of the physical coordinate dimensions; the parameter calculation module can add derivative vegetable type indicators such as curvature and nodule protrusion height according to the needs of crop varieties. All of these are equivalent technical solutions of this invention and fall within the protection scope of this invention.

Claims

1. A method for measuring stem nodule type in mustard greens based on artificial intelligence, characterized in that, Includes the following steps: Step S1, Standardized Image Acquisition Step: Lay a standard A4 white paper flat on a hard table, and place the stem mustard to be tested completely inside the boundary of the A4 paper, with no area exceeding the edge of the paper; use a smartphone RGB camera to take a picture under natural light or supplemental light conditions to obtain an original RGB image containing the complete A4 paper and stem mustard; Step S2, Image Preprocessing and Artificial Intelligence Semantic Segmentation: Gaussian smoothing filtering is applied to the original RGB image to remove noise, and the image is uniformly scaled to the fixed input resolution of the model; a lightweight YOLO semantic segmentation model is used to complete pixel-level binary classification inference, and two types of pixel masks, namely A4 paper mask and stem mustard mask, are output; morphological opening and closing operations are used to remove mask holes and edge noise, and continuous and complete contours are extracted. Step S3, Perspective Correction and Pixel-Physical Coordinate Mapping: Extract the pixel coordinates of the four corners of the image of the minimum bounding quadrilateral of the A4 paper mask; establish a physical coordinate system based on the standard size of A4 paper (210mm × 297mm), match the standard physical coordinates of the four corners of the paper, and solve the 3×3 homography transformation matrix using the least squares method; map all the contour pixels of the stem mustard to the millimeter standard physical plane through the homography matrix to eliminate perspective distortion during shooting; a built-in corner missing fault tolerance mechanism is used to interpolate and complete the fourth corner point based on the length and width constraints of the paper when only 3 corner points are extracted; Step S4, Batch Calculation of Multi-Dimensional Stem-Nodular Mustard Type Parameters: Based on the corrected physical contour point set of stem-nodular mustard, call the contour analysis function to calculate the linear size, area contour, morphological features, and estimated volume of the complete set of vegetable type parameters. Step S5, Batch Result Output and Data Management: Supports automatic serial processing of single / batch images, binds sample number and shooting time to store all measurement parameters; visualizes the output of segmentation mask and dimension annotation effect diagram; Generate structured tables and export measurement reports in CSV or Excel format; a built-in grading threshold library automatically determines the product grade based on dish type parameters and writes it into the report.

2. The method for measuring stem nodule type of mustard greens based on artificial intelligence according to claim 1, characterized in that, Step S1 uses a portable ring-shaped soft light filler module to eliminate local shadows caused by backlighting and sidelighting.

3. The method for measuring stem nodule type of mustard greens based on artificial intelligence according to claim 1, characterized in that, The lightweight YOLO semantic segmentation model described in step S2 is a YOLOv8-seg network, deployed on a mobile NPU for offline inference; the model training dataset includes labeled images of scenes with wrinkled A4 paper, soil-covered stems and mustard, multiple lighting conditions, and a small number of overlapping samples. Training hyperparameters: foreground IoU threshold 0.7, background IoU threshold 0.3, weight decay coefficient 0.0005, batch size=4, number of iterations ≥300,000, model input resolution 640×640.

4. The method for measuring stem nodules in mustard greens based on artificial intelligence according to claim 1, characterized in that, The vegetable shape parameters mentioned in step S4 include: the major axis and minor axis of the smallest circumscribed rectangle, the maximum Feret diameter, the projected area, the perimeter of the outline, the aspect ratio, roundness, and the estimated volume of the ellipsoid; the roundness calculation formula. , For the projected area, The perimeter of the outline; formula for estimating the volume of an ellipsoid. , The length of the major axis. This is the length of the minor axis.

5. The method for measuring stem nodule type of mustard greens based on artificial intelligence according to claim 1, characterized in that, If the extraction of the four corners of the A4 paper fails completely in step S3, the system will prompt the operator to retake the photo and simultaneously output a visual image of the masked noise to assist in adjusting the shooting lighting and angle.

6. The method for measuring stem nodule type of mustard greens based on artificial intelligence according to claim 1, characterized in that, Step S5 exports a report with built-in fields including sample ID, shooting time, major axis, minor axis, projected area, perimeter, roundness, estimated volume, product grading label, and measurement error reference value.

7. A stem-nodled mustard-type measurement system based on artificial intelligence, characterized in that, The system for performing the stem nodule mustard type measurement method according to any one of claims 1 to 6 is divided into a hardware acquisition unit and a software processing unit; The hardware acquisition unit includes a smartphone with RGB image acquisition capabilities, a standard A4 calibration paper, and a ring-shaped soft light supplement lamp. The software processing unit is integrated into the mobile client and includes an image acquisition and preprocessing module, a YOLO artificial intelligence semantic segmentation and reasoning module, a perspective correction coordinate mapping module, a multi-dimensional dish type calculation and grading module, and a batch data management and export module. The image acquisition preprocessing module is used to perform image smoothing and resolution scaling preprocessing in steps S1 and S2. The YOLO AI semantic segmentation and reasoning module is used to output A4 paper and stem mustard double mask and complete morphological post-processing. The perspective correction coordinate mapping module is used to extract corner points of A4 paper, solve the homography matrix, and complete the physical coordinate transformation and corner point fault-tolerant completion of the stem mustard outline; The multi-dimensional vegetable type calculation and grading module is used to calculate all vegetable type parameters in batches and automatically grade stem mustard products based on built-in thresholds. The batch data management and export module is used for batch serial processing of images, local storage of original images and labeled effect diagrams, and generation and export of standardized measurement reports.