Cotton impurity detection system and method based on multi-feature fusion

By combining the information of RGB images and polarized images, and using deep learning models to fusion of multimodal data, the problems of low accuracy and slow efficiency of traditional cotton impurity detection methods are solved, and high-precision cotton impurity recognition and classification are achieved.

CN120064123AActive Publication Date: 2025-05-30NANJING FORESTRY UNIV

Patent Information

Application Number
CN202510225828.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-27
Publication Date
2025-05-30
Estimated Expiration
2045-02-27

AI Technical Summary

Technical Problem

Traditional cotton impurity detection methods have problems such as low detection efficiency, poor accuracy, strong subjectivity and easy to miss small impurities. It is especially difficult to accurately detect mud films wrapped in soil and polypropylene wires similar to cotton color.

Method used

A cotton impurity detection system based on multi-feature fusion is adopted, combined with the information of RGB images and polarized images, and multi-modal data fusion is fusion, and a deep learning model is used to detect multi-modal fusion images to achieve high-precision recognition of cotton impurities.

Benefits of technology

It improves the accuracy and reliability of cotton impurities detection, and can effectively identify a variety of impurities, such as drip irrigation tape, mulch film, polypropylene wire, etc., reduces misidentification, and improves detection efficiency and cotton purity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120064123A_ABST
    Figure CN120064123A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of agricultural visual inspection, and discloses a cotton impurity detection system and method based on multi-feature fusion. The system comprises a shell, a multi-modal image acquisition module, a multi-modal information processing module and a cotton transmission module, the multi-modal image acquisition module comprises a plurality of RGB cameras, a polarization camera, a plurality of LED light sources and a UV ultraviolet lamp which are fixed on a camera bracket; the multi-mode information processing module comprises a lower computer and an industrial personal computer, and the industrial personal computer is connected with the lower computer, a plurality of RGB cameras and a polarization camera. Cotton passes through an image acquisition module through a conveying pipeline, information data are transmitted to an industrial personal computer through polarization image and RGB image acquisition, and a detection result is quickly obtained through algorithm processing of cotton multi-mode information. According to the invention, impurities contained in cotton can be rapidly detected, positioned and automatically removed, and the impurity removal efficiency and precision are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of agricultural vision detection, in particular to a cotton impurity detection system and method based on multi-feature fusion. Background Art

[0002] In the process of cotton planting and harvesting, plastic films and drip irrigation tapes are widely used. However, during harvesting, even with mechanical cotton picking, they are very likely to be mixed into the cotton and become impurities. These impurities not only affect the quality of cotton but may also damage textile machinery. The ability to effectively identify and separate the impurities existing in cotton indirectly promotes the development of the cotton industry and the textile industry.

[0003] Traditional methods for selecting cotton impurities mainly rely on manual vision, which have problems such as low detection efficiency, poor selection effect, slow speed, strong subjectivity, manual fatigue, and easy omission of fine impurities doped in cotton. In recent years, with the development of technologies such as computer vision and deep learning, the use of image processing and deep learning algorithms for automatic impurity screening of machine-picked cotton has become a research hotspot. Due to the limitations of traditional visual recognition methods in identifying impurities such as plastic films and polypropylene filaments, especially for plastic films wrapped in soil and polypropylene filaments with colors extremely similar to cotton. Most detection schemes cannot accurately detect plastic films, polypropylene filaments, etc. Therefore, there is an urgent need for a multi-modal information fusion technology that can effectively improve the accuracy and reliability of cotton impurity detection. Summary of the Invention

[0004] Object of the Invention: The object of the present invention is to provide a cotton impurity detection system and method based on multi-feature fusion in view of the deficiencies of the existing technology. By combining the information of RGB images and polarization images and through multi-modal data fusion, the accuracy and reliability of cotton impurities are improved.

