Plastic particle detection method and device based on machine vision and storage medium

Through machine vision technology, the cross-sectional specular reflection image of plastic particles is processed, and the center, area and angle of the circle are calculated, which solves the problems of low detection efficiency and insufficient accuracy in the prior art, and achieves efficient and accurate plastic particles quality detection.

CN119223852AInactive Publication Date: 2024-12-31SHENZHEN HUA WAN CAI IND
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411751240.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the quality detection efficiency of plastic particles is low and there are false or missed inspections, which mainly rely on weight and volume screening. Manual naked eye detection is required in the future, resulting in low efficiency and inaccurate detection.

Method used

Using machine vision-based detection method, by obtaining cross-sectional specular reflection images of plastic particles, processing images to obtain grayscale information, determining the centers of different regions, connecting lines to form detection areas, calculating area, distance and angle, performing quality detection, and improving Detection accuracy and efficiency.

Benefits of technology

It improves the efficiency and accuracy of plastic particle quality detection, reduces false detection and missed detection, realizes intelligent quality evaluation, and provides more accurate quality level detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119223852A_ABST
    Figure CN119223852A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of plastic particle detection, and discloses a plastic particle detection method and device based on machine vision and a storage medium. The method comprises the following steps: acquiring a cross section mirror reflection image of a plastic particle to be detected; processing the cross section mirror reflection image to obtain gray scale information of the reflection image; obtaining circle centers of different areas according to the gray scale information; connecting the circle centers of the different areas to obtain a detection area; according to the detection area, obtaining the area of the detection area, the distance between the areas and a first angle between the areas; and performing quality detection according to the area of the detection region, the distance between the regions and the first angle between the regions to obtain a detection result of the plastic particles. According to the method, the quality of the plastic particles is detected through machine vision, automatic detection is achieved, the detection efficiency of plastic particle products is improved, and the production quality is 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 plastic particle detection, and in particular to a plastic particle detection method, device and storage medium based on machine vision. Background Art

[0002] At present, plastic particles are made by mixing plastics, adhesives, pigments, stabilizers, flame retardants, foaming agents and other substances, and then heating, extruding, cooling and cutting. Plastic particles have good impact resistance and ductility. They can be used in the plastic products industry, building materials industry, medical equipment industry, and can also be used in the preparation of aluminum alloy grains.

[0003] The quality inspection of plastic particles is a very important link. However, in the prior art, the quality inspection of plastic particles mainly relies on preliminary screening by weight and volume to obtain plastic particles whose weight and volume meet the requirements. After the plastic particles pass the first step of screening, they need to be inspected by the naked eye for the second step of quality inspection (such as diameter, rounded corners, notches, dirty spots, foreign matter, etc.). The plastic particle inspection results obtained in this way are not only inefficient, but also have the phenomenon of false detection or missed detection. Summary of the invention

[0004] The present invention provides a method, device and storage medium for detecting plastic particles based on machine vision, so as to detect the quality of plastic particles according to the plastic circle center data and improve the detection efficiency of the plastic particle quality.

[0005] In a first aspect, in order to solve the above technical problems, the present invention provides a method for detecting plastic particles based on machine vision, comprising: Acquire a cross-sectional specular reflection image of the plastic particles to be detected; Processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; According to the grayscale information, obtaining the centers of different areas; Connect the centers of the different areas to obtain a detection area; According to the detection area, obtaining the area of ​​the detection area, the distance between the areas, and the first angle between the areas; Quality detection is performed according to the area of ​​the detection area, the distance between the areas, and the first angle between the areas to obtain the detection result of the plastic particles.

[0006] As an optional implementation, the step of obtaining a cross-sectional specular reflection image of the plastic particle to be detected includes: The reflective surface of the plastic particles to be inspected is illuminated by a parallel light emitting device to obtain a parallel light band formed on the surface of the plastic particles; The parallel light bands are received and processed to obtain a cross-sectional mirror reflection image of the plastic particles to be detected.

[0007] As an optional implementation manner, processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image includes: According to the cross-sectional mirror reflection image, color separation is performed to obtain Three color channel information; According to the Three color channel information, calculate the gray value, and obtain the gray information of the reflected image; Wherein, the formula for calculating the gray value is: In the formula, represents the intensity of the red channel, Represent the intensity of the green channel, represents the intensity of the blue channel, Represents the grayscale information of the reflection image.

[0008] As an optional implementation manner, obtaining the centers of different areas according to the grayscale information includes: According to the change of the grayscale information, variable grayscale information is obtained; According to the variable grayscale information, regions with different grayscale values ​​are obtained; According to the regions with different grayscale values, the centers of the different regions are obtained.

[0009] As an optional implementation manner, obtaining the centers of different regions according to the regions with different grayscale values ​​includes: Obtaining shape information of the regions according to the regions with different grayscale values; According to the shape information, a circumscribed circle of the shape information is obtained; According to the circumscribed circle, the centers of different areas are obtained.

