Unginned cotton multi-parameter nondestructive testing method and unginned cotton multi-parameter nondestructive testing system

Through the image acquisition device and deep learning model, the clothing fraction, color grade and miscibility of seed cotton are automatically calculated, which solves the problem of manual detection time and low accuracy in the prior art, and achieves fast and accurate multi-parameter detection of seed cotton.

CN119936013APending Publication Date: 2025-05-06ZHENGZHOU UNIVERSITY OF LIGHT INDUSTRY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411832366.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The existing seed cotton detection methods rely on manual operation, which consumes time and is inefficient, and have low detection accuracy, resulting in inaccurate price pricing and low acquisition efficiency.

Method used

The front and back images of the seed cotton sample were collected using an image acquisition device. Through the trained cotton seed number statistical model, color level detection model and impurity recognition algorithm, the clothing ratio, color level and miscibility of the seed cotton were automatically calculated.

Benefits of technology

Fast, lossless and standardized multi-parameter detection of seed cotton is realized, which improves detection accuracy and efficiency, reduces human factors, and ensures price accuracy and acquisition efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119936013A_ABST
    Figure CN119936013A_ABST
Patent Text Reader

Abstract

The invention discloses a seed cotton multi-parameter nondestructive detection method and system, and relates to the technical field of seed cotton detection. The method is characterized by comprising the following steps: acquiring two groups of images of the front surface and the back surface of a to-be-detected seed cotton sample by using an image acquisition device, wherein each group of images comprises a transmission imaging image and a reflection imaging image; performing cotton seed number statistics on the two transmission imaging images by utilizing a trained cotton seed number statistics model to obtain the number of cotton seeds in the seed cotton, and further calculating the seed cotton lint fraction according to the number of the cotton seeds; reasoning is conducted on the two reflection imaging images through the trained color level detection model, and the seed cotton color level is detected; identifying and calculating the pixel size of the impurities for the two transmission imaging images and the two reflection imaging images, and calculating the weight of the impurities according to the proportion of the pixel size to the actual size and the average density of the impurities, so as to detect the impurity rate of the seed cotton. The method has the advantages of rapidness, no damage, standardization, instrumentation, one-machine multi-inspection and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of seed cotton detection, and in particular to a seed cotton multi-parameter nondestructive detection method and system. Background Art

[0002] The cotton lint percentage refers to the percentage of cotton lint weight in cotton lint to the total weight of cotton lint; the impurity content of cotton lint refers to the percentage of impurity weight in cotton lint to the total weight of cotton lint; and the color grade is one of the important indicators for judging the color and grade of cotton. In the cotton lint purchasing process, the cotton lint percentage, impurity content and color grade are the main indicator parameters and basis for the quality grade and pricing of cotton lint. The higher the cotton lint percentage and color grade, and the lower the impurity content, the higher the quality of the cotton lint and the higher the price, and vice versa.

[0003] At present, the cotton lint content and impurity content are mainly obtained through manual detection methods: manually weighing the cotton seed, and then manually operating the cotton gin to separate the impurities such as cotton leaves and cotton stalks from the cotton lint and cotton seeds to obtain the weight of the cotton lint, and then manually calculating the weight percentage of the cotton lint and cotton seed to obtain the lint content, and manually weighing the weight of the impurities, calculating the percentage of the impurities in the total weight of the cotton seed to obtain the impurity content. The color grade detection method is the manual visual method: the cotton seed sample is placed in a specific environment, and the color depth of the cotton seed is observed with the naked eye to determine the color grade.

[0004] The manual inspection method consumes manpower, material resources and time, and the seed cotton will cause certain loss of lint and seed cotton when passing through the ginning equipment. The loss leads to low accuracy, and the color grade is further increased by manual inspection with uncertainties, the accuracy is reduced and the human factor is large, resulting in the given seed cotton lint content, impurity content and color grade deviating from the actual value, resulting in differences between buyers and sellers on the set price and low purchasing efficiency. Summary of the invention

[0005] In view of the above problems, the present invention proposes a seed cotton multi-parameter non-destructive detection method and system in an effort to solve or alleviate one or more of the above technical problems.

[0006] According to one aspect of the present invention, a multi-parameter nondestructive detection method for seed cotton is provided, the method comprising:

[0007] Using an image acquisition device to acquire two sets of images of the front and back of the seed cotton sample to be tested, each set of images includes a transmission imaging image and a reflection imaging image;

[0008] For two transmission imaging images, the number of cotton seeds is counted using the trained cotton seed number statistical model to obtain the number of cotton seeds in the seed cotton, and then the seed cotton clothing fraction is calculated based on the number of cotton seeds;

[0009] The two reflection imaging images are inferred using the trained color grade detection model to detect the color grade of the seed cotton;

[0010] For two transmission imaging images and two reflection imaging images, the pixel size of the impurities is identified and calculated, and the weight of the impurities is calculated based on the ratio of the pixel size to the actual size and the average density of each type of impurity, thereby detecting the impurity content of the seed cotton.

[0011] Furthermore, the image acquisition device includes an LED flat panel white light source 1, a weighing module 2, a glass sample stage 3, a strip white light source 4, a color camera module 5, a light source controller 6, and a switch 7, wherein the LED flat panel white light source 1, the weighing module 2, the glass sample stage 3, and the color camera module 5 are on the same axis; the LED flat panel white light source 1 is fixedly placed directly above the weighing module 2; the glass sample stage 3 is placed on the weighing module 2 and can be flipped; the strip white light source 4 is fixedly placed on both sides below the weighing module 2; the color camera module 5 is fixedly placed directly below the weighing module 2; the light source controller 6 is respectively connected to the LED flat panel white light source 1, the strip white light source 4, and the switch 7; the switch 7 is respectively connected to the color camera module 5, the light source controller 6 and the industrial computer; the weighing module 2 is connected to the industrial computer.