[0005] Technical Solution: The technical solution adopted by the present invention to solve the problem is as follows: A cotton impurity detection system based on multi-feature fusion includes a housing, a multi-modal image acquisition module, a multi-modal information processing module, and a cotton transmission module; the multi-modal image acquisition module includes a plurality of RGB cameras, polarization cameras, LED light sources, and UV ultraviolet lamps symmetrically distributed on both sides of the cotton conveying pipeline; the LED light sources and UV ultraviolet lamps are alternately installed with the cotton conveying pipeline as the center; the multi-modal information processing module includes an industrial computer, a lower computer, and a PLC controller, and the industrial computer is connected to the RGB cameras, polarization cameras, and the lower computer; the cotton transmission module includes a blower and an air duct for controlling the cotton transmission speed.

[0006] Further, the multi-modal image acquisition module includes three RGB cameras and three polarization cameras on each of the front and back sides. The RGB cameras and polarization cameras are respectively fixed on a camera bracket, and the bracket is in soft contact connection with the housing to eliminate the influence of mechanical vibration.

[0007] Further, the multi-modal information acquisition module alternately installs a number of LED light sources and ultraviolet lamps on both sides of the air duct. Centering on the cotton conveying air duct, a number of LED light sources and UV lamps are installed on both sides of the air duct to ensure that the part scanned by the camera is illuminated by light sources at 360°.

[0008] Specifically, the installation positions of the LED light sources and UV lamps are as follows: The first group of light sources is installed on the upper right side and upper left side of the line scan position of the RGB camera, forming an angle of 20° with the vertical direction of the pipeline; the second group of light sources is installed on the lower right side and lower left side of the line scan position of the RGB camera, forming an angle of 160° with the vertical direction of the pipeline; the third group of light sources is installed on the upper left side and upper right side of the line scan position of the polarization camera, forming an angle of 20° with the vertical direction of the pipeline; the fourth group of light sources is installed on the lower left side and lower right side of the line scan position of the polarization camera, forming an angle of 160° with the vertical direction of the pipeline.

[0009] The present invention also provides a cotton impurity detection method based on multi-feature fusion, including the following steps:

[0010] S1: Synchronously trigger the RGB camera and the polarization camera to acquire images. The RGB camera outputs an RGB image of 2048×512, and the polarization camera acquires polarization intensity maps at 0°, 45°, 90°, and 135°, and calculates and generates a degree of polarization map (DoP) and an angle of polarization map (AoP) through the lower computer.

[0011] S2: Convert the RGB image to the Lab color space, and identify colored impurities and linear impurities similar to the color of cotton based on threshold segmentation and template matching of the L, a, and b channels.

[0012] S3: Convert the RGB image to the HSV color space, and identify brightly colored impurities based on saturation detection of high-saturation regions.

[0013] S4: Align and fuse the RGB image with the polarization feature map into a five-channel image, and input it into a deep learning network for detection.

[0014] S5: Combine the detection results of S2, S3, and S4, generate an array and send it to the lower computer to control the start of the spray valve for removing impurities.

[0015] Further, the specific implementation method of "the RGB camera captures RGB images of 2048*512, and the polarization camera captures intensity maps of light at polarization angles of 0°, 45°, 90°, and 135°, and obtains the degree of polarization map (DoP) and the angle of polarization map (AoP) through the processing of the lower computer according to the formula. Then, the RGB image and the polarization image are input into the image processing module." in step S1 is as follows:

[0016] S11: Image acquisition adopts a multi-camera configuration, including an RGB camera and a polarization camera. The core control board is used to send a trigger signal to the acquisition card to synchronously trigger the RGB camera and the polarization camera to capture images respectively. The RGB image is directly sent to the image processing module, and the polarization image is sent to the image processing module after being processed by the lower computer to generate the degree of polarization map (DoP) and the angle of polarization map (AoP).

[0017] Further, the specific implementation method of "converting the RGB image into an image in the Lab color space. Threshold segmentation and template matching are performed on the image based on the L, a, and b values of the three channels." in step S2 is as follows:

[0018] S21: Convert the RGB color space into the Lab color space, and further extract the features of the L, a, and b channels.

[0019] S22: Duplicate the Lab image twice. On the one hand, perform threshold segmentation to identify the regions with a large difference from the cotton threshold as impurities; on the other hand, first perform threshold segmentation to identify the suspicious regions with a small difference from the cotton threshold, and then perform multi-template matching to mainly detect linear polypropylene filaments, thin lines, oil cotton, etc.