[0010] As an optional implementation manner, connecting the centers of the different areas to obtain the detection area includes: Connect the centers of the circles of the different areas to obtain a straight line equation of the line segment; According to the straight line equation of the line segment, the slope value of the line segment is obtained; According to the slope values ​​of the line segments, a set of slope values ​​having a mean value of 0 is obtained; Dividing the detection area according to the set; Among them, the straight line equation is established in a two-dimensional rectangular coordinate system, wherein the two-dimensional rectangular coordinate system takes the center of the field of view of the visual sensor as the origin, the right hand side of the observer at the standard observation position is the positive direction of the x-axis, and the top of the observer at the standard observation position is the positive direction of the y-axis.

[0011] As an optional implementation manner, obtaining the area of ​​the detection area, the distance between the areas, and the first angle between the areas according to the detection area includes: According to the detection area, construct an edge area function; According to the edge area function, the area of ​​the detection area, the distance between the areas and the first angle between the areas are obtained; wherein, the edge area function is integrated to obtain the area of ​​the detection area; the center of the circumscribed circle of the edge area is solved, the distance between the center of the first area and the center of the second area is calculated, the distance between the center of the first area and the center of the second area is determined as the distance between the areas, and the angle between the equation of the straight line between the center of the first area and the center of the second area and the x-axis is determined as the first angle between the areas.

[0012] As an optional implementation manner, the quality detection is performed according to the area of ​​the detection area, the distance between the areas, and the first angle between the areas to obtain the detection result of the plastic particles, including: Weighting the areas of the detection areas, the distances between the areas, and the first angles between the areas to obtain valued data for the detection areas; A quality inspection score is evaluated based on the assigned data to obtain a quality grade, and the quality grade of the plastic particles is marked to obtain a test result of the plastic particles.

[0013] In a second aspect, the present invention provides a plastic particle detection device based on machine vision, characterized in that it includes: A visual capture module, used to obtain a cross-sectional specular reflection image of the plastic particles to be detected; A grayscale processing module, used for processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; A circle center marking module, used to obtain the center of different areas according to the grayscale information; A region division module, used to connect the centers of the different regions to obtain a detection region; A data processing module, used for obtaining the area of ​​the detection area, the distance between the areas and the first angle between the areas according to the detection area; The weight assignment module is used to perform quality detection according to the area of ​​the detection area, the distance between the areas and the first angle between the areas to obtain the detection result of the plastic particles.

[0014] In a third aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned machine vision-based plastic particle detection methods.

[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a method, device and storage medium for detecting plastic particles based on machine vision. The method is executed by a controller and includes: obtaining a cross-sectional mirror reflection image of a plastic particle to be detected; processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; obtaining the center of different areas according to the grayscale information; connecting the centers of different areas to obtain a detection area; obtaining the area of ​​the detection area, the distance between the areas and the first angle between the areas according to the detection area; performing quality detection according to the area of ​​the detection area, the distance between the areas and the first angle between the areas to obtain a detection result of the plastic particles. When the controller receives the color image obtained after the mirror reflection of the cross-section, the image processing technology is used to determine the different ranges of surface color, and then the color is divided into regions based on different ranges, which improves the efficiency of quality inspection and provides a basis for quality assessment; at the same time, by extracting and analyzing the different regions, the data in the plastic particle quality inspection process is more accurate than traditional technologies, thereby improving the accuracy of plastic particle inspection, and also providing a means for the intelligent implementation of the quality inspection process; in addition, in the process of quality assessment, the quality grade is evaluated by assigning weights to the data. In actual applications, the accuracy of data evaluation in the quality grade inspection process is effectively achieved based on the evaluation results, and the purpose of accurately realizing the quality inspection of plastic particles is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a schematic flow chart of a plastic particle detection method based on machine vision provided by the first embodiment of the present invention; Figure 2 is a schematic diagram of a process of obtaining the center of a region according to grayscale information in an embodiment of the present invention; Figure 3 Schematic diagram of the structure of a plastic particle detection device based on machine vision provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] At present, plastic particles are made by mixing plastics, adhesives, pigments, stabilizers, flame retardants, foaming agents and other substances, and then heating, extruding, cooling and cutting. Plastic particles have good impact resistance and ductility. They can be used in the plastic products industry, building materials industry, medical equipment industry, and can also be used in the preparation of aluminum alloy grains.

[0019] The quality inspection of plastic particles is a very important link. However, in the prior art, the quality inspection of plastic particles mainly relies on preliminary screening by weight and volume to obtain plastic particles whose weight and volume meet the requirements. After the plastic particles pass the first step of screening, they need to be inspected by the naked eye for the second step of quality inspection (such as diameter, rounded corners, notches, dirty spots, foreign matter, etc.). The plastic particle inspection results obtained in this way are not only inefficient, but also have the phenomenon of false detection or missed detection.