[0012] Furthermore, the weighing module 2 is a hollow module in the middle, and the glass sample platform 3 is placed in the hollow part. The glass sample platform 3 is composed of two upper and lower pieces of glass placed opposite to each other in parallel, with a certain gap between the two pieces of glass.

[0013] Furthermore, the process of using the image acquisition device to acquire two groups of images of the front and back of the seed cotton sample to be tested includes: placing the seed cotton sample to be tested on the glass sample stage 3, first acquiring a first group of front images; then flipping the glass sample stage 3 to acquire a second group of back images; the acquisition process of each group of images is: the light source controller 6 controls the LED flat white light source 1 to emit white light to illuminate the seed cotton sample to be tested placed on the glass sample stage 3, and the color camera module 5 acquires the transmission imaging image; the light source controller 6 controls the LED flat white light source 1 to turn off, and turns on the strip white light source 4, the strip white light source 4 emits white light to illuminate the seed cotton sample to be tested placed on the glass sample stage 3, and the color camera module 5 acquires the reflection imaging image.

[0014] Furthermore, the two transmission imaging images are subjected to cottonseed counting using a trained cottonseed counting model to obtain the number of cottonseeds in the seed cotton, and then the seed cotton clothing fraction is calculated based on the number of cottonseeds, including:

[0015] For the front transmission imaging image, the image of the area where cotton seeds and cotton leaves are mixed is removed by image processing to obtain the front pure cotton seed area image; the trained cotton seed number statistical model is used to identify the front pure cotton seed area image and count the number of cotton seeds to obtain the number of cotton seeds in the first part;

[0016] For the back transmission imaging image, the image of the mixed area of ​​cotton seeds and cotton leaves is obtained through image processing; the mixed area image is identified and the number of cotton seeds is counted using the trained cotton seed number statistical model to obtain the number of cotton seeds in the second part;

[0017] Add the number of cotton seeds in the first part and the number of cotton seeds in the second part to obtain the total number of cotton seeds in the seed cotton sample to be tested; multiply the total number of cotton seeds by the weight value of a single cotton seed to calculate the total weight of the seed cotton sample to be tested;

[0018] The weight value measured by the weighing module 2 is subtracted from the total weight of the seed cotton sample to be tested, and then divided by the weight value measured by the weighing module 2 to obtain the lint content of the seed cotton sample to be tested.

[0019] Furthermore, the two reflection imaging images are inferred using the trained color level detection model to detect the color level of the seed cotton, including:

[0020] Impurities in the image are identified and removed through image processing, wherein the impurities include cotton stalks and cotton leaves; the color and brightness of the image after the impurities are removed are corrected and background interference is removed; the image after the above processing is imported into a trained color level detection model for model inference to obtain the color level of the seed cotton sample to be tested.

[0021] Furthermore, the two transmission imaging images and the two reflection imaging images are used to identify and calculate the pixel size of the impurities, and the weight of the impurities is calculated according to the ratio of the pixel size to the actual size and the average density of the impurities, so as to detect the impurity content, including:

[0022] Identifying impurities in the image by image processing, wherein the impurities include cotton stalks and cotton leaves;

[0023] Calculate the number of pixels in the cotton leaf area, and then calculate the size of the cotton leaf image area;

[0024] Use image analysis tools to measure the diameter and length of cotton stalks, and then calculate the volume of cotton stalks;

[0025] Through the proportional relationship between the pixel size in the image and the actual size, the pixel area is converted into the actual physical area, and then the actual size of the cotton leaf and cotton stalk is obtained;

[0026] The actual weight is calculated based on the average density and actual size of cotton leaves or cotton stalks;

[0027] The impurity rate of the seed cotton sample to be tested is: (actual weight of cotton leaves+actual weight of cotton stalks) / weight of the seed cotton sample to be tested containing impurities; the weight of the seed cotton sample to be tested containing impurities is obtained by weighing by the weighing module 2 .

[0028] Furthermore, the method of identifying impurities in the image by image processing includes: for two transmission imaging images, distinguishing and identifying cotton stalks from cotton seeds in the cotton seed sample to be tested and segmenting them; for two reflection imaging images, graying, contrast enhancement, filtering and smoothing are performed, and then cotton leaves are distinguished and identified from cotton seeds in the cotton seed sample to be tested and segmented.

[0029] Furthermore, after obtaining the lint percentage, color grade and impurity content of the seed cotton, weights are respectively assigned to the above seed cotton parameters, and the weighted multiple parameters are added together to obtain the comprehensive quality grade of the seed cotton.

[0030] According to another aspect of the present invention, a seed cotton multi-parameter nondestructive testing system is provided, the system comprising an image acquisition module and an image processing module, wherein:

[0031] The image acquisition module is used to collect two groups of images of the front and back of the seed cotton sample to be tested, each group of images includes a transmission imaging image and a reflection imaging image; the image acquisition device includes an LED flat white light source 1, a weighing module 2, a glass sample stage 3, a strip white light source 4, a color camera module 5, a light source controller 6, and a switch 7, wherein the LED flat white light source 1, the weighing module 2, the glass sample stage 3, and the color camera module 5 are on the same axis; the LED flat white light source 1 is fixedly placed directly above the weighing module 2; the glass sample stage 3 is placed on the weighing module 2 and can be turned over; the strip white light source 4 is fixedly placed on both sides below the weighing module 2; the color camera module 5 is fixedly placed directly below the weighing module 2; the light source controller 6 is respectively connected to the LED flat white light source 1, the strip white light source 4, and the switch 7; the switch 7 is respectively connected to the color camera module 5, the light source controller 6 and the image processing module; the weighing module 2 is connected to the image processing module;