[0020] S23: Perform smoothing processing and noise removal on the detection results through morphological operations (erosion first and then dilation) to improve the recognition accuracy of the impurity regions.

[0021] Further, the specific operation steps of converting the RGB image into the HSV channels in step S3, detecting the values of the S channel, and considering the parts with higher saturation as impurities are as follows:

[0022] S31: Convert the RGB color space into the HSV color space, segment the values of the saturation (S) channel, and identify the regions with a saturation greater than 160 as impurities of highly saturated bright colors.

[0023] As a preference: The specific implementation method of "fusing the RGB image and the polarization image to generate a five-channel image and input it into the deep learning network for detection." in step S4 is as follows:

[0024] S41: Through calibration and registration, ensure that both the RGB image and the polarization image are 2048*512 in size and are completely aligned at the pixel level to facilitate multi-modal feature fusion.

[0025] S42: Synthesize the aligned RGB image and the polarization feature map into a unified format to form a 5-channel multimodal image.

[0026] S43: Detect the fused five-channel image through a deep learning model.

[0027] Preferably: "Merge the detection results of S2, S3, S4, and S5, then generate an array and send it to the lower computer to control the start of the spray valve" described in step S5. The specific implementation method is as follows:

[0028] S51: Convert the detection results of steps S2, S3, and S4 into binary images. White pixel points are impurities, and black pixel points are non-impurities. Perform an OR operation on the results of S2, S3, and S4 by pixel points, and perform a maximum connected component detection according to the area corresponding to the spray valve. The part of the detected impurity area greater than a certain threshold is regarded as the final result, effectively reducing some scattered pixel points that are misrecognized. The impurity area is 1, and the non-impurity area is 0. Then merge the three results and output a 20*512 array to send to the lower computer to control the start of the spray valve to eject impurities.

[0029] Beneficial effects: (1) The high-precision multimodal information fusion adopted in the present invention: Deploy RGB cameras and polarization cameras on both sides of the cotton conveying pipeline at the same time. Through the deployment of the camera and light source positions, multi-angle and multimodal images of cotton and its impurities are obtained; it provides a high-precision data source for subsequent detection algorithms, ensuring the accuracy and speed of detecting the contained impurities;

[0030] (2) Through the method of fusing RGB images and polarization images, the present invention realizes one-stop detection of impurities such as drip irrigation tapes, plastic films, packaging films, and polypropylene filaments commonly found in machine-picked cotton. Through the YOLOv8 deep learning model, end-to-end feature learning is performed on the multimodal fusion image, which can automatically extract complex image features, can detect and classify various impurity types, and select different blowing volumes and blowing times according to different impurity types to adapt to complex actual environments, improving the robustness and accuracy of impurity classification. It avoids problems such as low detection accuracy, slow processing speed, and high misrecognition rate in traditional methods, and greatly improves the efficiency and cotton purity in actual production applications;

[0031] (3) Through the communication between the upper computer and the lower computer, the present invention quickly merges the detection results of RGB images and polarization images, ensuring that the control of starting the spray valve is completed within one image acquisition cycle from camera image acquisition, accurately separating impurities, and greatly improving the processing efficiency and real-time performance of production applications;

[0032] (4) The present invention can handle various impurities in machine-picked cotton, such as drip irrigation tapes, packaging films, polypropylene filaments, thin wire impurities, etc., and has strong adaptability and practical application value. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a schematic diagram of the overall structure of the present invention;

[0034] Figure 2 is a schematic diagram of the internal planar structure of the present invention;

