Method and system for detecting seeding quality of seedling tray based on smart phone
By realizing seed quality detection of seeds on smartphones, and using the YOLACT target detection network to accurately detect seed distribution, the problems of complex detection and inconvenient hardware portability in the prior art are solved, and efficient and accurate seed quality detection and soil laying stability analysis are achieved.
Patent Information
- Application Number
- CN202411613146.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In the prior art, the seedling quality detection process of seeds is complicated, hardware is inconvenient to carry, and it is impossible to accurately determine the area where the seeds span multiple grids belong.
A method of seedling quality detection of seedling plate seedling plate based on smartphones is designed. By collecting seedling plate images, preprocessing data, manual labeling, data enhancement, training of the YOLACT target detection network, deploying the model to the mobile terminal, developing the seedling plate seedling quality detection system App, and integrating the soil laying stability detection module.
It realizes accurate judgment across multiple grids to the area where the seed belongs, improves detection efficiency, reduces hardware costs, and reduces subjective errors in manual detection. It is suitable for various seedlings and supports automatic export of reports.
Smart Images

Figure CN119579858A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of agricultural precision sowing detection, and in particular relates to a method and system for detecting seeding quality of a seedling tray based on a smart phone. Background Art
[0002] At present, the agricultural machinery appraisal department still uses manual detection methods for the detection of complete sets of seeding tray sowing equipment. The staff manually selects the detection area, divides the grid, observes the number of seeds in each grid by naked eyes, and manually enters Excel for calculation. In addition, the soil laying stability detection of complete sets of equipment has always been mainly manual. These methods are complex in calculation, inefficient, have large errors and strong subjectivity. Most modern seeding tray sowing quality detection uses machine learning and deep learning technology, relying on high-performance hardware systems. The prior art (CN117975345) discloses a method and system for detecting the sowing effect of seeding trays of pneumatic precision seeders. It trains a seeding tray sowing detection model through an improved YOLOv5 target detection network, and deploys it on an industrial computer, realizing real-time acquisition of seeding tray images, and then obtaining the number of rice in each hole; although this method realizes high-precision detection based on a high-performance hardware system, its hardware system is inconvenient to carry. In addition, this method is mainly suitable for standard pot seedling tray detection, while ordinary seedling trays need to be divided into grids for detection, and it is impossible to accurately determine the area to which seeds across multiple grids belong. In order to solve the above technical problems, the present invention designs a method and system for detecting seeding quality of seedling tray based on a smart phone. Summary of the invention
[0003] In view of the problems existing in the prior art such as the complex process of seedling tray sowing quality detection and the difficulty in carrying hardware, the present invention provides a seedling tray sowing quality detection method and system based on a smart phone, which can accurately determine the area to which seeds across multiple grids belong, and the method can be integrated into a mobile phone app to improve the detection efficiency and make it easy to carry. On this basis, soil stability detection is added to integrate the full process detection of the seedling tray sowing equipment into one.
[0004] The present invention achieves the above technical objectives through the following technical means.
[0005] A method for detecting seeding quality of seedling trays based on a smart phone includes the following steps:
[0006] Step 1: Collect the sowing images of the rice seedling tray sowing equipment to obtain the original data set.
[0007] Step 2: Preprocess the original data set obtained in step 1. The preprocessing includes segmentation into fixed size, filtering, denoising, and distortion correction.
[0008] Step 3: Manually annotate the dataset preprocessed in step 2.
[0009] Step 4: Perform data enhancement processing on the dataset annotated in step 3 to improve the generalization ability of the model and produce a rice seedling tray dataset; the data enhancement processing methods include enhancing image contrast, scaling, and adding blur effects.
[0010] Step 5: Input the rice seedling tray dataset processed in step 4 into the YOLACT target detection network for training and testing to obtain the rice seedling tray sowing quality detection model.
[0011] Step 6: Deploy the rice seedling tray sowing quality detection model trained in step 5 to the mobile phone. The model deployment uses the ncnn high-performance neural network forward computing framework.
[0012] Step 7: Develop an App for the seedling tray sowing quality detection system, select the seedling tray image, and obtain the seedling tray sowing space rate and sowing uniformity qualification rate after calculation and processing; when developing the seedling tray sowing quality detection system App, based on the Androidstudio platform, using Java language, select the OpenCV image processing library according to functional requirements, write relevant requirement codes, and the detection results can be exported to Excel tables;
[0013] Step 8: Connect the Bluetooth scale to the rice seeding tray sowing quality detection system app. Specifically, click on the mobile phone to connect the Bluetooth device, and the rice seeding tray sowing quality detection system app will automatically connect to the Bluetooth address set in the background. The Bluetooth scale will transmit the weight data to the mobile phone in real time for display, and the automatic recording function will be enabled at the same time. Users can intuitively view the line graph of weight changes through the application interface. The system calculates the standard deviation and coefficient of variation through the automatically recorded weight data, quantifies the fluctuation of sowing quality, and supports the automatic export of reports.
[0014] Furthermore, the blank rate is the ratio of the number of blanks to the total number of blanks, and its calculation formula is as follows:
[0015]
[0016] Among them, k represents the number of spaces, and total represents the total number of cells;
[0017] For seeds that span different detection frames, the pixel area of the seed in different grids is calculated based on the seed segmentation results, and the grid to which the seed belongs is determined based on the pixel area occupied by the seed in different grids.
[0018] While calculating the space rate, the number of seeds in each grid is counted. According to different agronomic requirements, the user enters the qualified range, records the number of qualified grids, and calculates the seeding uniformity qualified rate R.J , the calculation formula is as follows:
[0019]
[0020] Wherein, m represents the number of qualified grids.
[0021] Furthermore, the automatic recording function means that when the real-time weight detected by the Bluetooth scale is greater than 0.2kg and the fluctuation range is less than 0.01kg, the system automatically determines that it is stable, records the weight w1 at this time, and records it in the table and line graph at the same time; continuously records 10 plates (w1~w 10 ), the Calculate button on the app becomes clickable. Click the button to calculate the standard deviation and coefficient of variation. After the calculation is completed, the Export button automatically becomes clickable. The user clicks to export the current record from w1 to w 10 Statistical indicators such as weight data, standard deviation and coefficient of variation, and automatically save the report to the default folder on the phone.
[0022] Furthermore, the user manually inputs the uniformity qualified range data through the qualified range button, and the number of seeds in each grid is recorded in the Excel table exported by the seedling tray sowing quality detection system app. The grids that exceed the uniformity qualified range and the detection value is 0 are marked with other colors to facilitate user observation and recording.
[0023] A system for implementing the above-mentioned method for detecting seedling tray sowing quality based on a smart phone, comprising:
[0024] The image acquisition module uses an image acquisition device to automatically collect image data of the seedling tray after sowing, and connects with the computer and mobile phone to transmit the image data;
[0025] The image processing module is deployed on the computer side and is used to pre-process and enhance the data collected by the image acquisition module;
[0026] The model training module is deployed on the computer side, and performs model training and testing based on the data processed by the image processing module to obtain a rice seedling tray sowing quality detection model;
[0027] The image detection module is deployed on the mobile phone in the form of an app, including an image selection unit, an image compression unit, an input qualified range unit, an input grid unit, a seed detection unit, a space rate and uniformity detection unit, a grid magnification unit, a soil paving stability detection unit, and a report export unit;
[0028] An image selection unit, used to select the collected seedling tray image data from the mobile phone album;
[0029] The image compression unit is used to compress the image data of the seedling tray with higher pixels, so that the detection can be realized even on mobile phones with poor hardware.
[0030] An input qualified range unit is used for the user to input a qualified range of the seeding uniformity qualified rate;
[0031] Input grid unit, used to divide grids of different sizes according to different image inputs;
[0032] The seed detection unit is used to detect the seedling tray image selected by the user and transmit the seed detection result to the front end. The front end displays the number of seeds contained in the grid in the center of each grid according to the distribution of the detection result in the grid;
[0033] The space rate and uniformity detection unit calculates relevant indicators based on the detection results of the seed detection unit and displays them on the front end for users to record.
[0034] A grid magnification unit, which allows the user to click on any grid to magnify the detection details in the grid;
[0035] The soil paving stability detection unit is used to connect to the Bluetooth scale 5 through the mobile phone App, transmit the real-time weight data to the mobile phone and automatically record it. When the weight is stable and within the set range, the data is automatically saved. After recording 10 times, the standard deviation and coefficient of variation are calculated;
[0036] The report export unit is used to export the test report so that users can easily obtain the test results and analysis reports.
[0037] The present invention has the following beneficial effects:
[0038] The present invention integrates the rice seedling tray sowing quality detection method into the mobile phone App and uses portable devices for detection, thereby avoiding the cumbersome steps of the traditional manual detection method and significantly improving the detection efficiency. By using common smart phones and open source tools, expensive hardware investment and the need for special equipment are avoided, and the overall cost of the detection system is reduced. The YOLACT target detection network is used to accurately mark and train the rice seedling tray image, and the number of seeds in each grid can be accurately detected, which effectively improves the detection accuracy and reduces the subjective error caused by manual detection. This method is not only applicable to standard seedling trays, but also can accurately detect ordinary seedling trays through grid division technology, and has strong versatility. In addition, the present invention also adds a soil laying stability detection module, which realizes the automatic recording function of weighing data. By recording the weight data of each seedling tray in real time, the system can draw a line chart of weight changes to intuitively show the stability trend of the equipment soil laying. At the same time, the standard deviation and coefficient of variation are calculated, so that users can quantify the fluctuation of soil laying quality, thereby achieving a more comprehensive quality analysis. In order to improve the user experience, the system also supports the automatic export function of reports, and users can easily obtain and share test results and analysis reports.
[0039] In summary, compared with existing methods that rely on high-performance hardware systems, the present invention can complete detection using a smart phone, making the device more convenient to carry and suitable for various environments such as fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a schematic diagram of the image acquisition device of the present invention;
[0041] Figure 2 A schematic diagram of the location of the Bluetooth scale;
[0042] Figure 3 This is a flow chart of the method for detecting seeding quality of seedling trays based on a smart phone according to the present invention;
[0043] Figure 4 The interface diagram of the developed software;
[0044] Figure 5 This is a detection effect diagram of the seedling tray sowing quality detection method based on a smart phone according to the present invention;
[0045] Figure 6 This is the soil stability test page.
[0046] In the figure: 1- camera; 2- seedling tray; 3- collection frame; 4- transmission device; 5- Bluetooth scale; DETAILED DESCRIPTION
[0047] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments, but the protection scope of the present invention is not limited thereto.
[0048] Reference Figure 3 The method for detecting seedling tray sowing quality based on a smart phone in this embodiment includes the following steps:
[0049] Step 1: Preliminary image data collection: Figure 1 As shown, the camera 1 is set 650 mm above the seedling tray, and a fixed size (100 mm*120 mm) acquisition frame 3 is set below. After the seedling tray 2 is sown, it is transported to the bottom of the camera 1 through the conveying device 4. The camera 1 collects the seeding image of the seedling tray, obtains the original data set and transmits it to the computer for subsequent processing for model training.
[0050] Step 2: Image preprocessing, including cropping, distortion correction, and denoising.
[0051] Step 3: Preparation of sowing image dataset: Use the open source annotation tool Labelme to annotate the preprocessed rice seedling tray images.
[0052] Step 4: Data enhancement: Perform data enhancement on the annotated images, including enhancing image contrast, scaling, adding blur effects, etc., to expand the data set.
[0053] Step 5: YOLACT model training: Input the data set produced in step 4 into the real-time instance segmentation target detection network (You Only Look At Coefficients, YOLACT) for training and testing. The model training parameters are set as follows: Batchsize is set to 16, the number of iterations is set to 16, and the initial learning rate is set to 0.001. When training to 5000, 10000, and 15000 times, the learning rate is adjusted to 1 / 10 of the learning rate of the previous stage, and a trained rice seedling tray sowing quality detection model is obtained.
[0054] Through the above steps, the average precision mAP@0.5 of the rice seedling tray sowing quality detection model is 91.06; the hardware and software platform settings are shown in Table 1 below:
[0055] Table 1 Hardware and software platform settings
[0056]
[0057] Step 6: Deploy the model to the Android phone: Export the trained model in step 5 to ONNX format, use the onnx2ncnn tool provided by the ncnn (a high-performance neural network inference computing framework) high-performance neural network forward computing framework to convert the ONNX model to ncnn format, and generate .param and .bin files; in order to improve the inference speed and reduce the model size, use the ncnn quantization tool to convert the model to the quantized INT8 format and generate the corresponding .param and .bin files; compile ncnn in Android Studio and integrate it into the Android project. When the application starts, use the ncnn interface to load the .param and .bin files, load the model into memory, and prepare for inference; preprocess the input image (mean subtraction and normalization), input the preprocessed image into the ncnn inference interface, call the model for forward calculation, and get the original output tensor. The inference interface output of ncnn contains multiple tensors for representing bounding box, category and mask information; the category and bounding box coordinates of each target are parsed, and the mask is applied to the corresponding bounding box area through the mask tensor output by the model to extract the precise outline of the corresponding target; threshold filtering is applied to the category score and mask to retain high-confidence targets and salient areas to exclude noise; the parsed bounding box is drawn on the image and the mask area is superimposed; since the targets are densely packed, multiple superpositions will result in a cluttered page, and the subsequent processes are all based on mask development, so the bounding box and confidence score are set to invisible in the software interface so that users can intuitively understand the recognition results.
[0058] Step 7: Software development: Based on the Android Studio platform, use Java language, select OpenCV image processing library according to functional requirements, develop the seedling tray sowing quality detection system app, design the user interface of the application, including layout, color, icons, etc., write XML layout files, and implement the application interface; integrate OpenCV image processing library to implement image loading, preprocessing, display and other functions; integrate the YOLACT-ncnn model converted in step 6 into the application for image segmentation and seed detection; at the same time, implement user interaction functions, such as selecting gallery, adjusting parameters, etc., and test on different Android devices to ensure the compatibility and stability of the application on various devices.
[0059] Step 8: Actual Field Testing: Reuse Figure 1 The device shown in the figure collects the original rice seedling tray image data through the camera 1, and transmits the data to the mobile phone album through the built-in software of the camera 1. The user opens the app, such as Figure 4As shown, click the gallery button to select the image to be detected and start detection.
[0060] Step 9: Grid division and grid input: The default grid size of the seedling tray sowing quality inspection system app is 10×10. When the user needs to set the grid size, such as Figure 4 As shown in the figure, click the input grid button, and the system automatically displays a dialog box prompting the user to enter a new grid size. In this dialog box, the user can enter the desired grid size through the input box. After the user confirms the input, the system verifies the input content to check whether it is empty and tries to convert the input content to an integer; if the conversion is successful, the grid size parameters are updated and the user is notified that the grid size has been updated; if the input is invalid (such as empty or non-numeric), the user is prompted to enter a valid number. The system then divides the original image according to the number of grids entered by the user, calculates the width and length of each sub-area, and divides the area one by one by rows and columns from the upper left corner.
[0061] Step 10: Detection of the number of seeds in the grid: First, the image is evenly divided into multiple grid units of equal size according to the grid size set by the user; then, each pixel in the image is traversed to determine whether it belongs to the mask area of the detection target; if a pixel belongs to the target and has not been processed, it is marked as processed, and the grid unit to which it belongs is determined based on the position of the pixel in the image, and then the target pixel count of the grid unit is increased; the system traverses all grids, counts the number of targets in each grid, and finds the grid unit with the most pixels; after the detection is completed, the system visualizes the detection results by drawing grid lines and the number of targets in each grid, helping users to intuitively understand the distribution of targets in each grid unit.
[0062] In the above process, in order to avoid repeated drawing and incorrect counting, the mask state of each pixel is tracked through a Boolean array to ensure that the same area is not drawn repeatedly, thereby avoiding redundant calculations and improving drawing efficiency; whenever the mask pixel value changes, the current line segment is drawn in place to reduce unnecessary drawing operations; a two-dimensional array is used to record the number of targets in each grid unit, and the grid coordinates are calculated pixel by pixel to accurately map the detected target distribution to each grid; the drawn line width and text size are dynamically adjusted according to the image resolution, and are adapted to images of different sizes by multiplying the scaling factor. This ensures that images of different sizes are displayed consistently; in each grid, the system automatically counts the number of targets and marks them at the corresponding grid position, presenting the target distribution through a clear contrast between color and text, making it easier for users to intuitively judge the detection results.
[0063] In the above process, determining the grid unit to which it belongs means that since some seeds occupy multiple grids, in order to accurately locate the main position of each target, the code calculates the pixel number distribution of the grid where each detection target is located, and selects the grid with the largest number of target pixels as the "main grid", thereby realizing the main position judgment when the target is distributed in multiple areas.
[0064] Step 11: Calculation of empty space rate: First, initialize two counters: one for recording the number of empty grid cells (emptyCells), and the other for calculating the total number of grid cells (totalCells). TotalCells is obtained by squaring the size of the grid. Then, use a double loop to traverse each cell of the entire grid and check the number of targets in each cell. If the number of targets in a certain grid cell is zero, add 1 to the emptyCells counter. Finally, calculate the empty space rate, that is, the percentage of empty grid cells to the total grid cells, by dividing emptyCells by totalCells and then multiplying by 100. This percentage represents the proportion of grid cells in the entire image where no targets are detected, and update the relevant display information. The detection results are as follows: Figure 5 shown.
[0065] Step 12: Enter the qualified range: Figure 4 As shown in the figure, the user can click the qualified range button to enter the corresponding qualified range to prepare for the subsequent calculation of the qualified rate of seeding uniformity; the system first initializes a layout page for entering the minimum and maximum detection standards, and obtains the minimum and maximum values entered by the user in the input box; then sets the click event handler for the confirmation button. When the user clicks the confirmation button, the system starts to process the input; the system obtains the value entered by the user from the input box and tries to convert these strings into integers; to ensure the validity of the input, the system will detect whether there is a format error or invalid input. If an error occurs, the system will capture the exception and handle the error. When the input is verified, the system stores the valid minimum and maximum values in the Intent object for passing these data to other processing processes; then calls the setResult method to return the data and operation results to the main activity that calls the interface, and sets the result code to RESULT_OK, indicating that the input is successful and valid; finally returns to the main process to ensure that the qualified range set by the user can be correctly applied to the next detection or calculation steps.
[0066] Step 13: Seeding uniformity pass rate detection: The system initializes a counter (uniformCells) to count the number of grid cells whose target number is within the user-defined range; a double loop is used to traverse each cell of the entire grid; if the number of targets in a cell is between the minimum value (minRange) and the maximum value (maxRange) defined by the user, the uniformCells counter is increased by 1, and the uniformity is calculated, that is, the percentage of grid cells whose target number is within the defined range; the calculation method is to divide uniformCells by totalCells, and then multiply by 100 to get the percentage form. The test results are as follows: Figure 5 shown.
[0067] Step 14: Grid zoom: Based on the width and height of the image, the width and height of each grid unit are calculated according to the preset grid division number. According to the row and column coordinates of the target grid, the left, top, right and bottom boundary coordinates of the grid are calculated through multiplication operations; using the specified boundaries of the original image, the image data of the target grid area is extracted through cropping operations, and a new image is generated as a magnified view; the generated magnified image is applied to the image view control so that the content of the magnified area is clearly presented, and a close button is displayed at the same time, allowing the user to close the magnified view after viewing. When the user clicks the close button, the magnified view and the close button are hidden to return to the overall image view.
[0068] Step 15: Soil spreading stability test: This means that when the rice seedling tray equipment is in the working state of only spreading soil, one tray is taken out every 3 trays, and 10 trays are taken out. The weight of each tray of soil is weighed and recorded, and the standard deviation and coefficient of variation are calculated to obtain the soil spreading stability; refer to Figure 2 As shown, the Bluetooth scale 5 is arranged below the seedling tray complete set of equipment. After the seedling tray 2 is covered with soil, it is output with the conveyor roller. The inspector extracts the seedling tray 2 and places the Bluetooth scale 5 at the center position; refer to Figure 2 , 6 As shown, the present invention adopts the innovative "range fluctuation filtering" and "automatic recording" functions to obtain the weight data of the Bluetooth scale 5 in real time through Bluetooth. First, an allowable fluctuation range (0-0.01kg) is set in the application to ensure that weight changes within this range are ignored, so as to eliminate the influence of external interference and small fluctuations; in terms of data analysis, the software has a built-in chart library, which supports real-time line charts to display the trend of weight changes, helping users to intuitively understand the weight fluctuations during the measurement process; when the real-time weight is detected to be greater than 0.2kg and the fluctuation range is less than 0.01kg, the system automatically determines it as stable and records the weight w1 at this time, and records it in the table and line chart at the same time, without the need for users to click manually; at the same time, in order to consider the stability of the equipment, the manual recording function is retained, and users can freely choose automatic recording and manual recording; 10 plates (w1-w 10), the Calculate button will become clickable. Click it to calculate the standard deviation and coefficient of variation. After the calculation is completed, the Export button will become clickable, and the user can click to export the current record from w1 to w 10 Statistical indicators such as weight data, standard deviation and coefficient of variation are generated, and the report is automatically saved to the default folder of the mobile phone.
[0069] In the above process, the system has built-in functions such as zeroing, calibration, and real-time display of the Bluetooth scale 5, and provides low-battery reminders; below is the soil stability detection and recording module, which has both manual and automatic recording functions; a delete button is added to delete erroneous data caused by user misoperation. When the table is not fully recorded, the button is gray and cannot be clicked. After ten sets of data are recorded, the calculation button becomes bright and you can click it to calculate the relevant parameters.
[0070] The above steps 1 to 5 are the preliminary steps of the detection system for image acquisition and algorithm learning, which provide sample data for the detection operation of the detection system; replace the standardized seedling tray 2, repeat steps 1 to 5 to add new sample data, so that the precision detection method can be used in different sowing environments. The remaining steps are the process of implementing the detection method. The use of this new precision detection method has the characteristics of high stability, strong applicability and high detection accuracy.
[0071] This embodiment also provides a seedling tray sowing quality detection system based on a smart phone, including:
[0072] The image acquisition module uses an image acquisition device to automatically collect image data of the seedling tray after sowing, and connects with the computer and mobile phone to transmit the image data;
[0073] The image processing module is deployed on the computer side and is used to pre-process and enhance the data collected by the image acquisition module;
[0074] The model training module is deployed on the computer side, and performs model training and testing based on the data processed by the image processing module to obtain a rice seedling tray sowing quality detection model;
[0075] The image detection module is deployed on the mobile phone, including an image selection unit, an image compression unit, an input qualified range unit, an input grid unit, a seed detection unit, a space rate and uniformity detection unit, a grid magnification unit, a soil paving stability detection unit, and a report export unit;
[0076] An image selection unit, used to select the collected seedling tray image data from the mobile phone album;
[0077] The image compression unit is used to compress the image data of the seedling tray with higher pixels, so that the detection can be realized even on mobile phones with poor hardware.
[0078] An input qualified range unit is used for the user to input a qualified range of the seeding uniformity qualified rate;
[0079] Input grid unit, used to divide grids of different sizes according to different image inputs;
[0080] The seed detection unit is used to detect the seedling tray image selected by the user and transmit the seed detection result to the front end. The front end displays the number of seeds contained in the grid in the center of each grid according to the distribution of the detection result in the grid;
[0081] The space rate and uniformity detection unit calculates relevant indicators based on the detection results of the seed detection unit and displays them on the front end for users to record.
[0082] A grid magnification unit, which allows the user to click on any grid to magnify the detection details in the grid;
[0083] The soil paving stability detection unit is used to connect to the Bluetooth scale 5 through the mobile phone App, transmit the real-time weight data to the mobile phone and automatically record it. When the weight is stable and within the set range, the data is automatically saved. After recording 10 times, the standard deviation and coefficient of variation are calculated;
[0084] The report export unit is used to export the test report so that users can easily obtain the test results and analysis reports.
[0085] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the process of steps 9 to 15 above is implemented.
[0086] The embodiments are preferred implementations of the present invention, but the present invention is not limited to the above-mentioned implementations. Any obvious improvements, substitutions or modifications that can be made by those skilled in the art without departing from the essential content of the present invention belong to the protection scope of the present invention.
Claims
1. A method for detecting seeding quality of seedling trays based on a smart phone, characterized in that: The process includes the following: Step 1: Use image acquisition equipment to collect the sowing images of the rice seedling tray sowing equipment, obtain the original data set and transmit it to the computer; Step 2: Preprocess the original data set on the computer, including segmentation into fixed sizes, filtering, denoising, and distortion correction; Step 3: Manually annotate the preprocessed dataset using open source annotation tools; Step 4: Perform data enhancement processing on the labeled data set to produce a rice seedling tray data set; data enhancement processing methods include enhancing image contrast, scaling, and adding blur effects; Step 5: Input the rice seedling tray dataset into the YOLACT target detection network for training and testing to obtain the rice seedling tray sowing quality detection model; Step 6: Deploy the rice seedling tray sowing quality detection model to the mobile phone based on the ncnn high-performance neural network forward computing framework; Step 7: Develop a rice seedling tray sowing quality detection system App, collect the sowing image data of the rice seedling tray sowing equipment through the image acquisition device again, and transmit the data to the mobile phone album. Use the rice seedling tray sowing quality detection system App to identify and calculate the rice seedling tray sowing space rate and sowing uniformity qualification rate, and export the inspection report; Step 8: Connect the seedling tray sowing quality detection system App to the Bluetooth scale (5). The Bluetooth scale (5) transmits the weight data of the seedling tray (2) to the mobile phone for display in real time, and enables the automatic recording function to ensure that the user can intuitively view the weight change line graph through the application interface. At the same time, the standard deviation and coefficient of variation are calculated through the automatically recorded weight data, the fluctuation of the sowing quality is quantified, and the detection report is exported.
2. The method for detecting seedling tray sowing quality based on a smart phone according to claim 1, characterized in that: In step 7, the blank space rate calculation formula of the seedling tray is as follows: For seeds that span different detection frames, the pixel area of the seed in different grids is calculated based on the seed segmentation results, and the grid to which the seed belongs is determined based on the pixel area occupied by the seed in different grids. While calculating the seeding space rate of the seedling tray, the number of seeds in each grid is counted. According to different agronomic requirements, the user enters the qualified range, records the number of qualified grids, and then calculates the seeding uniformity qualified rate R J : Among them, m represents the number of qualified grids, k represents the number of spaces, and total represents the total number of grids.
3. The method for detecting seedling tray sowing quality based on a smart phone according to claim 1, characterized in that: In step 8, the automatic recording function means that when the real-time weight detected by the Bluetooth scale (5) is greater than 0.2kg and the fluctuation range is less than 0-0.01kg, the seedling tray sowing quality detection system App automatically determines that it is stable, records the weight w1 at this time, and records it in the table and line graph at the same time; the seedling tray sowing quality detection system App is provided with a calculation button and an export button. After recording 10 trays continuously, the seedling tray sowing quality detection system App calculates the standard deviation and the coefficient of variation. After the calculation is completed, the weight data, standard deviation and coefficient of variation statistical indicator report of the currently recorded 10 trays are exported, and the report is automatically saved to the default folder.
4. The method for detecting seedling tray sowing quality based on a smart phone according to claim 1, characterized in that: The user inputs the uniformity qualified range data into the seedling tray sowing quality detection system App in advance. The detection report exported by the seedling tray sowing quality detection system App is in the form of an Excel table, which records the number of seeds in each grid, and marks the grids that exceed the uniformity qualified range and are detected as 0 with different colors.
5. The method for detecting seeding quality of seedling tray based on smart phone according to claim 1, characterized in that: In the step 6, when the model is deployed, the rice seedling tray sowing quality detection model trained in step 5 is exported to the ONNX format, and the quantization tool provided by the ncnn high-performance neural network forward computing framework is used to convert the model into the quantized INT8 format to generate corresponding .param and .bin files; ncnn is compiled in Android Studio and integrated into the Android project. When the application is started, the .param and .bin files are loaded using the ncnn interface, and the model is loaded into the memory to prepare for detection; during detection, the input image is input into the ncnn reasoning interface, and the model is called for forward calculation to obtain the original output tensor. The ncnn reasoning interface output contains multiple tensors for representing the bounding box, category and mask information, and the category and bounding box coordinates of each target are parsed. Through the mask tensor output by the model, the mask is applied to the corresponding bounding box area to extract the precise outline of the corresponding target; threshold filtering is applied to the category score and the mask, and high-confidence targets and significant areas are retained to exclude noise, and the parsed bounding box is drawn on the image, and the mask area is superimposed.
6. A system for implementing the method for detecting seeding quality of seedling trays based on a smart phone according to claim 1, characterized in that: include: The image acquisition module uses an image acquisition device to automatically collect image data of the seedling tray after sowing, and connects with the computer and mobile phone to transmit the image data; The image processing module is deployed on the computer side and is used to pre-process and enhance the data collected by the image acquisition module; The model training module is deployed on the computer side, and performs model training and testing based on the data processed by the image processing module to obtain a rice seedling tray sowing quality detection model; The image detection module is deployed on the mobile phone in the form of an app, including an image selection unit, an image compression unit, an input qualified range unit, an input grid unit, a seed detection unit, a space rate and uniformity detection unit, a grid magnification unit, a soil paving stability detection unit, and a report export unit; An image selection unit, used to select the collected seedling tray image data from the mobile phone album; An image compression unit, used for compressing the seedling tray image data with higher pixels; An input qualified range unit is used for the user to input a qualified range of the seeding uniformity qualified rate; Input grid unit, used to divide grids of different sizes according to different image inputs; The seed detection unit is used to detect the seedling tray image selected by the user and transmit the seed detection result to the front end. The front end displays the number of seeds contained in the grid in the center of each grid according to the distribution of the detection result in the grid; The space rate and uniformity detection unit calculates relevant indicators based on the detection results of the seed detection unit and displays them on the front end for users to record; A grid magnification unit, which allows the user to click on any grid to magnify the detection details in the grid; A soil paving stability detection unit is used to connect to a Bluetooth scale (5), transmit real-time weight data to a mobile phone and automatically record it. When the weight is stable and within a set range, the data is automatically saved. After recording 10 times, the standard deviation and coefficient of variation are calculated. The report export unit is used to export the test report for users to view in real time.
Citation Information
Patent Citations
Intelligent and constant precision seeding device for rice seedling raising in tray
CN107278434A
Intelligent constant-quantity precision seeding device for rice seedling tray seedling raising
CN113287393A
Leaf vegetable seed precision seedling raising sowing performance detection system and construction method thereof
CN115937686A
Vision-based working area boundary detection system and method, and machine equipment
US20220036562A1