[0032] The image processing module is used to count the number of cotton seeds in the two transmission imaging images using the trained cotton seed number statistical model to obtain the number of cotton seeds in the seed cotton, and then calculate the seed cotton husk fraction based on the number of cotton seeds; for the two reflection imaging images, the trained color grade detection model is used for inference to detect the color grade of the seed cotton; for the two transmission imaging images and the two reflection imaging images, the pixel size of the impurities is identified and calculated, and the weight of the impurities is calculated based on the ratio of the pixel size to the actual size and the average density of each type of impurities, thereby detecting the impurity content of the seed cotton.

[0033] The beneficial technical effects of the present invention are:

[0034] Aiming at the parameters such as seed cotton lining percentage, impurity percentage and color grade that determine the quality grade of seed cotton, the present invention proposes a seed cotton multi-parameter non-destructive detection method and system, and develops a corresponding image acquisition device. In the process of detecting the seed cotton lining percentage, the characteristics of LED white light that has a high penetration rate on cotton lint and cotton leaves and is almost impenetrable to cotton seeds and cotton stalks are utilized to obtain a transmission image; an algorithm for identifying cotton seeds in seed cotton by penetrating imaging based on deep learning is developed to achieve online image acquisition, processing and obtaining the number of cotton seeds; based on the statistical average weight of individual cotton seeds in different regions and varieties, the seed cotton lining percentage value is automatically calculated. In the process of detecting the color grade of seed cotton, the reflection imaging principle is used to achieve the acquisition of the reflection image, and an algorithm for seed cotton color grade discrimination based on deep learning is developed to achieve online image acquisition and image processing, thereby detecting its color grade. In the process of detecting the impurity content of seed cotton, the reflected image and the transmitted image are processed and calculated by the image processing algorithm for impurity identification independently developed to obtain the pixel area of ​​different impurities, and then the weight of the impurities is calculated according to the ratio of the pixel to the actual size and the average density of the different impurities, so as to detect its impurity content. The seed cotton lining fraction, impurity content and color grade detection method of the present invention has the advantages of rapidity, non-destructiveness, standardization, instrumentation and one machine for multiple detections. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:

[0036] Figure 1 A flow chart of a multi-parameter nondestructive testing method for seed cotton according to an embodiment of the present invention is shown.

[0037] Figure 2 Another flow chart of a seed cotton multi-parameter nondestructive testing method according to an embodiment of the present invention is shown.

[0038] Figure 3 A schematic structural diagram of an image acquisition device according to an embodiment of the present invention is shown.

[0039] Figure 4 Another structural schematic diagram of an image acquisition device according to an embodiment of the present invention is shown.

[0040] Figure 5 An example diagram of a seed cotton sample image acquired by a color camera module according to an embodiment of the present invention using the transmission imaging principle is shown.

[0041] Figure 6 An example diagram of a seed cotton sample image acquired by a color camera module according to an embodiment of the present invention based on the reflection imaging principle is shown.

[0042] Figure 7 An example diagram of an image obtained after processing a transmission imaging image according to an embodiment of the present invention is shown.

[0043] Figure 8 An example diagram of an image in which impurity interference is removed after preprocessing of a reflective imaging image according to an embodiment of the present invention is shown.

[0044] Fig. 9 A flowchart illustrating a process for detecting a seed cotton lining fraction according to an embodiment of the present invention is shown.

[0045] Fig.10 Schematic diagrams of various processes of image processing for cotton seed recognition and counting when cotton seeds are blocked by cotton leaves according to an embodiment of the present invention are shown.

[0046] Fig.11 The flowchart of the seed cotton color level detection process according to the embodiment of the present invention is shown.

[0047] Fig.12 The flowchart of the cotton seed impurity content detection process according to the embodiment of the present invention is shown.

[0048] Fig.13 An example diagram of an original image and a processing result image for identifying cotton leaves and cotton stalks in a seed cotton sample according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0049] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0050] Those skilled in the art know that the embodiments of the present invention can be implemented as a system, device, equipment, method or industrial computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. In this article, it should be understood that any number of elements in the drawings is for illustration and not for limitation, and any naming is only for distinction and does not have any limiting meaning.

[0051] In order to solve the technical problems that under the existing seed cotton technical detection conditions, the detection of seed cotton lining fraction and trash content is time-consuming and inefficient, the color grade inspection error is large, the loss in ginning and trash removal links is large, and the pricing in the seed cotton purchasing link is inaccurate, the present invention proposes a seed cotton multi-parameter non-destructive detection method and system for seed cotton lining fraction, trash content and color grade based on LED white light illumination imaging.

[0052] The embodiment of the present invention provides a method for nondestructive detection of multi-parameters of seed cotton. Figures 1-2 As shown, the method includes:

[0053] S110, using an image acquisition device to acquire two groups of images of the front and back of the seed cotton sample to be tested, each group of images including a transmission imaging image and a reflection imaging image;

[0054] S120, using the trained cotton seed number statistical model to perform cotton seed number statistics on the two transmission imaging images, to obtain the number of cotton seeds in the seed cotton, and then to calculate the seed cotton clothing fraction according to the number of cotton seeds;

[0055] S130, using the trained color level detection model to perform reasoning on the two reflection imaging images to detect the color level of the seed cotton;

[0056] S140, identifying and calculating the pixel size of the impurities from the two transmission imaging images and the two reflection imaging images, and calculating the weight of the impurities according to the ratio of the pixel size to the actual size and the average density of each type of impurities, thereby detecting the impurity content of the seed cotton.

[0057] The method starts at S110. In S110, an image acquisition device is used to acquire two sets of images, the front and back of the seed cotton sample to be tested, each set of images including a transmission imaging image and a reflection imaging image.