[0020] In order to solve the above problems, a plastic particle detection method based on machine vision provided in an embodiment of the present application will be introduced and explained in detail through the following specific embodiments.

[0021] Reference Figure 1 The first embodiment of the present invention provides a method for detecting plastic particles based on machine vision, comprising the following steps: S11, obtaining a cross-sectional mirror reflection image of the plastic particle to be detected; S12, processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; S13, obtaining the centers of different areas according to the grayscale information; S14, connecting the centers of the different areas to obtain a detection area; S15, obtaining, according to the detection area, the area of ​​the detection area, the distance between the areas, and the first angle between the areas; S16, performing quality inspection according to the area of ​​the inspection area, the distance between the areas, and the first angle between the areas to obtain the inspection result of the plastic particles.

[0022] It should be noted that the acquisition of the plastic particles to be detected is completed by the machine vision module, which is a key component in modern industrial automation and intelligent manufacturing. It captures and analyzes images through high-precision visual sensors to provide the necessary visual information for the automation system. This module usually includes different types of cameras, such as CCD (charge-coupled device) cameras, CMOS (complementary metal oxide semiconductor) cameras and line array cameras, each of which has unique advantages and application scenarios. CCD cameras are known for their high resolution, high sensitivity and excellent image quality, and are particularly suitable for applications that require high-quality image capture. CMOS cameras are favored for their fast imaging capabilities, low power consumption and cost-effectiveness, and are widely used in situations that require fast response. Line array cameras are used for continuous object detection and measurement tasks with their expertise in high-speed scanning and precise measurement.

[0023] Exemplarily, in this embodiment, the machine vision module uses a CMOS camera. The image data of the product to be marked collected by the CMOS camera, and the generated digital image data contains detailed visual information of the product to be marked, which can be used for further image processing, analysis and decision making.

[0024] In an embodiment of the present invention, a cross-sectional mirror reflection image of a plastic particle to be detected is obtained; the cross-sectional mirror reflection image is processed to obtain grayscale information of the reflection image; the centers of different regions are obtained based on the grayscale information; the centers of different regions are connected to obtain a detection region; based on the detection region, the area of ​​the detection region, the distance between regions, and the first angle between regions are obtained; quality detection is performed based on the area of ​​the detection region, the distance between regions, and the first angle between regions to obtain a detection result of the plastic particles. When the controller receives the color image obtained after the mirror reflection of the cross-section, the image processing technology is used to determine the different ranges of surface color, and then the color is divided into regions based on different ranges, which improves the efficiency of quality inspection and provides a basis for quality assessment; at the same time, by extracting and analyzing the different regions, the data in the plastic particle quality inspection process is more accurate than traditional technologies, thereby improving the accuracy of plastic particle inspection, and also providing a means for the intelligent implementation of the quality inspection process; in addition, in the process of quality assessment, the quality grade is evaluated by assigning weights to the data. In actual applications, the accuracy of data evaluation in the quality grade inspection process is effectively achieved based on the evaluation results, and the purpose of accurately realizing the quality inspection of plastic particles is achieved.

[0025] In order to facilitate the understanding of the present invention, some preferred embodiments of the present invention are further described below.

[0026] In step S11, a cross-sectional mirror reflection image of the plastic particle to be detected is obtained, including: The reflective surface of the plastic particles to be inspected is illuminated by a parallel light emitting device to obtain a parallel light band formed on the surface of the plastic particles; The parallel light bands are received and processed to obtain a cross-sectional mirror reflection image of the plastic particles to be detected.

[0027] It should be noted that the parallel light emitting device means that the emitted light beam is parallel. After the parallel light beam irradiates the plastic particles to be detected, it is reflected by the plastic particles to be detected and the light beam carrying the information of the plastic particles to be detected is transmitted. By receiving the light beam information, the information value is obtained.

[0028] It should be noted that in the process of obtaining the cross-sectional mirror reflection image of the plastic particles to be detected, the image signal needs to be sampled, and the analog signal of the brightness change information is obtained as discrete sampling points within a certain time interval. After sampling, the analog signal of the brightness change information is still continuous and needs to be quantized into discrete digital values. The quantization process maps the amplitude of the sampling point to discrete levels, so it involves the selection of the quantizer and the determination of the quantization level. Usually, equidistant discrete levels are used, and ADC (Analog-to-Digital Converter) is used to perform the quantization operation. The quantized sample values ​​need to be encoded and represented as binary data for easy storage and transmission. The encoded binary data can be further processed and analyzed by a digital signal processor, a microcontroller or other digital system.