[0035] Figure 3 is a flowchart of the impurity detection algorithm of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0036] Such as Figure 1 、 Figure 2As shown in the figure, a cotton impurity detection system based on multi-feature fusion; it includes a housing 1, an image acquisition module, a multi-modal information processing module, a cotton conveying module, an impurity conveying module, etc.; on both sides of the cotton conveying pipeline 2, a first LED light source 20, a second LED light source 22, a first UV ultraviolet lamp 21, a third LED light source 23, a second UV ultraviolet lamp, a fourth LED light source 25, a fifth LED light source 26, a third UV ultraviolet lamp 27, a sixth LED light source 28, a seventh LED light source 29, a fourth UV ultraviolet lamp 30, an eighth LED light source 31, a ninth LED light source 32, a fifth UV ultraviolet lamp 33, a tenth LED light source 34, an eleventh LED light source 35, a sixth UV ultraviolet lamp 36, a twelfth LED light source 37, a thirteenth LED light source 38, a seventh UV ultraviolet lamp 39, a fourteenth LED light source 40, a fifteenth LED light source 41, an eighth UV ultraviolet lamp 42, a sixteenth LED light source 43 are installed; the image acquisition module is located on both sides of the cotton conveying pipeline 2, and two rectangular opening RGB camera line scan ports 3 are reserved on each side of the pipeline for the line scan camera to take pictures; the image acquisition module includes: an RGB camera 6 fixed to the first camera bracket, an RGB camera 7 fixed to the second camera bracket, an RGB camera 8 fixed to the third camera bracket, an RGB camera 9 fixed to the fourth camera bracket, an RGB camera 10 fixed to the fifth camera bracket, an RGB camera 11 fixed to the sixth camera bracket, a polarization camera 13 fixed to the seventh camera bracket, a polarization camera 14 fixed to the eighth camera bracket, a polarization camera 15 fixed to the ninth camera bracket, a polarization camera 16 fixed to the tenth camera bracket, a polarization camera 17 fixed to the eleventh camera bracket, a polarization camera 18 fixed to the twelfth camera bracket, the cotton conveying module includes a cotton to be inspected conveying pipeline 2, an impurity conveying pipeline 12, and a finished cotton conveying pipeline 19. The multi-modal information processing module industrial control computer 47, this industrial control computer 47 is connected to the RGB camera 8, the RGB camera 9, the lower computer 1 and the plc, and the lower computer 1 is connected to the industrial control computer 47, the valve plate 1, the polarization camera 15, and the polarization camera 18. The multi-modal information processing module industrial control computer 1, this industrial control computer 48 is connected to the RGB camera 7, the RGB camera 10, the lower computer 2 and the plc, and the lower computer 2 is connected to the industrial control computer 48, the valve plate 2, the polarization camera 14, and the polarization camera 17.

[0037] The multi-modal information processing module industrial control computer 49, this industrial control computer 49 is connected to the RGB camera 6, the RGB camera 11, the lower computer 3 and the plc, and the lower computer 3 is connected to the industrial control computer 49, the valve plate 3, the polarization camera 13, and the polarization camera 16. Each industrial control computer and the cameras connected to the lower computer are cameras symmetrically located on both sides of the pipeline.

[0038] The first LED light source 20, the second LED light source 22, and the first UV ultraviolet lamp 21 are installed on the upper right side of the position scanned by the RGB camera, making an angle of 20 degrees with the vertical direction of the pipeline. The third LED light source 23, the second UV ultraviolet lamp, and the fourth LED light source 25 are installed on the upper left side of the position scanned by the RGB camera, making an angle of 20 degrees with the vertical direction of the pipeline. The seventh LED light source 29, the fourth UV ultraviolet lamp 30, and the eighth LED light source 31 are installed on the lower left side of the position scanned by the RGB camera, making an angle of 160 degrees with the vertical direction of the pipeline. The fifth LED light source 26, the third UV ultraviolet lamp 27, and the sixth LED light source 28 are installed on the lower right side of the position scanned by the RGB camera, making an angle of 160 degrees with the vertical direction of the pipeline.