[0058] According to an embodiment of the present invention, Figure 3 and 4As shown, the image acquisition device includes an LED flat white light source 1, a weighing module 2, a glass sample platform 3, a strip white light source 4, a color camera module 5, a light source controller 6, and a switch 7, wherein the LED flat white light source 1, the weighing module 2, the glass sample platform 3, and the color camera module 5 are on the same axis; the LED flat white light source 1 is fixedly placed directly above the weighing module 2, and the glass sample platform 3 is placed on the weighing module 2 and can be turned over; the strip white light source 4 is fixedly placed on both sides below the weighing module 2; the color camera module 5 is fixedly placed directly below the weighing module 2; the light source controller 6 is respectively connected to the LED flat white light source 1 and the strip white light source 4; the switch 7 is respectively connected to the color camera module 5, the light source controller 6, and the industrial computer. The weighing module 2 is a hollow module in the middle, and the glass sample platform 3 is placed in the hollow part. The glass sample platform 3 is composed of two pieces of glass placed in parallel and facing each other, with a certain gap between the two pieces of glass, and can be turned over; the weighing module 2 is connected to the industrial computer.

[0059] Specifically, the weighing module 2 can be a module with a hollow in the middle of 300mm×300mm, and the glass sample stage 3 is placed in the hollow in the middle. The glass sample stage 3 can be two pieces of colorless and transparent ordinary silicate glass with a specification of 300mm×300mm×3mm. The two pieces of glass of the glass sample stage 3 should be placed in parallel and opposite to each other, and a certain gap is left between the two pieces of glass, which can be 12-17mm, and placed horizontally in the weighing module 2, and the glass sample stage 3 can be turned over. The seed cotton sample to be tested is laid flat between the gap between the two pieces of glass of the glass sample stage 3. The light emitting area size of the LED flat white light source 1 can be 300mm×300mm. The color camera module 5 has a minimum pixel of 2 million, and captures the image of the glass sample stage 3 area in real time. The distance between the center of the glass sample stage 3 and the lens end of the color camera module 4 can be 50-70cm. The distance between the plane where the LED flat white light source 1 is located and the plane where the glass sample stage 3 is located can be 50-60cm. The light source controller 6 and the color camera module 5 can be connected to the switch 7 via corresponding data lines. The weighing module 2 and the switch 7 can be connected to the industrial computer via corresponding data lines or wirelessly. The weight value measured by the weighing module 2 and the image collected by the color camera module 5 can be finally transmitted to the industrial computer via data lines, wireless transmission, etc.

[0060] The process of using the above-mentioned image acquisition device to acquire two sets of images of the front and back of the seed cotton sample to be tested includes:

[0061] The seed cotton sample to be tested is placed on the glass sample stage 3, and the first group of front images is collected first; then the glass sample stage 3 is turned over to collect the second group of back images; the collection process of each group of images is as follows: the light source controller 6 controls the LED flat white light source 1 to emit white light to illuminate the seed cotton sample to be tested placed on the glass sample stage 3, and the color camera module 5 collects the transmission imaging image; the light source controller 6 controls the LED flat white light source 1 to be turned off, and turns on the strip white light source 4, the strip white light source 4 emits white light to illuminate the seed cotton sample to be tested placed on the glass sample stage 3, and the color camera module 5 collects the reflection imaging image.

[0062] Specifically, the industrial computer sends a collection instruction to the color camera module 5 and the light source controller 6 through the switch 7; the light source controller 6 controls the LED flat white light source 1 to emit white light to illuminate the seed cotton sample to be tested on the glass sample table 3, and the color camera module 5 performs image collection. The collected image is as follows Figure 5 As shown; control the white light source 4 to emit white light to illuminate the seed cotton sample to be tested on the glass sample stage 3, and the color camera module 5 performs image acquisition, and the acquired image is as shown Figure 6 shown.

[0063] Then, S120 is executed. In S120, the number of cotton seeds is counted using the trained cotton seed number statistical model to obtain the number of cotton seeds in the seed cotton, and then the seed-cotton cotton percentage is calculated based on the number of cotton seeds.

[0064] According to the embodiment of the present invention, the software installed in the industrial computer undergoes a series of image processing to obtain an image of 300 mm × 300 mm containing only the glass sample stage area. The processing results are as follows: Figure 7 and Figure 8 As shown; after further calculation, the lint percentage, impurity percentage and color grade of the seed cotton sample can be obtained.

[0065] Specifically, if Fig. 9 and Fig.10 As shown, first remove Fig.10 In (a), the cotton leaf area with the cotton seeds covered is left as Fig.10 (b) The trained target detection model is imported to identify and count the cotton seeds to obtain the number of cotton seeds in the image. Then the glass sample stage is flipped, and the cotton leaves that originally blocked part of the cotton seeds on the lower surface come to the upper surface. Fig.10 As shown in (c). Because white light can penetrate cotton leaves and cotton lint and passes through cotton leaves first, the penetration imaging effect of white light on cotton leaves is the best at this time; and because white light is almost impermeable to cotton seeds and cotton seeds in transmission imaging can be identified by the model, the cotton leaves at this time no longer affect the model's recognition and counting of cotton seeds. Fig.10As shown in (d), the flipped transmission image is processed by image algorithm, only the image corresponding to the removed part is retained and the image is imported into the trained model to identify and count the cotton seeds; finally, the total number of cotton seeds in the complete image is obtained. Then, referring to the weight statistical average database of individual cotton seeds of different origins and varieties, the weight value of individual cotton seeds is selected according to the origin and variety of the sample seed cotton, and the weight of the cotton seeds in the sample seed cotton is calculated by the obtained number of cotton seeds. The lint percentage of the seed cotton sample is: the value obtained by subtracting the weight value of the cotton seeds from the sample weight value, and then divided by the sample weight value obtained by the weighing module, so as to obtain the lint percentage of the seed cotton sample.

[0066] Then, S130 is executed. In S130, the two reflection imaging images are inferred using the trained color level detection model to detect the color level of the seed cotton.