[0029] Exemplarily, the parallel light emitting device described in this embodiment adopts an LED light source emitting device. The light emitted by the light source is converted into a parallel light beam through a collimating lens. The parallel light beam is used to transmit information about the plastic particles to be detected, and this information can be used for further analysis and decision-making.

[0030] In step S12, the cross-sectional mirror reflection image is processed to obtain grayscale information of the reflection image, including: According to the cross-sectional mirror reflection image, color separation is performed to obtain Three color channel information; According to the Three color channel information, calculate the gray value, and obtain the gray information of the reflected image; Wherein, the formula for calculating the gray value is: In the formula, represents the intensity of the red channel, Represent the intensity of the green channel, represents the intensity of the blue channel, Represents the grayscale information of the reflection image.

[0031] It should be noted that when performing color separation on the cross-sectional reflection image, the image is loaded in BGR format by default, and the image needs to be converted to RGB format before the operation; before calculating the gray value, the separated image needs to be converted to RGB format. The brightness and contrast of the three color channel information are adjusted, and then the three color channel information is merged to calculate the grayscale value.

[0032] like Figure 2 As shown, in step S13, the centers of different areas are obtained according to the grayscale information, including: S131, obtaining variable grayscale information according to the change of the grayscale information; S132, obtaining regions with different grayscale values ​​according to the variable grayscale information; S133, obtaining the centers of different areas according to the areas with different grayscale values.

[0033] It should be noted that the grayscale information is represented in numerical form, and the numerical range obtained after normalization is between 0-255.

[0034] In step S131, variable grayscale information is obtained according to the change of the grayscale information.

[0035] It should be noted that after the cross-sectional mirror reflection image is gray-scaled, a series of numerical information is obtained. Each pixel on the image is represented by a numerical value. According to the change of the numerical information, when the jump information of the numerical value is greater than 50, it indicates that the current position has changed significantly, and the current position is marked as variable gray-scale information.

[0036] In step S132, regions with different grayscale values ​​are obtained according to the variable grayscale information.

[0037] It should be noted that the regions with different grayscale values ​​refer to regions with different grayscale values ​​when the difference between the grayscale information of the variables exceeds 100.

[0038] It should be further explained that the regions where the difference between the variable grayscale information of the regions is less than or equal to 100 are divided into the same region.

[0039] In step S133, the centers of different areas are obtained according to the areas with different grayscale values.

[0040] It should be noted that, based on the regions with different grayscale values, the shape information of the regions is obtained; based on the shape information, the circumscribed circle of the shape information is obtained; and based on the circumscribed circle, the centers of different regions are obtained.

[0041] It should be further explained that, in order to obtain the shape information of the region according to the regions with different gray values, it is necessary to first use morphological operations such as dilation and erosion to remove noise, and improve the shape of the region through opening operations (erosion and then dilation) and closing operations (dilation and then erosion). The Canny edge detection algorithm is used on the improved shape information to identify the boundary of the region, wherein the principle of the Canny edge detection algorithm is as follows: The image is subjected to denoising. In the denoising process, some interference points of the grayscale image can be removed, so that the edge detection can be free from the interference of noise points. The general denoising process is determined by the average value around the pixel point. When more accurate denoising is performed, Gaussian blur is required for denoising. Gaussian blur uses the points at different positions in the convolution kernel to perform weight distribution according to Gaussian distribution. The denoising process of the present invention is as follows: In the formula, It means that The grayscale information value after Gaussian noise reduction at the coordinate pixel, It represents the horizontal coordinate in the two-dimensional coordinate system. It represents the vertical coordinate in the two-dimensional coordinate system. It represents the standard deviation of the distribution.

[0042] in, It is set by the user and can be 1.0. It is not explained in detail here. The two-dimensional coordinate system is set with the center of the field of view of the visual sensor as the origin, the right hand side of the observer at the standard observation position as the positive direction of the x-axis, and the top of the observer at the standard observation position as the positive direction of the y-axis.

[0043] It should be further explained that the dilation in morphological operations is achieved by sliding the structure element to each position of the image and extending the boundary pixel values ​​of the target object to the surrounding pixels when the structure element completely covers the target object; erosion reduces the size of the object by reducing the boundary thickness of the object; if all the pixels in the structure element correspond to the target pixels in the image, the center pixel is retained, otherwise the center pixel will be removed; the closing operation helps to fill small holes and gaps while keeping the overall size of the object unchanged, thereby improving the shape information of the image area.

[0044] The grayscale image information after noise reduction is used to determine the edge using the gradient amplitude and gradient direction of the image. The present invention uses the Sobel operator to calculate the gradient amplitude and gradient direction of the image. The steps are as follows: The filter template in the x horizontal direction and the y vertical direction is convolved with the original image. The formula is expressed as: In the formula, is the horizontal transverse gradient amplitude, is the vertical gradient amplitude, Represents the matrix information of the grayscale image after denoising; The image grayscale value is calculated based on the horizontal gradient amplitude and the vertical gradient amplitude, and the formula is: In the formula, Represents the gray value of the image; The gradient direction is calculated based on the horizontal gradient amplitude and the vertical gradient amplitude. It is expressed as: According to the gradient direction, the gray value of the image edge is obtained; The open-loop contour information is obtained according to the image edge grayscale value and the image grayscale value.

