Pepper sorting method, device, equipment and medium
By combining a rotating vibrating plate with image recognition technology, the problems of low efficiency and large recognition error in traditional chili sorting systems have been solved, achieving efficient and accurate automated chili sorting.
Patent Information
- Application Number
- CN202511343897.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2025-11-11
AI Technical Summary
Traditional chili sorting systems rely on manual operation, which is inefficient and easily affected by human factors. Existing image processing technology has large recognition errors in complex backgrounds, resulting in low sorting quality.
Using a rotating vibrating disc combined with image recognition technology, the image is cropped by acquiring background color data, and the characteristics of the chili peppers are analyzed using a preset image recognition model to generate air-blowing sorting instructions to remove unqualified chili peppers.
This improved the accuracy and efficiency of chili sorting, reduced labor costs, and enabled automated classification and sorting of chilies.
Smart Images

Figure CN120920385A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent sorting technology, and in particular to a chili sorting method, apparatus, equipment and medium. Background Technology
[0002] Chili peppers, as an important crop, are widely used in food processing, seasoning, and medicinal applications. Traditional chili pepper sorting relies on manual operation, which is inefficient and easily affected by human factors, making it impossible to accurately classify chili peppers according to their different characteristics using automation. Therefore, developing an efficient and intelligent chili pepper sorting system, which can significantly improve sorting efficiency and reduce labor costs, has become an important direction for the development of agricultural automation.
[0003] Existing chili pepper sorting systems primarily rely on image processing technology, determining the quality and grade of chilies through visual inspection. However, these technologies often suffer from recognition errors when dealing with complex backgrounds and the various morphological differences of the chilies themselves, leading to mis-sorting and low sorting quality. Therefore, there is an urgent need for an innovative chili pepper sorting method to address the problems in existing technologies. Summary of the Invention
[0004] To improve sorting quality, this application provides a chili sorting method, apparatus, equipment, and medium.
[0005] On the one hand, the chili pepper sorting method provided in this application adopts the following technical solution: A chili pepper sorting method, applied to a chili pepper sorting device, the device including a rotating vibrating plate, further comprising the following steps: Acquire raw image data of the chili pepper to be identified near the rotating vibrating disk; The background color data of the image data is obtained, and the original image data is cropped according to the background color data to obtain the image data to be identified. The background color data is configured to be obtained according to the color of each layer of the vibratory feeder. Based on the image data to be identified, the image is analyzed and processed according to a preset image recognition model to obtain the recognition result of at least one target. Based on the identification result of at least one target, an air-blowing sorting instruction is generated. The air-blowing sorting instruction is configured to control the sorting mechanism to execute the air-blowing sorting instruction to selectively remove the identified target.
[0006] Optionally, the training method for the preset image recognition model includes: Acquire raw images of chili peppers near the rotating vibrating disc and establish a chili pepper image library; Use the annotation tool to annotate each image; The XML file generated from the annotations is converted into a YOLO format TXT file using a conversion program; Input the dataset into the YOLOv11 model for training to obtain the recognition model.
[0007] Optionally, the step of annotating each image using an annotation tool includes: The Labelimg tool was used to annotate the chili pepper images, and the three parts of the same chili pepper—the pepper body, the pepper stem, and the pepper cap—were annotated independently. The labeled chili pepper body, stem, and cap are identified as different targets, and their category numbers are distinguished in the labeling data.
[0008] Optionally, the step of acquiring the background color data of the image data, cropping the original image data based on the background color data to obtain the image data to be identified, wherein the background color data is configured to be obtained based on the colors of each layer of the vibratory feeder, includes: Obtain the background color data of the vibratory feeder, which contains a multi-layer structure and each layer is set to a different color; Based on the background color data, chili pepper images with a background area of a predetermined color are selected for identification; wherein, the predetermined color is black, and only chili pepper images with a black background are identified and processed.
[0009] Optionally, the step of analyzing and processing the image data to be identified based on a preset image recognition model to obtain the recognition result of at least one target includes: Acquire the image data to be identified; The image data is identified by machine recognition software, which identifies three feature regions: the chili stem region, the chili cap region, and the chili fruit body region. The center coordinates (x1, y1), (x2, y2), and (x3, y3) corresponding to the three feature regions were calculated respectively. Based on the three characteristic regions and three center coordinate points, determine whether the peppers are qualified and generate an air-blowing sorting instruction.
[0010] Optionally, the step of determining whether a chili pepper is qualified and generating an air-blowing sorting instruction based on the three feature regions and three center coordinate points includes: If none of the three characteristic areas are identified, the pepper is considered defective, and the sorting mechanism will execute the blow-away command.
[0011] Optionally, the step of determining whether a chili pepper is qualified and generating an air-blowing sorting instruction based on the three feature regions and three center coordinate points includes: If three feature regions are identified, then based on the three center coordinate points, calculate the difference between x1, x2, and x3 and the difference between y1, y2, and y3. Based on the differences between x1, x2, x3 and y1, y2, y3, determine whether the chili pepper is a curved chili pepper; If the difference between x1, x2, and x3 is less than the first threshold, or the difference between y1, y2, and y3 is greater than the second threshold, then it is determined to be a bent chili pepper, and the sorting mechanism is controlled to execute the air-blowing sorting instruction. Based on the coordinates (x2, y2) and (x3, y3), obtain the chili pepper head orientation vector; The angle between the chili pepper head orientation vector and the preset direction vector is obtained based on the chili pepper head orientation vector and the preset direction vector. If the included angle is greater than a preset angle threshold, the sorting mechanism is controlled to execute an air-blowing sorting command.
[0012] Secondly, the chili sorting device provided in this application adopts the following technical solution: A chili sorting device, comprising: A rotating vibratory feeder, the vibratory feeder comprising a multi-layer structure, with each layer set to a different color; The image acquisition module is used to acquire image data of the chili peppers to be identified near the air nozzle of the sorting mechanism; A recognition model building module is used to build a chili pepper recognition model based on the image data; The target identification and analysis module is used to acquire background color data, and to analyze and process the image data of the chili pepper to be identified and the background color data based on the identification model to obtain the identification target. The background color data is characterized by the color of each layer of the vibrating disc. The air-blowing sorting instruction generation and execution module is used to generate air-blowing sorting instructions based on the identified target, wherein the air-blowing sorting instructions include release instructions and blow-away instructions; control the sorting mechanism to execute the sorting instructions to remove the identified target from the chili peppers to be identified; the air-blowing sorting instruction generation and execution module includes an air nozzle and a solenoid valve, the air nozzle being set on the top layer of the vibrating plate to blow away the top layer of chili peppers.
[0013] Thirdly, the computer device provided in this application adopts the following technical solution: A computer device, comprising one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method of the claims.
[0014] Fourthly, the computer-readable storage medium provided in this application adopts the following technical solution: A computer-readable storage medium storing a computer program capable of being loaded by a processor and executing the method described in the claims.
[0015] In summary, this application includes at least one of the following beneficial technical effects: This application acquires raw image data of chili peppers to be identified near a rotating vibrating disk; then, it acquires the background color data of the image data, and crops the raw image data according to the background color data to obtain the image data to be identified. The background color data is configured to be obtained based on the colors of each layer of the vibrating disk. Next, based on the image data to be identified, it performs analysis and processing according to a preset image recognition model to obtain the identification result of at least one target. Based on the identification result of at least one target, it generates an air-blowing sorting instruction, which is configured to control the sorting mechanism to execute the air-blowing sorting instruction to selectively remove the identified targets. By acquiring the raw image data of the chili peppers and combining it with the background color data for cropping, the image of the chili pepper to be identified is effectively extracted, thereby reducing background interference, preventing the camera from identifying chili peppers in other locations, and improving the accuracy of image recognition. Combined with the preset image recognition model for analysis and processing, the characteristics of the chili peppers can be accurately identified, thereby determining their quality or classification. This invention's device completes the sorting of chili peppers, laying the foundation for the next step of automated chili pepper processing. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an embodiment of this application; Figure 2 This is a block diagram of the device structure according to an embodiment of this application. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0018] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0019] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "fixed" can mean a fixed connection, a detachable connection, or an integral part; it can mean a mechanical connection or an electrical connection; it can mean a direct connection or an indirect connection through an intermediate medium; it can mean the internal communication of two components or the interaction between two components, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0020] Furthermore, if the embodiments of this invention involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the meaning of "and / or" throughout the text includes three parallel solutions; for example, "A and / or B" includes solution A, solution B, or a solution where both A and B are satisfied simultaneously. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0021] Example 1 This application discloses a method for sorting chili peppers.
[0022] Reference Figure 1 A chili pepper sorting method is disclosed, applied to a chili pepper sorting device. The device includes a rotating vibrating disc 901 with a multi-layer structure. In this embodiment, a three-layer structure is used as an example, and different colors of paint are pre-painted on the three spiral tracks of the rotating vibrating disc 901. An air nozzle is provided on the side wall of the uppermost track of the rotating vibrating disc 901. Compressed air is controlled by a solenoid valve to flow to the air nozzle to blow away unqualified chili peppers.
[0023] The method includes the following steps: S10. Obtain the original image data of the chili pepper to be identified near the rotating vibrating disk 901; In this embodiment, a camera module is installed on or near the rotating vibratory feeder 901. The camera module can be a high-resolution industrial camera, and its placement should ensure clear capture of the chili peppers passing over the vibratory feeder 901. In this embodiment, the camera is mounted 20-30cm above the air nozzle, tilted at a 15-20 degree angle, to photograph the chili peppers passing over the air nozzle. The raw image data includes a color RGB image with a resolution of at least 1920x1080 pixels to ensure clear details of the chili peppers.
[0024] S20. Obtain the background color data of the image data, and crop the original image data according to the background color data to obtain the image data to be identified. The background color data is configured to be obtained according to the color of each layer of the vibratory feeder. Optionally, the background color data of the vibratory feeder is obtained, wherein the vibratory feeder comprises a multi-layer structure and each layer is set to a different color; Based on the background color data, chili pepper images with a background area of a predetermined color are selected for identification; wherein, the predetermined color is black, and only chili pepper images with a black background are identified and processed.
[0025] The three-layer spiral track of the rotating vibrating disc 901 is painted with different colors to separate different areas. In this embodiment, the top layer, where the air nozzle is installed, is painted black to prevent the camera from recognizing chili peppers in other locations; only chili peppers with a black background need to be identified and processed. Specifically, image processing technology (such as color separation algorithms) is used to extract background color data. Background color data can be obtained through color thresholding, and different color areas are distinguished based on a preset color model (such as RGB, HSV, etc.).
[0026] The original image data contains backgrounds of various colors (including black). Before cropping the original image data based on the background color data, the image needs to be preprocessed.
[0027] Optionally, the image can be converted from the RGB color space to HSV (Hue, Saturation, Luminance) or LAB color space. This makes it easier to separate black backgrounds from other color areas. In HSV space, black is typically represented by a low luminance value, so the luminance (V channel) value can be used to determine the background of the image. In LAB space, the L channel represents luminance, and the A and B channels represent color components; a black background can also be distinguished in LAB space by its low luminance (L value).
[0028] Extracting the black background: Since the black background has a low color value in the image, a simple color gamut can be used to identify the black area. The specific steps are as follows: Set the threshold for black in the HSV or LAB color space. For example, black can be defined using the following HSV ranges: Hue (H) value range: 0–179 (for HSV model) Saturation (S) value range: 0–255 Brightness (V) value range: 0–50 (low brightness) This color range is used to mask the image, generating a binary mask image with a black background. Areas in the image with a black background are marked as 1, and other areas as 0.
[0029] Cropping areas outside the background: Using a mask image as a filter, all non-black background areas in the original image are removed, retaining only the black background areas. This can be achieved using a bitwise AND operation: multiplying the original image with the mask image retains the black background portion and removes the other colored background portions. The resulting image will contain only the image data of the black background area.
[0030] Post-cropped image processing, noise removal: If small noise points (such as gray specks) exist during background cropping, morphological operations (such as erosion or dilation) can be used to remove them. Specifically: use erosion to remove small noise points (e.g., small dots near a black background). Use dilation to enhance effective areas in the image (e.g., the area of a chili pepper).
[0031] Save the image data to be recognized. The processed image (i.e., the image containing only the black background area) will become the image data to be recognized. At this point, the image data has been cropped, the background color (non-black areas) has been removed, and the remaining part only includes the chili pepper area in the black background, which can be further processed for recognition.
[0032] S30. Based on the image data to be identified, perform analysis and processing according to a preset image recognition model to obtain the recognition result of at least one target. Optionally, the training method for the preset image recognition model includes: Acquire raw images of chili peppers near the rotating vibrating disk 901 and establish a chili pepper image library; Use the annotation tool to annotate each image; The XML file generated from the annotations is converted into a YOLO format TXT file using a conversion program; Input the dataset into the YOLOv11 model for training to obtain the recognition model.
[0033] The step of using annotation tools to annotate each image includes: The Labelimg tool was used to annotate the chili pepper images, and the three parts of the same chili pepper—the pepper body, the pepper stem, and the pepper cap—were annotated independently. The labeled chili pepper body, stem, and cap are identified as different targets, and their category numbers are distinguished in the labeling data.
[0034] Optionally, based on the image data to be identified, analysis and processing are performed according to a preset image recognition model to obtain the recognition result of at least one target, including: Acquire the image data to be identified; Specifically, when inputting an image, the image data is first obtained after background cropping to ensure that the image contains only the chili pepper and its black background area.
[0035] Image preprocessing includes image denoising and image enhancement. Image denoising removes noise from the image using Gaussian blur or median filtering. Image enhancement improves image quality using methods such as histogram equalization or contrast adjustment to facilitate subsequent feature extraction.
[0036] The image data is identified by machine recognition software, which identifies three feature regions: the chili stem region, the chili cap region, and the chili fruit body region. Based on deep learning or traditional computer vision methods, three feature regions in an image are identified: the chili pepper stem region, the chili pepper cap region, and the chili pepper fruit body region. The chili pepper stem region is typically located at the top of the chili pepper, near the stem. Edge detection (such as Canny edge detection) or color filtering (such as the green region in HLS color space) can be used to extract this region.
[0037] The cap area of a chili pepper: This is the cap-like part located at the top of the chili pepper, usually around the base. This area can be identified through shape analysis (such as the outline of a circle or polygon).
[0038] The fruiting body region of a chili pepper: This is the main part of the chili pepper, usually cylindrical or conical, containing most of the pepper's flesh. The boundaries of this region can be extracted using morphological operations such as dilatation and erosion.
[0039] These three regions are identified using deep learning models (such as YOLO and Mask R-CNN) or traditional feature matching methods (such as SIFT and SURF).
[0040] The center coordinates (x1, y1), (x2, y2), and (x3, y3) corresponding to the three feature regions were calculated respectively.
[0041] Establish a planar coordinate system on the acquired chili pepper image, with the length of the image as the x-axis and the width as the y-axis.
[0042] Chili stem region: The center point coordinates (x1, y1) are obtained by calculating the outline of the stem region; Chili cap region: By performing contour detection on the cap region, the center coordinates (x2, y2) of this region are calculated; Pepper fruit body region: The center coordinates (x3, y3) are obtained by detecting the outline of the fruit body region; These center coordinates can be obtained by calculating the centroid of the region. The centroid calculation method is as follows: Where xi and yi are the coordinates of the midpoint of the contour, and Ai is the area of the region represented by that point.
[0043] Based on the three characteristic regions and three central coordinate points, it is determined whether the peppers are qualified and an air-blowing sorting instruction is generated. According to pre-set standards, the size of the pepper fruit area is checked to see if it meets expectations.
[0044] In one specific implementation, the step of determining whether a chili pepper is qualified and generating an air-blowing sorting instruction based on the three feature regions and three center coordinate points includes: If none of the three characteristic areas are identified, the pepper is considered defective, and the sorting mechanism will execute the blow-away command.
[0045] Optionally, the step of determining whether a chili pepper is qualified and generating an air-blowing sorting instruction based on the three feature regions and three center coordinate points includes: If three feature regions are identified, then based on the three center coordinate points, calculate... , , The difference between , , The difference between them; According to the above , , and , , The difference between the values can be used to determine whether a chili pepper is a curved chili pepper. like , , The difference between them is less than the first threshold, or , , If the difference between the values is greater than the second threshold, it is determined to be a bent chili pepper, and the sorting mechanism is controlled to execute the air-blowing sorting instruction. In one specific implementation scheme, it can be based on the above , , and , , The difference between the values can be used to determine whether a chili pepper is curved. This can be determined by calculating the difference along the x-axis and the y-axis. Specifically: x-axis difference: ; y-axis difference: .
[0046] If Δx is less than the first threshold, it means that the relative positions of the three characteristic regions of the chili pepper in the horizontal direction are basically straight or close to straight, indicating that the chili pepper is relatively straight overall.
[0047] If Δy is greater than the second threshold, it indicates that the three feature regions of the chili pepper have a large difference in the vertical direction, which may indicate that the chili pepper is bent. The smaller Δy is, the smaller the difference of the chili pepper on the y-axis, that is, the more the chili pepper tends to be straight.
[0048] In this implementation scheme, the first and second thresholds are adjusted according to the actual situation. For example: The first threshold can be set to 35px, indicating that if the difference between the three feature regions on the x-axis is too small, they are considered to have no obvious curvature in the horizontal direction. The second threshold can be set to 20px, indicating that if the difference between the three feature regions on the y-axis is too large, the chili pepper is considered to be severely curved.
[0049] Optionally, since the chili sorting device of this application needs to sort out qualified chilies and then remove the caps from the boxes, in order to improve the quality of the subsequent removal of the caps from the boxes, chilies with the heads facing inward need to be removed.
[0050] The step of determining whether a chili pepper is qualified and generating an air-blowing sorting instruction based on the three feature regions and three center coordinate points also includes: Based on the coordinates (x2, y2) and (x3, y3), obtain the chili pepper head orientation vector; The angle between the chili pepper head orientation vector and the preset direction vector is obtained based on the chili pepper head orientation vector and the preset direction vector. If the included angle is greater than a preset angle threshold, the sorting mechanism is controlled to execute an air-blowing sorting command.
[0051] In this application, the preset direction is the discharge direction of the rotating vibratory plate 901. To facilitate the subsequent cap removal quality, the preset angle can usually be set to 60 degrees. 0 -120 0 In this embodiment, the preset angle threshold can be 90 degrees.
[0052] In one specific embodiment, the formula for calculating the angle θ between the chili pepper head orientation vector and the preset direction vector is: ; Where V1 is the chili pepper head orientation vector, and V2 is the preset direction vector.
[0053] Then, the included angle θ is obtained using the inverse cosine function. .
[0054] S40. Based on the identification result of at least one identification target, generate an air-blowing sorting instruction, wherein the air-blowing sorting instruction is configured to control the sorting mechanism to execute the air-blowing sorting instruction to selectively remove the identification target.
[0055] Example 2 This application also discloses a chili sorting device.
[0056] A chili sorting device, comprising: A rotating vibratory disk 901, the vibratory disk comprising a multi-layer structure, wherein each layer is set to a different color; Image acquisition module 902 is used to acquire image data of the chili peppers to be identified near the air nozzle of the sorting mechanism; The recognition model construction module 903 is used to construct a chili pepper recognition model based on the image data; The target identification analysis module 904 is used to acquire background color data, and to analyze and process the image data of the chili pepper to be identified and the background color data based on the identification model to obtain the identification target. The background color data is characterized by the color of each layer of the vibrating plate. The air-blowing sorting instruction generation and execution module 905 is used to generate air-blowing sorting instructions based on the identified target, wherein the air-blowing sorting instructions include release instructions and blow-away instructions; control the sorting mechanism to execute the sorting instructions to remove the identified target from the chili peppers to be identified; the air-blowing sorting instruction generation and execution module 905 includes an air nozzle and a solenoid valve, and the air nozzle is set on the top layer of the vibrating plate to blow away the top layer of chili peppers.
[0057] Example 3 This application also discloses a computer device, including one or more processors and a memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the methods described above.
[0058] Example 4 This application also discloses a computer-readable storage medium storing a computer program that can be loaded by a processor and execute the method.
[0059] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a device including one or any combination of the above-mentioned memories. The computer may be a variety of computing devices, including smart terminals and servers.
[0060] In the above embodiments of this disclosure, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0061] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0062] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0063] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0064] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable non-volatile storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a non-volatile storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned non-volatile storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0065] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A method for sorting chili peppers, characterized in that, An application to a chili sorting device, the device including a rotating vibrating plate, further comprising the following steps: Acquire raw image data of the chili pepper to be identified near the rotating vibrating disk; The background color data of the original image data is obtained, and the original image data is cropped according to the background color data to obtain the image data to be identified. The background color data is configured to be obtained according to the color of each layer of the vibratory feeder. Based on the image data to be identified, the image is analyzed and processed according to a preset image recognition model to obtain the recognition result of at least one target. Based on the identification result of at least one target, an air-blowing sorting instruction is generated. The air-blowing sorting instruction is configured to control the sorting mechanism to execute the air-blowing sorting instruction to selectively remove the identified target.
2. The chili pepper sorting method according to claim 1, characterized in that, The training method for the preset image recognition model includes: Acquire raw images of chili peppers near the rotating vibrating disc and establish a chili pepper image library; Use the annotation tool to annotate each image; The XML file generated from the annotations is converted into a YOLO format TXT file using a conversion program; Input the dataset into the YOLOv11 model for training to obtain the recognition model.
3. The chili pepper sorting method according to claim 2, characterized in that, The step of using annotation tools to annotate each image includes: The Labelimg tool was used to annotate the chili pepper images, and the three parts of the same chili pepper—the pepper body, the pepper stem, and the pepper cap—were annotated independently. The labeled chili pepper body, stem, and cap are identified as different targets, and their category numbers are distinguished in the labeling data.
4. The chili pepper sorting method according to claim 1, characterized in that, The process involves acquiring background color data from the image data, cropping the original image data based on the background color data to obtain the image data to be recognized, wherein the background color data is configured to be obtained based on the colors of each layer of the vibratory feeder, including: Obtain the background color data of the vibratory feeder, which contains a multi-layer structure and each layer is set to a different color; Based on the background color data, chili pepper images with a background area of a predetermined color are selected for identification; wherein, the predetermined color is black, and only chili pepper images with a black background are identified and processed.
5. A chili pepper sorting method according to claim 4, characterized in that, The step of analyzing and processing the image data to be identified based on a preset image recognition model to obtain the recognition result of at least one target includes: Acquire the image data to be identified; The image data is identified by machine recognition software, which includes three feature regions: the chili stem region, the chili cap region, and the chili fruit body region. The center coordinates of the three feature regions were calculated respectively. , )、( , )、( , ); Based on the three characteristic regions and three center coordinate points, determine whether the peppers are qualified and generate an air-blowing sorting instruction.
6. A chili sorting method according to claim 5, characterized in that, The step of determining whether a chili pepper is qualified and generating an air-blowing sorting instruction based on the three feature regions and three center coordinate points includes: If none of the three characteristic areas are identified, the chili pepper is considered defective, and the sorting mechanism is instructed to execute an air-blowing sorting command.
7. A chili sorting method according to claim 5, characterized in that, The step of determining whether a chili pepper is qualified and generating an air-blowing sorting instruction based on the three feature regions and three center coordinate points includes: If three feature regions are identified, then based on the three center coordinate points, calculate... , , The difference between , , The difference between them; According to the above , , and , , The difference between the values can be used to determine whether a chili pepper is a curved chili pepper. like , , The difference between them is less than the first threshold, or , , If the difference between the values is greater than the second threshold, it is determined to be a bent chili pepper, and the sorting mechanism is controlled to execute the air-blowing sorting instruction. According to the coordinate points ( , )、( , ), to obtain the chili pepper head orientation vector; The angle between the chili pepper head orientation vector and the preset direction vector is obtained based on the chili pepper head orientation vector and the preset direction vector. If the included angle is greater than a preset angle threshold, the sorting mechanism is controlled to execute an air-blowing sorting command.
8. A chili pepper sorting device, characterized in that, include: A rotating vibratory feeder, the vibratory feeder comprising a multi-layer structure, with each layer set to a different color; The image acquisition module is used to acquire image data of the chili peppers to be identified near the air nozzle of the sorting mechanism; A recognition model building module is used to build a chili pepper recognition model based on the image data; The target identification and analysis module is used to acquire background color data, and to analyze and process the image data of the chili pepper to be identified and the background color data based on the identification model to obtain the identification target. The background color data is characterized by the color of each layer of the vibrating disc. The air-blowing sorting instruction generation and execution module is used to generate air-blowing sorting instructions based on the identified target, wherein the air-blowing sorting instructions include release instructions and blow-away instructions; control the sorting mechanism to execute the sorting instructions to remove the identified target from the chili peppers to be identified; the air-blowing sorting instruction generation and execution module includes an air nozzle and a solenoid valve, the air nozzle being set on the top layer of the vibrating plate to blow away the top layer of chili peppers.
9. A computer device, characterized in that, Includes one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs being configured to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and execute the method of any one of claims 1-7.