[0067] According to an embodiment of the present invention, Fig.11 As shown in the figure, firstly, the impurities in the image are identified and removed to avoid large errors when the model predicts the color level; then the image color and brightness are corrected. The image of the seed cotton sample to be tested may be affected by factors such as light conditions and the settings of the color camera, resulting in color deviation. The goal of color correction is to make the colors in the image more realistic and consistent. Brightness correction is to adjust the brightness level of the image to ensure that each part has appropriate brightness, so as to avoid overexposure or underexposure in subsequent processing. Then the background interference is removed. The seed cotton sample is usually placed on the background, which may introduce noise or interference. The goal of background removal is to separate the seed cotton from the background, making the subsequent processing more accurate. Various types of noise may exist in the image, such as Gaussian noise, salt and pepper noise, etc. Removing these noises helps to improve the accuracy of subsequent processing. The seed cotton sample image after preprocessing is imported into the trained YOLOv8 model for model inference to obtain the color level of the seed cotton sample to be tested.

[0068] Then, S140 is executed. In S140, the pixel size of the impurities is identified and calculated for the two transmission imaging images and the two reflection imaging images, and the weight of the impurities is calculated according to the ratio of the pixel size to the actual size and the average density of each type of impurities, thereby detecting the impurity content of the seed cotton.

[0069] According to an embodiment of the present invention, Fig.12As shown in the figure, firstly, based on the characteristic that cotton stalks are almost impermeable to white light, combined with morphological characteristics, cotton stalks are distinguished and identified from cotton seeds in seed cotton samples in the transmission imaging image; the reflection imaging image is grayed and the color image is converted into a grayscale image to reduce the amount of data and simplify the processing steps. Then, the image clarity is improved by linear stretching or contrast enhancement, so that the brightness difference in different areas is more obvious, which is convenient for segmenting cotton leaves, cotton stalks and background. Then, the image is smoothed by guided filtering while retaining the image edge information to remove noise. This can reduce the noise interference at the boundaries of cotton leaves and cotton stalks, making the subsequent image segmentation more accurate.

[0070] Then, the cotton leaves and stalks are separated from the background by threshold segmentation technology. The threshold can be dynamically determined by an automated algorithm (such as the Otsu algorithm) or set manually to maximize the distinction between different areas in the image. Connected domain analysis is then used to remove isolated small areas (noise) and retain the actual target areas of interest, such as cotton leaves and stalks. Through morphological operations such as region filling and closing operations, the segmented image is further improved to fill possible gaps in the cotton leaves and stalks and make the shape more complete.

[0071] Then, after denoising and segmentation, the area of ​​the image that belongs to the cotton leaf is identified and the number of pixels it occupies is calculated. This area will be used in the subsequent steps to deduce the actual physical area of ​​the cotton leaf. Then, the diameter and length of the cotton stalk are measured using image analysis tools. These measurements can be obtained by scanning the cotton stalk area horizontally or vertically. This data can help calculate the volume of the cotton stalk because the cotton stalk is usually approximately cylindrical and its volume can be calculated from the diameter and length. Based on the diameter (d) and length (L) of the cotton stalk obtained in the previous step, the volume of the cotton stalk is calculated using the cylinder volume formula: The volume of the cotton stalk is the key data in the subsequent density calculation, because the volume and density directly determine the weight of the cotton stalk.

[0072] Then, the pixel area is converted to the actual physical area by the proportional relationship between the pixel size in the image and the actual size, and the actual size of the cotton leaves and stalks is obtained. The known or estimated average density of the cotton leaves and stalks is used to calculate their actual weight.

[0073] The impurity content of seed cotton was obtained by the following formula: impurity content of seed cotton = (weight of cotton leaves + weight of cotton stalks) / weight of seed cotton sample containing impurities.

[0074] Specifically, based on the fact that cotton stalks are almost impenetrable by white light, combined with morphological characteristics, cotton stalks are distinguished and identified from cotton seeds in the image obtained by the transmission principle. Fig.13In (a), the cotton leaves on the lower surface are identified through image processing algorithms such as grayscale, grayscale stretching, guided filtering, threshold segmentation, connected domain denoising, region filling and closing operation. Fig.13 (b) The glass sample stage is flipped to identify the cotton leaves on the other surface to ensure the accuracy of the impurity rate. The pixel area is converted into the actual physical area through the proportional relationship between the pixel size in the image and the actual size, and then the real size of the cotton leaves and cotton stalks is obtained. Then, according to the average density of the cotton leaves and cotton stalks, the weight of the cotton leaves and cotton stalks contained in the seed cotton sample is obtained, and the impurity rate of the seed cotton sample is calculated.

[0075] For the cotton seed count statistical model and the color level detection model, the YOLOv8 model was selected to train the cotton seed count statistical model based on YOLOv8 and the color level detection model based on YOLOv8 respectively.

[0076] It should be noted that you can also select other target detection models, or select other models in the YOLO series, such as YOLOv10.

[0077] The training process of the cottonseed number statistical model based on YOLOv8 is as follows:

[0078] First, prepare an image dataset containing cotton seeds. Use a labeling tool (such as LabelImg) to label the cotton seeds in the image and generate the corresponding label file (usually a txt file in YOLO format). Split the image and label file into a training set and a validation set. Preprocess the image (such as resizing, normalizing, etc.) to meet the input requirements of YOLOv8.

[0079] Then, download the pre-trained model of YOLOv8. Configure the YOLOv8 model file, including the network structure and parameter settings. Use the pre-processed training set to train the model. Monitor the loss function and accuracy during training, and adjust the hyperparameters to optimize the model performance. Use the validation set to evaluate the trained model and check the performance of the model on the cottonseed detection task. Based on the validation results, further fine-tuning of the model may be required. Use the trained YOLOv8 model to detect cottonseeds on new images. Get the bounding box and confidence score output by the model.