[0039] The ninth LED light source 32, the fifth UV ultraviolet lamp 33, and the tenth LED light source 34 are installed on the upper left side of the position scanned by the polarization camera, making an angle of 20 degrees with the vertical direction of the pipeline. The eleventh LED light source 35, the sixth UV ultraviolet lamp 36, and the twelfth LED light source 37 are installed on the upper right side of the position scanned by the polarization camera, making an angle of 20 degrees with the vertical direction of the pipeline. The fifteenth LED light source 41, the eighth UV ultraviolet lamp 42, and the sixteenth LED light source 43 are installed on the lower left side of the position scanned by the polarization camera, making an angle of 160 degrees with the vertical direction of the pipeline. The thirteenth LED light source 38, the seventh UV ultraviolet lamp 39, and the fourteenth LED light source 40 are installed on the lower right side of the position scanned by the polarization camera, making an angle of 160 degrees with the vertical direction of the pipeline. The first camera bracket, the second camera bracket, the third camera bracket, the fourth camera bracket, the fifth camera bracket, and the sixth camera bracket are on the same horizontal line and are located at the central position of the first to eighth light sources at the position scanned by the RGB camera. The seventh camera bracket, the eighth camera bracket, the ninth camera bracket, the tenth camera bracket, the eleventh camera bracket, and the twelfth camera bracket are on the same horizontal line and are located at the central position of the first to eighth light sources at the position scanned by the polarization camera. To ensure that the images captured by the camera are not affected by external light, the entire image acquisition module is sealed with an opaque aluminum alloy cover plate.

[0040] The first camera bracket, the second camera bracket, the third camera bracket, the fourth camera bracket, the fifth camera bracket, the sixth camera bracket, the seventh camera bracket, the eighth camera bracket, the ninth camera bracket, the tenth camera bracket, the eleventh camera bracket, and the twelfth camera bracket located on both sides of the cotton conveying pipeline are in soft contact with the housing 1 to avoid the influence caused by machine vibration. The cover plates on both sides of the housing 1 can be freely opened, facilitating the debugging of cameras, light sources, etc. The openings reserved for debugging and measuring the wind speed on both sides of the cotton conveying pipeline can be freely opened and closed to avoid affecting the wind speed inside the pipeline during the production process.

[0041] The cameras are triggered by the lower computer to capture images at a fixed frequency. After the cotton passes through the camera scanning position via the conveying pipeline, the image data is sent to the information processing module for processing. The RGB images are respectively sent to the corresponding industrial computers 1, 2, and 3 for processing, and the polarization images are sent to the corresponding lower computers 1, 2, and 3 for processing. Finally, the processing results are combined and sent to the valve plate to control the spray valve to start and eject the identified impurities. Among them, the converted Lab images and HSV images in the algorithm process are mainly processed by the CPU with the GPU as the auxiliary, and the deep learning detection algorithm is mainly accelerated by the GPU to improve the processing efficiency. Ensure that the impurities are accurately ejected from the image capture position to the spray valve port.

[0042] Since the acquisition card used in the image acquisition module is a Matrox image acquisition card, using Matrox's image processing functions can not only eliminate the need for image format conversion, but also improve the processing efficiency and shorten the processing time. Use Matrox's image processing functions to convert the RGB image into Lab image and HSV image, and perform threshold segmentation to identify the colored impurities. At the same time, perform threshold segmentation on the Lab image to segment out the parts that may not belong to cotton, and then perform template matching through Matrox's shape template matching function to identify impurities such as polypropylene filaments and packaging tapes that are similar in color to cotton. While processing the Lab and HSV images, the RGB image is passed into the deep learning detection module, which mainly identifies the soil-covered plastic films not detected by the polarization camera. The image resolution collected by the RGB camera and the polarization camera is both 2048*512.

[0043] As Figure 3 shown, it is the algorithm flow chart of a cotton impurity sorting method based on multi-feature fusion; first, by writing a camera acquisition program, the RGB camera and the polarization camera can simultaneously achieve the rapid acquisition of multi-feature images;

[0044] Using Matrox's image processing functions, on the one hand, convert the RGB image into a Lab image, perform threshold segmentation and template matching, and on the other hand, convert the MIL-type image collected by the acquisition card into a Mat type for the deep learning algorithm module to process.

[0045] The processing of the Lab image (threshold segmentation and template matching) is as follows:

[0046] Threshold segmentation: The threshold range for cotton is the white and dark yellow areas, as well as the brown areas of some cotton leaves and cotton husks. Therefore, items of other colors such as drip irrigation tapes, colored packaging films, and bright colors like red, blue, and green are all impurities. Through threshold segmentation, pixel points outside the L, a, b threshold range of cotton are identified as impurities. A total of six colors are designed in this system, including red, blue, green, purple, orange, and black. A range is given for the L, a, b of each color. For example, the approximate range of red Lab is: L: 20 - 80, a: 40 - 100, b: 0 - 60. Pixel points that meet the above conditions simultaneously are identified as impurities. In addition, the images of each camera are fine-tuned to ensure the recognition accuracy.