[0045] The values ​​of a layer of pixel points around the open-loop contour information are compared, and when the value is greater than a preset pixel value, the pixel point contour is retained, and when the value is less than or equal to the preset pixel value, the pixel point contour is abandoned. The open-loop contour information and the pixel points retained around the open-loop information together form the closed-loop contour information, and the closed-loop contour information is represented as shape information.

[0046] It should be noted that the preset value is preset by the user, and the preset value may be 128, which is not limited in the present invention.

[0047] The points of shape information in the two-dimensional coordinate system are fitted with the general equation of the circumscribed circle using the least squares method. The specific steps are as follows: in, , , , , , is the parameter to be requested, , are the horizontal and vertical coordinate points on the shape information.

[0048] It should be noted that , The value of the gradient The coordinate value when it is 0, when the gradient When the number of coordinates is less than 6, take the gradient Infinitely close to 0 , Coordinate value.

[0049] The resulting general equation for the circumscribed circle can be put into standard form:

[0050] In the formula, , are the horizontal and vertical coordinate points on the shape information, is the horizontal coordinate value of the center of the circumscribed fitting circle, is the ordinate value of the center of the circumscribed fitting circle, is the radius of the circumscribed fitted circle.

[0051] In step S14, the centers of the different areas are connected to obtain a detection area, including: Connect the centers of the circles of the different areas to obtain a straight line equation of the line segment; According to the straight line equation of the line segment, the slope value of the line segment is obtained; According to the slope values ​​of the line segments, a set of slope values ​​having a mean value of 0 is obtained; Dividing the detection area according to the set; Among them, the straight line equation is established in a two-dimensional rectangular coordinate system, wherein the two-dimensional rectangular coordinate system takes the center of the field of view of the visual sensor as the origin, the right hand side of the observer at the standard observation position is the positive direction of the x-axis, and the top of the observer at the standard observation position is the positive direction of the y-axis.

[0052] It should be noted that after obtaining the coordinate point of the center of the circle, the equation of the straight line is obtained by connecting the coordinate points of the two closest center points. The process of solving the equation of the straight line is as follows: In the formula, is the ordinate of the center of the first region, is the ordinate of the center of the second region, is the horizontal coordinate of the center of the first region, is the horizontal coordinate of the center of the second area, is the slope of the equation of the line.

[0053] The equation solved using the horizontal and vertical coordinates of the center of the first region is: In the formula, is the ordinate of the center of the first region, is the horizontal coordinate of the center of the first region, is the slope of the equation of the line, It represents the horizontal coordinate in the two-dimensional coordinate system. It represents the vertical coordinate in the two-dimensional coordinate system.

[0054] In step S15, according to the detection area, the area of ​​the detection area, the distance between the areas and the first angle between the areas are obtained, including: According to the detection area, construct an edge area function; According to the edge area function, the area of ​​the detection area, the distance between areas and the first angle between areas are obtained.

[0055] It should be noted that the region is divided using the straight line equations formed by the coordinates of the center of the circle, and the edge region function is obtained by limiting the range of these straight line equations.

[0056] It should be further explained that the edge area function is integrated to obtain the area of ​​the detection area; the center of the circumscribed circle of the edge area is solved, the distance between the center of the first area and the center of the second area is calculated, the distance between the center of the first area and the center of the second area is expressed as the distance between the areas, and the angle between the straight line equation between the center of the first area and the center of the second area and the x-axis is expressed as the first angle between the areas.

[0057] In step S16, the quality detection is performed according to the area of ​​the detection area, the distance between the areas, and the first angle between the areas to obtain the detection result of the plastic particles, including: Weighting the areas of the detection areas, the distances between the areas, and the first angles between the areas to obtain valued data for the detection areas; A quality inspection score is evaluated based on the assigned data to obtain a quality grade, and the quality grade of the plastic particles is marked to obtain a test result of the plastic particles.

[0058] It should be noted that the steps of assigning weights to the area of ​​the detection area, the distance between the areas, and the first angle between the areas are as follows: in, Indicates the assigned data. Indicates the weight of the detection area. represents the weight of the distance between regions, represents the weight of the first angle between regions, represents the area of ​​the detection area, represents the distance between regions, Indicates the first angle between regions.

[0059] Exemplarily, the weight of the detection area area, the weight of the distance between areas and the weight of the first angle between areas are preset by the user and may be 0.2, 0.5, or 0.3, and are not specifically limited here.