[0080] Then, the model output is parsed and the number of detected cotton seeds is counted. The detection results are filtered according to the confidence threshold to ensure the accuracy of the statistical results. The seed-cotton coat fraction is obtained by the following formula: seed-cotton coat fraction = (weight data - number of cotton seeds × single cotton seed weight) / weight data, where the single cotton seed weight comes from the database.

[0081] Finally, draw the bounding box and number of detected cotton seeds on the image. Save the visualization image. Deploy the trained model to the target environment (such as a server or mobile device). Integrate model reasoning and counting functions to provide cotton seed recognition statistics and seed-cotton ratio calculation services.

[0082] The training process of the color-level detection model based on YOLOv8 is as follows:

[0083] First, collect an image dataset containing seed cotton of different color levels. Annotate the color levels of seed cotton images. Split seed cotton images into training set and validation set, and preprocess the images (such as resizing, normalizing, removing impurities, etc.) to meet the input requirements of YOLOv8.

[0084] Then, download the pre-trained model of YOLOv8. Configure the YOLOv8 model file, including the network structure and parameter settings. Use the pre-processed training set to train the model. Monitor the loss function and accuracy during training, and adjust the hyperparameters to optimize the model performance. Evaluate the trained model using the validation set to check the model's performance on the seed cotton color level classification task. Based on the validation results, further fine-tuning of the model may be required. Use the trained YOLOv8 model to classify the seed cotton color level of the new image. Get the confidence score and color level classification results of the model output.

[0085] Then, the model output is analyzed and the output results of seed cotton of each color level are counted. The detection results are filtered according to the confidence threshold to ensure the accuracy of the classification results.

[0086] Finally, the detected seed cotton color level is plotted on the image. The visualization image is saved. The trained model is deployed to the target environment (such as a server or mobile device). The model reasoning and color level classification functions are integrated to provide seed cotton color level recognition services.

[0087] In this embodiment, optionally, S150 is further included: after obtaining the lint percentage, color grade and impurity content of the seed cotton, weights are respectively assigned to the above seed cotton parameters, and the weighted multiple parameters are added to obtain a comprehensive quality grade of the seed cotton.

[0088] Furthermore, a detection software is designed to implement the detection method in the above embodiment. The instructions for using the detection software are as follows.

[0089] First, the Initialize button is used to restore the program to its initial state and test whether the hardware can work properly, such as clearing the display window and text box, testing whether the camera, light source and light source controller can be called at present, etc. The Run button controls each device to start working according to the set workflow. The specific test process is as follows:

[0090] 1) Control the LED flat white light source 1 to turn on, the strip white light source 4 to turn off, and the color camera module 5 to collect the transmission image 1 and display it in the program interface window 1;

[0091] 2) Control the LED flat white light source 1 to turn off, the strip white light source 4 to turn on, and the color camera module 5 to collect the reflected image 1 and display it in the program interface window 2;

[0092] 3) Control the glass sample stage 3 to flip 180°, and set the LED flat white light source 1 and the strip white light source 4 to the off state;

[0093] 4) Control the LED flat white light source 1 to turn on, the strip white light source 4 to turn off, and the color camera module 5 to collect the transmission image 2 and display it in the program interface window 3;

[0094] 5) Control the LED flat white light source 1 to turn off, the strip white light source 4 to turn on, and the color camera module 5 to collect the reflected image 2 and display it in the program interface window 4;

[0095] The four collected images are processed by algorithms respectively, and finally the cotton seed coat fraction, trash content and color grade are obtained. The specific contents are as follows:

[0096] 1) The transmission image 1 is processed using an image processing algorithm for impurity recognition, the portion of the cotton seeds blocked by cotton leaves is removed, and the remaining portion is identified and counted using the YOLOv8 model for identifying cotton seeds to obtain the number of cotton seeds n1 in this portion.

[0097] 2) The transmission image 2 is processed using an image processing algorithm for impurity recognition, and only the removed portion of the corresponding transmission image 1 after flipping is retained. The cotton seeds in this portion are recognized and counted using the YOLOv8 model for identifying cotton seeds, and the number of cotton seeds in this portion, n2, is obtained.

[0098] 3) The seed cotton lining fraction is obtained by the following formula: seed cotton lining fraction = (seed cotton sample weight data - number of cotton seeds × single cotton seed weight) / seed cotton sample weight data, where the number of cotton seeds is n1 + n2, the seed cotton sample weight data is provided by the weighing module 2, and the single cotton seed weight comes from the database.

[0099] 4) The reflection image 1 and the reflection image 2 are processed using an impurity recognition image processing algorithm to obtain the number of cotton stalks and cotton leaves and various parameters such as the pixel area of ​​the cotton leaves and the diameter (d) and length (L) of the cotton stalks.

[0100] 5) The impurity content of seed cotton is obtained by the following formula: impurity content of seed cotton = (weight of cotton leaves + weight of cotton stalks) / weight of seed cotton sample. According to the diameter (d) and length (L) of the cotton stalk obtained in the previous step, the volume of the cotton stalk is calculated using the cylinder volume formula: The pixel area is converted into the actual physical area through the proportional relationship between the pixel size in the image and the actual size, and then the real size of the cotton leaf and cotton stalk is obtained. The average density of the cotton leaf and cotton stalk is used to calculate their actual weight. The weight data of the seed cotton sample is provided by the weighing module 2, and the average density of the cotton stalk and cotton leaf is from the database.

[0101] 6) The impurity recognition image processing algorithm is used to process the reflection image 1 and the reflection image 2, and the cotton leaves and cotton stalks are removed. The remaining parts are classified and judged by the seed cotton color level using the YOLOv8 model for identifying the seed cotton color level.

[0102] Based on the weights of seed cotton lining percentage, impurity content and color grade in seed cotton pricing and today's price index, the comprehensive seed cotton quality score and seed cotton reference price are finally obtained.

