A method for identifying broken materials of intelligent sorting equipment
By using image processing technology in the beige color selection equipment, traversing pixel points and combining pre-processing steps to identify crushed materials, the problem of difficult to simultaneously identify and remove crushed materials in the prior art is solved, and efficient and accurate crushing is achieved Material identification and hardware cost saving effect.
Patent Information
- Application Number
- CN202010685718.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-16
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-07-16
AI Technical Summary
The prior art is difficult to simultaneously identify and remove crushed materials from mixed rice when selecting beige, and a separate screening mechanism is usually required.
Using an intelligent sorting device based on image processing, the number of pixel points of the effective material is counted by traversing each pixel point in the image to be identified. If it is within the set threshold range, it is determined to be broken material, and combined with distortion correction and edge enhancement The pre-processing steps are integrated into the existing color sorting machine for identification.
实现了在色选的同时高效、准确识别碎物料,节约了硬件成本,提高了识别效率和准确率。
Smart Images

Figure CN111832490B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of material sorting, and in particular to a broken material identification method of intelligent sorting equipment based on image processing. Background Art
[0002] With the improvement of living standards, people's consumption of rice is gradually developing in the direction of high quality, functionalization and greenness. In the prior art, rice sorting based on image processing usually uses color difference to remove foreign impurities mixed in rice. The main foreign impurities are black impurities and yellow impurities. Broken rice mixed in rice is usually screened and sorted, which is not convenient to be carried out at the same time as color sorting, and a separate screening mechanism needs to be set up. Summary of the invention
[0003] In view of the above problems, the present invention provides a broken material identification method of an intelligent sorting device based on image processing, which can identify broken materials while performing color sorting.
[0004] A broken material identification method for intelligent sorting equipment traverses each pixel point of the material in the image to be identified, counts the number of valid material pixels, and determines it as broken material if the number of valid material pixels is within a set threshold range.
[0005] The algorithm steps to complete the traversal of each material pixel point from the slot linear image are as follows:
[0006] 1. Initialize the number of material pixels M = 0 and the background row identifier S = 0;
[0007] 2. Take a row of pixels;
[0008] 3. Traverse the pixels of the selected row one by one;
[0009] 4. Determine whether the currently traversed pixel is the last pixel in the row.
[0010] If it is not the last pixel in the row, determine whether it is a background pixel; if it is not a background pixel, set S=1, increase the number of material pixels M by 1, and then jump to step 3; if it is a background pixel, jump directly to step 3;
[0011] If it is the last pixel in the row, determine whether S is 1; if S=0, determine whether M is 0. If M=0, jump to step 3. If M≠0, determine whether the number of material pixels is within the set threshold range. If it is within the set threshold range, determine that it is broken material; if S=1, set S=0 and jump to step 3.
[0012] The background pixel is determined by obtaining the RGB range of the background pixel through the background pixel sample set. If the pixel in the image to be identified falls within the RGB range of the background pixel, it is determined to be a background pixel.
[0013] Preferably, the image to be identified is preprocessed before being traversed, and the preprocessing includes distortion correction and edge enhancement.
[0014] The present invention is based on the existing structure of the color sorter and incorporates a broken material recognition algorithm, and can recognize broken materials while performing color sorting, with high recognition efficiency and accuracy, while saving hardware costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is the flow chart of the broken material identification algorithm;
[0016] Figure 2 It is a black and white schematic diagram of the pixelated image to be identified. DETAILED DESCRIPTION
[0017] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present invention are provided for the purpose of illustration and description, and are not intended to be exhaustive or to limit the present invention to the disclosed forms. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention, and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific uses.
[0018] Example 1
[0019] Rice sorting machines are usually divided into several channels (for example, 64 channels or 128 channels), each channel corresponds to a blow valve, ensuring that the rice grains in each channel pass through the image collector and blow valve in order without stacking. The color sorting algorithm only needs to process the linear image in a single channel and make a blow valve judgment.
[0020] The present invention discloses a broken material identification method of an intelligent sorting device, which can identify broken materials while performing color sorting, and specifically comprises the following steps:
[0021] 1. Initialize the number of material pixels M = 0 and the background row identifier S = 0;
[0022] 2. Collect 1024 frames of background images as background pixel sample sets and count the RGB range of background pixels.
[0023] 3. Obtain the image to be identified and perform preprocessing. The image to be identified here can be a linear image of a groove containing only one piece of material, or it can be taken from a specific position of the linear image of the groove. Of course, the running distance of the material within the time difference from the identification of the broken material by the algorithm to the action of the blow valve must also be considered. Preprocessing includes distortion correction and edge enhancement. Distortion correction and edge enhancement are both common image processing technologies. Here is a brief description of the specific algorithm used in this embodiment.
[0024] Distortion correction algorithm process:
[0025] ⑴ Background image acquisition: Get 1 frame of background image as the reference background image for calibration, each row contains 2700 RGB pixels;
[0026] (2) Calibration coefficient calculation: First, calculate the average value M of the image in the RGB three channels. R 、M G 、M B , and then divide the RGB values of the 2700 pixels on the entire row of images by M R 、M G 、M B , get the distortion coefficient, and finally multiply the distortion coefficient on the RGB channel of these 2700 pixels by 2 7 , realize integer processing and obtain the final calibration coefficient;
[0027] ⑶ Distortion correction calculation: For each frame of the input image, the RGB values of the 2700 pixels are multiplied by the corresponding calibration coefficients, and then right-shifted by 7 bits to achieve distortion correction for each pixel.
[0028] The overall idea is to multiply the RGB value of each pixel of a line of linear images by the corresponding coefficient to flatten the image and remove the problem of bulges in the middle and depressions on both sides.
[0029] Edge enhancement algorithm process:
[0030] ⑴ Background image acquisition: obtain 1024 frames of background images as background pixel sample sets;
[0031] (2) Calculate the background pixel range and mean: Based on the background pixel sample set, count the upper and lower limits of RGB to obtain the background range (Rmin, Rmax) & (Gmin, Gmax) & (Bmin, Bmax) and background mean (Rmean, Gmean, Bmean);
[0032] ⑶ Slide scanning linear image: For each frame of linear image acquired, a sliding window of 4 (empirical value) pixels is used to traverse. When the RGB value of the pixel is within the background range, the state is 1 and it is marked as background. Otherwise, the state is 0 and it is marked as material. The state of the sliding window can be described by 4-bit binary 4'bXXXX (the high bit is the first pixel to arrive);
[0033] (4) Identify the edge of the material: According to the traversal direction of the sliding window, the edge is divided into two categories: "sliding in edge" and "sliding out edge". When the sliding window state is 4'b1100, it is identified as a sliding in edge, and the two pixels in the low state are the edge. When the sliding window state is 4'b0011, it is identified as a sliding out edge, and the two pixels in the high state are the edge.
[0034] ⑸ Process the edge of the material: Correct the RGB values of the two pixels identified as the edge in the above step to the background mean (Rmean, Gmean, Bmean).
[0035] The overall idea is to correct the two pixel areas at the edge of the material image to the background value to reduce the interference of the edge pixel value on the algorithm effect. Since image preprocessing must be performed in real time, the edge enhancement algorithm can only process a single frame of linear image and extract edge rules based on the distribution of linear pixel points.
[0036] 4. Take a row of pixels;
[0037] 5. Traverse the pixels of the selected row one by one;
[0038] 6. Determine whether the currently traversed pixel is the last pixel in the row.
[0039] If it is not the last pixel in the row, determine whether it is a background pixel; if it is not a background pixel, set S=1, increase the number of material pixels M by 1, and then jump to step 5; if it is a background pixel, jump directly to step 5;
[0040] If it is the last pixel in the row, determine whether S is 1; if S=0, determine whether M is 0. If M=0, jump to step 4 and select the next row of pixels. If M≠0, determine whether the number of material pixels is within the set threshold range. If it is within the set threshold range, determine that it is broken material; if S=1, set S=0, jump to step 4 and select the next row of pixels.
[0041] Combination Figure 2, and the above process is explained. By adjusting the camera position, the image to be identified includes background pixels and material pixels, from which the number of pixels in each image is determined, and the number of pixels in each row is also determined. In the above algorithm, the pixels are traversed in units of rows, and it is determined whether a material has been traversed. When a row is all background, S will not be set to 1, and Figure 2 It can be seen that a row of all background appears at both the top and bottom of the image, so it is not possible to simply judge whether a material has been traversed based on S. When the full background row is at the top of the image, M must be 0, so combining S and M can determine whether the image has been traversed. That is, when S=0 and M≠0 mentioned in the process, it is determined that a material has been traversed.
[0042] 7. Determine that the material in the image to be identified is broken material, and start the blow valve to remove the material.
[0043] Although this embodiment is described using rice as an example, the disclosed algorithm can be applied to the sorting of other types of materials.
[0044] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field and related fields without creative work should fall within the scope of protection of the present invention.
Claims
1. A method for identifying broken materials of intelligent sorting equipment, characterized in that: By traversing each pixel point of the material in the image to be identified, the number of valid material pixels is counted. If the number of valid material pixels is within the set threshold range, it is determined to be broken material; The material pixel traversal operation includes the following steps: Step 1, initialize the number of material pixels M = 0, and the background row identifier S = 0; Step 2, take a row of pixels; Step 3, traverse the pixels of the selected row one by one; Step 4: Determine whether the currently traversed pixel is the last pixel in the row. If it is not the last pixel in the row, determine whether it is a background pixel; if it is not a background pixel, set S=1, add 1 to the number of material pixels M, and jump to step 3; if it is a background pixel, jump directly to step 3; wherein, the method for determining the background pixel is to obtain the RGB range of the background pixel through the background pixel sample set, and if the pixel in the image to be identified falls into the RGB range of the background pixel, it is determined to be a background pixel; If it is the last pixel in the row, determine whether S is 1; if S=0, determine whether M is 0. If M=0, jump to step 3. If M≠0, determine whether the number of material pixels is within the set threshold range. If it is within the set threshold range, determine that it is broken material; if S=1, set S=0 and jump to step 3.
2. The method for identifying broken materials of the intelligent sorting equipment according to claim 1, characterized in that: Before traversing the image to be recognized, it is preprocessed, including distortion correction and edge enhancement.
Citation Information
Patent Citations
Method and system for detecting broken rice rate on line
CN102494977A
Image processing method and system of detecting tyre rubber geometric impurities
CN106097344A
Material color recognition method used for industrial robot visual sorting
CN108890692A
Flour bran speck detection method
CN109100350A
Grain sorting apparatus utilizing neural network
JP2002312762A