[0060] It should be further explained that, a quality inspection score evaluation is performed based on the assigned data to obtain a quality grade, and the quality grade of the plastic particles is marked to obtain a test result of the plastic particles, including: a quality grade with a quality inspection score greater than a first standard value is marked as excellent, a quality grade with a quality inspection score greater than or equal to a second standard value and less than the first standard value is marked as good, a quality grade with a quality inspection score greater than or equal to a third standard value and less than the second standard value is marked as passing, and a quality grade with a quality inspection score less than the third standard value is marked as failing.

[0061] Exemplarily, the first standard value, the second standard value and the third standard value are preset by the user, and may be 80, 70 and 60, and the present invention does not make any specific limitation to this.

[0062] In order to facilitate the understanding of the present invention, some preferred embodiments of the present invention are further described below.

[0063] In this embodiment, a plastic particle detection system based on machine vision is proposed, and the system consists of the following key parts: light source, imaging device, shooting device, computing device, storage device, and display device. The light source is used for a parallel light emitting device, and the parallel light emitting device is used to illuminate the reflective surface of the plastic particle to be detected to form a parallel light band on the surface of the plastic particle; the imaging device is used to receive and process the reflected parallel light band to obtain the cross-sectional mirror reflection image of the plastic particle to be detected; the computing device processes the obtained cross-sectional mirror reflection image to determine the area where the grayscale value presents different after the cross-sectional mirror reflection; and based on the areas where the grayscale value presents different areas, the center of the circle of the different areas is obtained; and then the detection area is formed based on the connection line of the center of the circle of the different areas obtained; and based on the different detection areas obtained, the area of ​​the detection area, the distance data between the areas, and the first angle data between the areas are obtained; and quality detection is performed based on the area of ​​the detection area, the distance data between the areas, and the first angle data between the areas. The display device is used to display the quality grade. The specific working steps are as follows: Step 1: Use a parallel light emitting device to illuminate the plastic particles to be tested to form parallel light bands, and then receive these light bands to obtain the cross-sectional mirror reflection image of the plastic particles.

[0064] Step 2: Perform color separation on the acquired reflection image, extract the information of the three color channels of red, green and blue, and then calculate the grayscale value to obtain the grayscale information. The grayscale value calculation formula is to add the intensity of the three channels of red, green and blue in a certain proportion.

[0065] Step 3: According to the change of grayscale information, identify the areas with different grayscale values, and then obtain the centers of these areas.

[0066] Step 4: Use the areas with different grayscale values ​​to obtain the shape information of the area, and then calculate the circumscribed circle based on the shape information to obtain the center of the different areas.

[0067] Step 5: Connect the identified circle centers to form a line segment, calculate the slope value through the straight line equation of the line segment, and then divide the detection area according to the slope value.

[0068] Step 6: In the detection area, construct an edge area function, and use this function to measure the area of ​​the detection area, the distance between areas, and the first angle between areas.

[0069] Step 7: Assign weights to the area of ​​the detection area, the distance between areas, and the first angle between areas, and then evaluate the quality detection score based on these assigned data to obtain the quality grade of the plastic particles and mark them.

[0070] Through the above steps and system design, the machine vision-based plastic particle detection system of the present invention can identify the shape information of plastic particles, obtain quality information based on the shape information of plastic particles, and evaluate the quality, thereby improving the detection efficiency and product quality.

[0071] In summary, the present invention provides a method, device and storage medium for detecting plastic particles based on machine vision. The method is executed by a controller, and includes: obtaining a cross-sectional mirror reflection image of a plastic particle to be detected; processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; obtaining the center of different areas according to the grayscale information; connecting the centers of different areas to obtain a detection area; obtaining the area of ​​the detection area, the distance between the areas and the first angle between the areas according to the detection area; performing quality detection according to the area of ​​the detection area, the distance between the areas and the first angle between the areas to obtain a detection result of the plastic particles. When the controller receives the color image obtained after the mirror reflection of the cross-section, the image processing technology is used to determine the different ranges of surface color, and then the color is divided into regions based on different ranges, which improves the efficiency of quality inspection and provides a basis for quality assessment; at the same time, by extracting and analyzing the different regions, the data in the plastic particle quality inspection process is more accurate than traditional technologies, thereby improving the accuracy of plastic particle inspection, and also providing a means for the intelligent implementation of the quality inspection process; in addition, in the process of quality assessment, the quality grade is evaluated by assigning weights to the data. In actual applications, the accuracy of data evaluation in the quality grade inspection process is effectively achieved based on the evaluation results, and the purpose of accurately realizing the quality inspection of plastic particles is achieved.