[0103] The End button ends all program processes and releases program occupancy; clears all windows and text boxes and sets each device to the closed state, etc.

[0104] The display screen of the industrial computer exposed on the casing can display the output seed cotton percentage, impurity percentage and color grade for easy viewing by technicians in the field.

[0105] The seed cotton multi-parameter nondestructive detection method for the seed cotton lint rate, trash rate and color grade according to the embodiment of the present invention can automatically complete the detection of the seed cotton lint rate, trash rate and color grade, and has the advantages of rapid, nondestructive, standardized, instrumented and one machine for multiple inspections. There is no need to invest a lot of manpower and material resources, so it is convenient to standardize the whole process. The present invention also includes the detection of the lint rate, trash rate and color grade of seed cotton. On the basis of the lint rate detection, the code is optimized and upgraded; only two bar light sources need to be added to the device to perform color grade detection, which improves the utilization rate of the device and space, reduces the cost and also reduces the loss of seed cotton. The software can simultaneously perform multi-parameter nondestructive detection of the seed cotton lint rate, trash rate and color grade and give visual results, and the software's computing speed is not significantly reduced. According to the results of the detected lint rate, trash rate and color grade, the corresponding seed cotton comprehensive quality grade score and reference price are given. In addition, it supports users to set the weight ratio of lint rate, trash rate and color grade to price calculation.

[0106] Another embodiment of the present invention provides a seed cotton multi-parameter nondestructive testing system, the system includes an image acquisition module and an image processing module, wherein:

[0107] The image acquisition module is used to collect two groups of images of the front and back of the seed cotton sample to be tested, each group of images includes a transmission imaging image and a reflection imaging image; the image acquisition module includes an LED flat white light source 1, a weighing module 2, a glass sample stage 3, a strip white light source 4, a color camera module 5, a light source controller 6, and a switch 7, wherein the LED flat white light source 1, the weighing module 2, the glass sample stage 3, and the color camera module 5 are on the same axis; the LED flat white light source 1 is fixedly placed directly above the weighing module 2; the glass sample stage 3 is placed on the weighing module 2 and can be turned over; the strip white light source 4 is fixedly placed on both sides below the weighing module 2; the color camera module 5 is fixedly placed directly below the weighing module 2; the light source controller 6 is respectively connected to the LED flat white light source 1, the strip white light source 4, and the switch 7; the switch 7 is respectively connected to the color camera module 5, the light source controller 6 and the image processing module; the weighing module 2 is connected to the image processing module; here, the image processing module is arranged in the industrial computer;

[0108] The image processing module is used to count the number of cotton seeds in the two transmission imaging images using the trained cotton seed number statistical model to obtain the number of cotton seeds in the seed cotton, and then calculate the seed cotton husk fraction based on the number of cotton seeds; for the two reflection imaging images, the trained color grade detection model is used for inference to detect the color grade of the seed cotton; for the two transmission imaging images and the two reflection imaging images, the pixel size of the impurities is identified and calculated, and the weight of the impurities is calculated based on the ratio of the pixel size to the actual size and the average density of each type of impurities, thereby detecting the impurity content of the seed cotton.

[0109] For the undetailed parts of the seed cotton multi-parameter nondestructive testing system according to the embodiment of the present invention, please refer to the above detailed description of the method embodiment.

[0110] It should be noted that, although several units, modules or submodules are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided into being embodied by multiple modules.

[0111] In addition, although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0112] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims.

Claims

1. A multi-parameter nondestructive testing method for seed cotton, characterized in that: include: Using an image acquisition device to acquire two sets of images of the front and back of the seed cotton sample to be tested, each set of images includes a transmission imaging image and a reflection imaging image; For two transmission imaging images, the number of cotton seeds is counted using the trained cotton seed number statistical model to obtain the number of cotton seeds in the seed cotton, and then the seed cotton clothing fraction is calculated based on the number of cotton seeds; The two reflection imaging images are inferred using the trained color grade detection model to detect the color grade of the seed cotton; For two transmission imaging images and two reflection imaging images, the pixel size of the impurities is identified and calculated, and the weight of the impurities is calculated based on the ratio of the pixel size to the actual size and the average density of each type of impurity, thereby detecting the impurity content of the seed cotton.

2. A seed cotton multi-parameter nondestructive testing method according to claim 1, characterized in that: The image acquisition device comprises an LED flat panel white light source (1), a weighing module (2), a glass sample platform (3), a strip white light source (4), a color camera module (5), a light source controller (6), and a switch (7); wherein the LED flat panel white light source (1), the weighing module (2), the glass sample platform (3), and the color camera module (5) are on the same axis; the LED flat panel white light source (1) is fixedly placed directly above the weighing module (2); the glass sample platform (3) is placed on the weighing module (2) and can be turned over; the strip white light source (4) is fixedly placed on both sides below the weighing module (2); the color camera module (5) is fixedly placed directly below the weighing module (2); the light source controller (6) is respectively connected to the LED flat panel white light source (1), the strip white light source (4), and the switch (7); the switch (7) is respectively connected to the color camera module (5), the light source controller (6), and an industrial computer; and the weighing module (2) is connected to the industrial computer.

3. A seed cotton multi-parameter nondestructive testing method according to claim 2, characterized in that: The weighing module (2) is a hollow module in the middle, and the glass sample platform (3) is placed in the hollow part. The glass sample platform (3) is composed of two upper and lower pieces of glass placed opposite to each other in parallel, with a certain gap between the two pieces of glass.