[0047] Template matching: For impurities such as polypropylene filaments and hemp ropes mixed in during the mechanical cotton picking process, which have colors similar to cotton, the areas with colors similar to cotton are first identified through threshold segmentation, and then template matching is performed using pre-given linear and cluster templates to identify linear impurities and cluster oil cotton.

[0048] Deep learning model detection:

[0049] First, fuse the RGB and polarization images. The specific fusion method is as follows:

[0050] Calculate the polarization characteristics of the collected light intensity map:

[0051] Degree of polarization (DoP): Used to represent the intensity distribution of polarized light. The formula is:

[0052]

[0053] Angle of polarization (AoP): Used to represent the direction of polarized light. The formula is:

[0054]

[0055] The lower computer calculates two single-channel images, namely the 4th and 5th channels, through the above formulas using the light intensity maps of the 0°, 45°, 90°, and 135° polarization angles collected.

[0056] Stack the aligned RGB image (channels 1 - 3) and the polarization feature maps (degree of polarization DoP and angle of polarization AoP, channels 4 and 5) along the channel dimension. The format of the fused image is [H, W, 5], where H is the height and W is the width. The storage method is selected to be suitable for the deep learning framework and is represented by [B, C, H, W], where B is the batch size and C = 5 is the number of channels; to improve the stability of model training, the data of all channels are normalized so that their numerical ranges are standardized to [0, 1] to reduce the impact of numerical differences on training and optimize the feature expression effect.

[0057] Use the open-source label-studio annotation tool to perform polygon impurity annotation on the fused image. The impurity types mainly include: plastic film, cotton with oil, polypropylene filaments, etc.

[0058] Input the fused image and the annotated data into the improved yolo-v8 algorithm model, and modify the first convolutional kernel of the model to adapt to the 5-channel input data. Use a branch network to perform deeper fusion of RGB and polarization features in the model.

[0059] After the polarization features are extracted through the polarization branch, they are fully fused with the RGB image information, enhancing the model's adaptability to shiny objects and complex scenes. This method fully integrates color, texture, and optical property information, and has the characteristics of strong robustness and high detection accuracy, and is suitable for multi-modal detection tasks in complex scenes.

[0060] Finally, merge the detection results of the above multiple steps to obtain a binary image with a size of 2048*512. Taking industrial computer 47 as an example, divide the 2048*512 image into 20*512 regions, count the impurity area of each region, and set the regions larger than a certain degree to 1, that is, the spray valve in that region is activated. This method can effectively avoid misrecognition.

[0061] The above specific implementation manners are only a preferred embodiment of the present invention, and are not used to limit the implementation and the scope of the claims of the present invention. Any equivalent changes and modifications made according to the content of the patent protection scope of the present invention shall be included in the scope of the patent application of the present invention.

Claims

1. A cotton impurity detection system based on multi-feature fusion, characterized in that: The invention comprises a housing (1), a multimodal image acquisition module, a multimodal information processing module and a cotton transmission module; the multimodal image acquisition module comprises a plurality of RGB cameras, polarization cameras, LED light sources and UV lamps symmetrically distributed on both sides of a cotton transmission pipeline (2); the LED light sources and UV lamps are installed alternately with the cotton transmission pipeline as the center; the multimodal information processing module comprises an industrial computer, a lower computer and a PLC controller, and the industrial computer is connected to the RGB camera, the polarization camera and the lower computer; the cotton transmission module comprises a fan and an air duct for controlling the transmission speed of cotton.

2. The cotton impurity detection system based on multi-feature fusion according to claim 1, characterized in that: The multimodal image acquisition module comprises three RGB cameras and three polarization cameras on the front and back sides, the RGB cameras and polarization cameras are respectively fixed to a camera bracket, and the bracket and the housing (1) are soft-contact connected to eliminate the influence of mechanical vibration.