[0072] Reference Figure 3 The second embodiment of the present invention provides a plastic particle detection device based on machine vision, comprising: A visual capture module, used to obtain a cross-sectional specular reflection image of the plastic particles to be detected; A grayscale processing module, used for processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; A circle center marking module, used to obtain the center of different areas according to the grayscale information; A region division module, used to connect the centers of the different regions to obtain a detection region; A data processing module, used for obtaining the area of ​​the detection area, the distance between the areas and the first angle between the areas according to the detection area; The weight assignment module is used to perform quality detection according to the area of ​​the detection area, the distance between the areas and the first angle between the areas to obtain the detection result of the plastic particles.

[0073] In one embodiment, the visual capture module comprises: A parallel light emitting device is used to illuminate the reflective surface of the plastic particle to be detected, so as to obtain a parallel light band formed on the surface of the plastic particle; the parallel light band is received and processed to obtain a cross-sectional mirror reflection image of the plastic particle to be detected.

[0074] In one implementation, the grayscale processing module includes: According to the cross-sectional mirror reflection image, color separation is performed to obtain Three color channel information; According to the Three color channel information, calculate the gray value, and obtain the gray information of the reflected image; Wherein, the formula for calculating the gray value is: In the formula, represents the intensity of the red channel, Represent the intensity of the green channel, represents the intensity of the blue channel, Represents the grayscale information of the reflection image.

[0075] In one implementation, the circle center marking module includes: According to the change of the grayscale information, variable grayscale information is obtained; according to the variable grayscale information, regions with different grayscale values ​​are obtained; according to the regions with different grayscale values, the centers of different regions are obtained.

[0076] It should be noted that obtaining the centers of different areas according to the areas with different grayscale values ​​includes: obtaining shape information of the areas according to the areas with different grayscale values; obtaining a circumscribed circle of the shape information according to the shape information; and obtaining the centers of different areas according to the circumscribed circle.

[0077] In one implementation, the region division module includes: Connect the centers of the circles of the different areas to obtain a straight line equation of the line segment; obtain the slope value of the line segment based on the straight line equation of the line segment; obtain a set of slope values ​​with a mean value of 0 based on the slope value of the line segment; and divide the detection area based on the set.

[0078] Among them, the straight line equation is established in a two-dimensional rectangular coordinate system, wherein the two-dimensional rectangular coordinate system takes the center of the field of view of the visual sensor as the origin, the right hand side of the observer at the standard observation position is the positive direction of the x-axis, and the top of the observer at the standard observation position is the positive direction of the y-axis.

[0079] In one embodiment, the data processing module includes: An edge region function is constructed according to the detection region; and the area of ​​the detection region, the distance between regions, and the first angle between regions are obtained according to the edge region function.

[0080] In one implementation, the weight assignment module includes: Weights are assigned to the area of ​​the detection area, the distance between the areas, and the first angle between the areas to obtain assigned data for the detection area; quality detection scores are evaluated based on the assigned data to obtain quality grades, and the quality grades of the plastic particles are marked to obtain detection results of the plastic particles.

[0081] It should be noted that the plastic particle detection device based on machine vision provided in an embodiment of the present invention is used to execute all the process steps of the plastic particle detection method based on machine vision in the above embodiment. The working principles and beneficial effects of the two correspond one to one, and thus will not be described in detail.

[0082] In summary, the present invention provides a method, device and storage medium for detecting plastic particles based on machine vision. The method is executed by a controller, and includes: obtaining a cross-sectional mirror reflection image of a plastic particle to be detected; processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; obtaining the center of different areas according to the grayscale information; connecting the centers of different areas to obtain a detection area; obtaining the area of ​​the detection area, the distance between the areas and the first angle between the areas according to the detection area; performing quality detection according to the area of ​​the detection area, the distance between the areas and the first angle between the areas to obtain a detection result of the plastic particles. When the controller receives the color image obtained after the mirror reflection of the cross-section, the image processing technology is used to determine the different ranges of surface color, and then the color is divided into regions based on different ranges, which improves the efficiency of quality inspection and provides a basis for quality assessment; at the same time, by extracting and analyzing the different regions, the data in the plastic particle quality inspection process is more accurate than traditional technologies, thereby improving the accuracy of plastic particle inspection, and also providing a means for the intelligent implementation of the quality inspection process; in addition, in the process of quality assessment, the quality grade is evaluated by assigning weights to the data. In actual applications, the accuracy of data evaluation in the quality grade inspection process is effectively achieved based on the evaluation results, and the purpose of accurately realizing the quality inspection of plastic particles is achieved.

[0083] An embodiment of the present invention further provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as an image grayscale processing program. When the processor executes the computer program, the steps in the above-mentioned embodiments of the method for detecting plastic particles based on machine vision are implemented, such as Figure 1 Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are realized, such as the circle center marking module.

[0084] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the electronic device.

[0085] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than the above components, or may combine certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0086] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.