4. A seed cotton multi-parameter nondestructive testing method according to claim 3, characterized in that: The process of using an image acquisition device to acquire two groups of images, front and back, of a seed cotton sample to be tested comprises: placing the seed cotton sample to be tested on a glass sample stage (3), first acquiring a first group of front images; and then turning over the glass sample stage (3) to acquire a second group of back images; the acquisition process of each group of images comprises: a light source controller (6) controls an LED flat white light source (1) to emit white light to illuminate the seed cotton sample to be tested placed on the glass sample stage (3), and a color camera module (5) acquires a transmission imaging image; the light source controller (6) controls the LED flat white light source (1) to turn off, and turns on a strip white light source (4), and the strip white light source (4) emits white light to illuminate the seed cotton sample to be tested placed on the glass sample stage (3), and the color camera module (5) acquires a reflection imaging image.

5. A seed cotton multi-parameter nondestructive testing method according to claim 1, characterized in that: The two transmission imaging images are subjected to cotton seed counting using a trained cotton seed number statistical model to obtain the number of cotton seeds in the seed cotton, and then the seed cotton clothing fraction is calculated based on the number of cotton seeds, including: For the front transmission imaging image, the image of the area where cotton seeds and cotton leaves are mixed is removed by image processing to obtain the front pure cotton seed area image; the trained cotton seed number statistical model is used to identify the front pure cotton seed area image and count the number of cotton seeds to obtain the number of cotton seeds in the first part; For the back transmission imaging image, the image of the mixed area of ​​cotton seeds and cotton leaves is obtained through image processing; the mixed area image is identified and the number of cotton seeds is counted using the trained cotton seed number statistical model to obtain the number of cotton seeds in the second part; Add the number of cotton seeds in the first part and the number of cotton seeds in the second part to obtain the total number of cotton seeds in the seed cotton sample to be tested; multiply the total number of cotton seeds by the weight value of a single cotton seed to calculate the total weight of the seed cotton sample to be tested; The total weight of the seed cotton sample to be tested is subtracted from the weight value measured by the weighing module (2), and the resultant weight is divided by the weight value measured by the weighing module (2) to obtain the lint content of the seed cotton sample to be tested.

6. A seed cotton multi-parameter nondestructive testing method according to claim 1, characterized in that: The two reflected imaging images are inferred using a trained color level detection model to detect the color level of the seed cotton, including: identifying and removing impurities in the image through image processing, wherein the impurities include cotton stalks and cotton leaves; correcting the color and brightness of the image after the impurities are removed and removing background interference; and importing the image after the above processing into the trained color level detection model for model inference to obtain the color level of the seed cotton sample to be tested.

7. A seed cotton multi-parameter nondestructive testing method according to claim 1, characterized in that: The two transmission imaging images and the two reflection imaging images are used to identify and calculate the pixel size of the impurities, and the weight of the impurities is calculated according to the ratio of the pixel size to the actual size and the average density of the impurities, so as to detect the impurity rate of the seed cotton, including: Identifying impurities in the image by image processing, wherein the impurities include cotton stalks and cotton leaves; Calculate the number of pixels in the cotton leaf area, and then calculate the size of the cotton leaf image area; Use image analysis tools to measure the diameter and length of cotton stalks, and then calculate the volume of cotton stalks; Through the proportional relationship between the pixel size in the image and the actual size, the pixel area is converted into the actual physical area, and then the actual size of the cotton leaf and cotton stalk is obtained; The actual weight is calculated based on the average density and actual size of cotton leaves or cotton stalks; The impurity rate of the seed cotton sample to be tested is: (actual weight of cotton leaves+actual weight of cotton stalks) / weight of the seed cotton sample to be tested containing impurities; the weight of the seed cotton sample to be tested containing impurities is obtained by weighing the weighing module (2).

8. A seed cotton multi-parameter nondestructive testing method according to claim 7, characterized in that: The method of identifying impurities in the image by image processing includes: distinguishing and identifying cotton stalks and cotton seeds from the cotton seed sample to be tested for the two transmission imaging images and segmenting them out; and distinguishing and identifying cotton leaves and cotton seeds from the cotton seed sample to be tested after graying, contrast enhancement, and filtering and smoothing the two reflection imaging images.

9. A seed cotton multi-parameter nondestructive testing method according to claim 1, characterized in that: After obtaining the lint percentage, color grade and impurity content of the seed cotton, weights are assigned to the above seed cotton parameters respectively, and the weighted multiple parameters are added together to obtain the comprehensive quality grade of the seed cotton.

10. A seed cotton multi-parameter nondestructive testing system, characterized in that: It includes an image acquisition module and an image processing module, wherein: The image acquisition module is used to acquire two groups of images, the front and back of the seed cotton sample to be tested, each group of images comprising a transmission imaging image and a reflection imaging image; the image acquisition module comprises an LED flat panel white light source (1), a weighing module (2), a glass sample platform (3), a strip white light source (4), a color camera module (5), a light source controller (6), and a switch (7), wherein the LED flat panel white light source (1), the weighing module (2), the glass sample platform (3), and the color camera module (5) are on the same axis; the LED flat panel white light source (1) is fixedly placed on the The weighing module (2) is directly above the weighing module (2); the glass sample table (3) is placed on the weighing module (2) and can be turned over; the strip white light source (4) is fixedly placed on both sides below the weighing module (2); the color camera module (5) is fixedly placed directly below the weighing module (2); the light source controller (6) is respectively connected to the LED flat panel white light source (1), the strip white light source (4), and the switch (7); the switch (7) is respectively connected to the color camera module (5), the light source controller (6) and the image processing module; the weighing module (2) is connected to the image processing module; The image processing module is used to count the number of cotton seeds in the two transmission imaging images using the trained cotton seed number statistical model to obtain the number of cotton seeds in the seed cotton, and then calculate the seed cotton husk fraction based on the number of cotton seeds; for the two reflection imaging images, the trained color grade detection model is used for inference to detect the color grade of the seed cotton; for the two transmission imaging images and the two reflection imaging images, the pixel size of the impurities is identified and calculated, and the weight of the impurities is calculated based on the ratio of the pixel size to the actual size and the average density of each type of impurities, thereby detecting the impurity content of the seed cotton.