3. The cotton impurity detection system based on multi-feature fusion according to claim 1, characterized in that: The installation positions of the LED light sources and UV lamps are specifically as follows: the first group of light sources is installed on the upper right and upper left sides of the RGB camera line scan position, at 20° to the vertical direction of the pipeline; the second group of light sources is installed on the lower right and lower left sides of the RGB camera line scan position, at 160° to the vertical direction of the pipeline; the third group of light sources is installed on the upper left and upper right sides of the polarization camera line scan position, at 20° to the vertical direction of the pipeline; the fourth group of light sources is installed on the lower left and lower right sides of the polarization camera line scan position, at 160° to the vertical direction of the pipeline.

4. A cotton impurity detection method based on multi-feature fusion, characterized in that: The cotton impurity detection system based on multi-feature fusion as described in any one of claims 1 to 3 comprises the following steps: S1: Synchronously trigger the RGB camera and polarization camera to collect images. The RGB camera outputs a 2048×512 RGB image. The polarization camera collects polarization intensity images at 0°, 45°, 90°, and 135°, and generates polarization degree and polarization angle images through calculation by the lower computer. S2: Convert the RGB image into Lab color space, and identify colored impurities and linear impurities similar to the color of cotton based on L, a, and b channel threshold segmentation and template matching; S3: Convert the RGB image to HSV color space and detect high saturation areas based on saturation to identify bright color impurities; S4: Align the RGB image with the polarization feature map and fuse them into a five-channel image, which is input into the deep learning network for detection; S5: Combine the detection results of S2, S3, and S4, generate an array and send it to the lower computer to control the start of the spray valve used to remove impurities.

5. The cotton impurity detection method based on multi-feature fusion according to claim 4 is characterized in that: The calculation formulas for the degree of polarization (DoP) and angle of polarization (AoP) in S1 are: The degree of polarization (DoP) is calculated as: The formula for calculating the angle of polarization (AoP) is:

6. The cotton impurity detection method based on multi-feature fusion according to claim 4, characterized in that: The template matching in step S2 specifically includes: smoothing the threshold segmentation result through morphological operation; matching the suspicious area with predefined linear and ball templates to identify polypropylene yarn, hemp rope and oil cotton.

7. The cotton impurity detection method based on multi-feature fusion according to claim 4 is characterized in that: The step of fusing the RGB image and the polarization image in step S4 includes: confirming that the sizes of the RGB image and the polarization information image are both 2048*512, stacking the aligned RGB image (channels 1-3) and the polarization feature map (degree of polarization DoP and angle of polarization AoP, channels 4 and 5) according to the channel dimension, and the format of the fused image is [H, W, 5], where H is the height and W is the width; the deep learning network adopts an improved YOLOv8 model, optimizes the original network input dimension for the RGB three channels to a network model structure suitable for the fusion of five-channel images as input, extracts image features through the deep convolutional network Backbone, optimizes the network model structure, and simultaneously extracts features from RGB and polarization information and generates target recognition.

8. The cotton impurity detection method based on multi-feature fusion according to claim 4, characterized in that: The merged detection result in step S5 is specifically: performing pixel-level OR operation on the binary image generated by threshold segmentation, template matching and deep learning detection; performing regional segmentation on the merged image, and triggering the spray valve only when the impurity area of ​​a certain area exceeds a preset threshold.

9. The cotton impurity detection method based on multi-feature fusion according to claim 8, characterized in that: In step S5, the result is divided into 20*512 regions, and the impurity area of ​​each region is counted. The region with an impurity area greater than a certain level is set to 1, that is, the spray valve in the region is started.

10. The cotton impurity detection method based on multi-feature fusion according to claim 4, characterized in that: The training data of the deep learning model is labeled by the Label-Studio tool, and the labeling types include ground film, oil cotton, polypropylene yarn and packaging film.

Citation Information

Patent Citations

  • Polarization detection method and device for white and colorless foreign matters in cotton

    CN101968453A

  • Method for detecting transparent plastic impurities in seed cotton

    CN102004913A

  • Defect detection method based on polarization structured light imaging and improved Mask R-CNN

    CN112116576A

  • Cotton foreign fiber online detection method and system

    CN114419011A

  • Foreign fiber machine for foreign fiber detection and detection method

    CN117661161A

Cited By

  • Peanut oil impurity detection method based on image recognition analysis

    CN121027131A