[0087] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the electronic device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0088] Wherein, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0089] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0090] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting plastic particles based on machine vision, characterized in that: include: Acquire a cross-sectional specular reflection image of the plastic particles to be detected; Processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; According to the grayscale information, obtaining the centers of different areas; Connect the centers of the different areas to obtain a detection area; According to the detection area, obtaining the area of ​​the detection area, the distance between the areas, and the first angle between the areas; Quality detection is performed according to the area of ​​the detection area, the distance between the areas, and the first angle between the areas to obtain the detection result of the plastic particles.

2. The method for detecting plastic particles based on machine vision according to claim 1, characterized in that: The step of obtaining a cross-sectional specular reflection image of the plastic particle to be detected comprises: The reflective surface of the plastic particles to be inspected is illuminated by a parallel light emitting device to obtain a parallel light band formed on the surface of the plastic particles; The parallel light bands are received and processed to obtain a cross-sectional mirror reflection image of the plastic particles to be detected.

3. The method for detecting plastic particles based on machine vision according to claim 1, characterized in that: The step of processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image includes: According to the cross-sectional mirror reflection image, color separation is performed to obtain Three color channel information; According to the Three color channel information, calculate the gray value, and obtain the gray information of the reflected image; Wherein, the formula for calculating the gray value is: In the formula, represents the intensity of the red channel, Represent the intensity of the green channel, represents the intensity of the blue channel, Represents the grayscale information of the reflection image.

4. The method for detecting plastic particles based on machine vision according to claim 1, characterized in that: According to the grayscale information, the centers of different areas are obtained, including: According to the change of the grayscale information, variable grayscale information is obtained; According to the variable grayscale information, regions with different grayscale values ​​are obtained; According to the regions with different grayscale values, the centers of the different regions are obtained.

5. The method for detecting plastic particles based on machine vision according to claim 4, characterized in that: According to the regions with different gray values, the centers of different regions are obtained, including: Obtaining shape information of the regions according to the regions with different grayscale values; According to the shape information, a circumscribed circle of the shape information is obtained; According to the circumscribed circle, the centers of different areas are obtained.

6. The method for detecting plastic particles based on machine vision according to claim 1, characterized in that: Connect the centers of the different areas to obtain the detection area, including: Connect the centers of the circles of the different areas to obtain a straight line equation of the line segment; According to the straight line equation of the line segment, the slope value of the line segment is obtained; According to the slope values ​​of the line segments, a set of slope values ​​having a mean value of 0 is obtained; Dividing the detection area according to the set; Among them, the straight line equation is established in a two-dimensional rectangular coordinate system, wherein the two-dimensional rectangular coordinate system takes the center of the field of view of the visual sensor as the origin, the right hand side of the observer at the standard observation position is the positive direction of the x-axis, and the top of the observer at the standard observation position is the positive direction of the y-axis.

7. The method for detecting plastic particles based on machine vision according to claim 1, characterized in that: According to the detection area, obtaining the area of ​​the detection area, the distance between the areas, and the first angle between the areas includes: According to the detection area, construct an edge area function; According to the edge area function, the area of ​​the detection area, the distance between the areas and the first angle between the areas are obtained; Among them, the edge area function is integrated to obtain the area of ​​the detection area; the center of the circumscribed circle of the edge area is solved, the distance between the center of the first area and the center of the second area is calculated, the distance between the center of the first area and the center of the second area is determined as the distance between the areas, and the angle between the straight line equation between the center of the first area and the center of the second area and the x-axis is determined as the first angle between the areas.

8. The method for detecting plastic particles based on machine vision according to claim 1, characterized in that: The quality detection is performed according to the area of ​​the detection area, the distance between the areas, and the first angle between the areas to obtain the detection result of the plastic particles, including: Weighting the areas of the detection areas, the distances between the areas, and the first angles between the areas to obtain valued data for the detection areas; A quality inspection score is evaluated based on the assigned data to obtain a quality grade, and the quality grade of the plastic particles is marked to obtain a test result of the plastic particles.

9. A plastic particle detection device based on machine vision, characterized in that: include: A visual capture module, used to obtain a cross-sectional specular reflection image of the plastic particles to be detected; A grayscale processing module, used for processing the cross-sectional mirror reflection image to obtain grayscale information of the reflection image; A circle center marking module, used to obtain the center of different areas according to the grayscale information; A region division module, used to connect the centers of the different regions to obtain a detection region; A data processing module, used for obtaining the area of ​​the detection area, the distance between the areas and the first angle between the areas according to the detection area; The weight assignment module is used to perform quality detection according to the area of ​​the detection area, the distance between the areas and the first angle between the areas to obtain the detection result of the plastic particles.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the machine vision-based plastic particle detection method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for detecting and positioning circle center of wafer based on machine vision

    CN116309452A

  • Wafer surface scratch defect detection method, device, medium and system

    CN117350988A

  • Plastic particle online visual detection method and system

    CN117635507A