CN114612441A - Plastic bottle defect detection method and system based on artificial intelligence and image processing - Google Patents

Plastic bottle defect detection method and system based on artificial intelligence and image processing Download PDF

Info

Publication number
CN114612441A
CN114612441A CN202210255430.2A CN202210255430A CN114612441A CN 114612441 A CN114612441 A CN 114612441A CN 202210255430 A CN202210255430 A CN 202210255430A CN 114612441 A CN114612441 A CN 114612441A
Authority
CN
China
Prior art keywords
gray level
layers
image
area
gray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202210255430.2A
Other languages
Chinese (zh)
Inventor
岳文辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xuzhou Jiushan Plastics Co ltd
Original Assignee
Xuzhou Jiushan Plastics Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xuzhou Jiushan Plastics Co ltd filed Critical Xuzhou Jiushan Plastics Co ltd
Priority to CN202210255430.2A priority Critical patent/CN114612441A/en
Publication of CN114612441A publication Critical patent/CN114612441A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Probability & Statistics with Applications (AREA)
  • Geometry (AREA)
  • Quality & Reliability (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention relates to a plastic bottle defect detection method and a system based on artificial intelligence and image processing, wherein the method comprises the steps of obtaining an image of a product to be detected; processing the acquired image of the product to be detected into a gray image; obtaining the area ratio of the gray area: carrying out gray level layering on the gray level image to obtain a plurality of layers of gray level layers, carrying out gray level region division by using the plurality of layers of gray level layers, and calculating to obtain the area ratio of the gray level regions corresponding to each two layers by using the areas of different gray level regions; comparing the area ratio of the gray level regions corresponding to each two layers with the area ratio of the corresponding gray level regions in the set gray level incidence matrix, and judging whether the plastic bottle has defects or not and which gray level region the defects belong to by using the comparison result; the method can detect the defects quickly and accurately and can also detect the defect types.

Description

Plastic bottle defect detection method and system based on artificial intelligence and image processing
Technical Field
The invention relates to the technical field of image processing defect detection, in particular to a plastic bottle defect detection method and system based on artificial intelligence and image processing.
Background
At present, the safety problems of food and medicine are receiving more and more attention from government and national people. The prior containers for filling beverages and medicines are plastic bottles, and in the production process of the beverages and medicines, the plastic bottles are required to meet corresponding quality standards, and strict detection is required in each production link. Once unqualified plastic bottles appear, the reputation of manufacturers is influenced, and users are easily injured or the personal interests of consumers are lost due to the defects of the plastic bottles. The plastic bottle is basically a cylinder, when a blowing needle waterway of the bottle blowing machine is blocked in the production process, the temperature of the blowing needle is easy to be higher, so that the plastic at the bottle mouth is not completely cooled and shaped, and the phenomenon of material blockage or round hole out-of-round is caused by easy pull of the bottle mouth when the blowing needle is reset; and because the vibrations of board, the leftover bits that remain on the board are easily shaken the throat and are formed the putty. The bottle mouth is broken and the throat is blocked, so that the plastic bottle cannot be used, and the plastic bottle with the type of defects needs to be removed from a production line.
The existing plastic bottle defect detection method is mainly divided into three types: an artificial detection method, a sensor detection method and a machine vision detection method. The manual detection method is a traditional industrial detection method, and mainly comprises the steps that an inspector observes a plastic bottle through naked eyes to judge whether the plastic bottle has defects or not. The sensor detection method uses various sensors to perform detection, for example, X-ray imaging to perform determination, and has problems that the sensor detection method is easily interfered by external environment and the detection system has poor versatility. The current mainstream detection method utilizes machine vision to replace human eyes, namely utilizes computer vision to complete the detection of the plastic bottle, and has the advantages of high detection speed and strong statistical summary capability of detection data.
However, the method for detecting plastic bottles by computer vision usually obtains a binary image of a bottle to be detected by performing threshold segmentation on the image, extracts target edge information by edge detection, and then detects a product by measuring a caliber as a judgment basis. The method has complex detection process, cannot meet the requirement of high-speed detection on a high-speed production line, has overhigh requirement on the precision of image detection, and cannot complete corresponding detection tasks if the segmentation effect and the edge detection effect are not ideal.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide a plastic bottle defect detection method and system based on artificial intelligence and image processing, which has high efficiency and high accuracy.
In order to achieve the purpose, the invention adopts the following technical scheme that the plastic bottle defect detection method based on artificial intelligence and image processing specifically comprises the following steps:
image acquisition: acquiring an image of a product to be detected;
image processing: processing the acquired image of the product to be detected into a gray image;
obtaining the area ratio of the gray area: carrying out gray level layering on the gray level image to obtain a plurality of layers of gray level layers, carrying out gray level region division by using the plurality of layers of gray level layers, and calculating to obtain the area ratio of the gray level regions corresponding to each two layers by using the areas of different gray level regions;
detecting product defects: and comparing the area ratio of the gray scale regions corresponding to each two layers with the area ratio of the gray scale regions corresponding to the set gray scale incidence matrix, and judging whether the plastic bottle has defects or not and which gray scale region the defects belong to by using the comparison result.
Further, the obtained gray level layers are at least three layers.
Further, the method for obtaining the gray-scale incidence matrix comprises the following steps:
acquiring an image of a qualified product, processing the acquired image of the qualified product into a gray level image, carrying out gray level layering on the gray level image of the qualified product, acquiring a plurality of gray level layers consistent with a product to be detected, carrying out gray level region division by utilizing the plurality of gray level layers consistent with the product to be detected, and calculating and acquiring a gray level region area ratio corresponding to each two layers consistent with the product to be detected by utilizing different gray level region areas;
and constructing a gray level incidence matrix according to the area ratio of the gray level regions corresponding to each two layers consistent with the product to be detected.
Further, the image of the product to be detected is an overlook image of the upper half of the bottle;
carrying out gray level layering on the overlooking image of the upper half body of the bottle to obtain four gray level layers of a background, the bottle body, a bottle opening and a throat;
carrying out gray level region division by utilizing four gray level layers of a background, a bottle body, a bottle mouth and a throat, and calculating to obtain the area of a background region, the area of a bottle body region, the area of a bottle mouth region and the area of a throat region;
and comparing the area ratio of the gray scale regions corresponding to each two layers with the area ratio of the gray scale regions corresponding to the set gray scale incidence matrix, and judging whether the bottle mouth/throat mouth is defective or not and the defect type by using the comparison result.
Further, the method for detecting the defect type of the bottle mouth/throat mouth comprises the following steps:
if the area of the gray scale area corresponding to the bottle opening is reduced and the area of the gray scale area corresponding to the bottle body is increased, judging that the bottle opening has a broken defect or a shriveled defect;
if the area of the gray scale region corresponding to the bottle mouth is increased and the area of the gray scale region corresponding to the bottle body is reduced, judging that the bottle mouth has a burr defect;
and if the area of the gray scale region corresponding to the throat is reduced and the area of the gray scale region corresponding to the bottle body is increased, judging that the throat has the defect of material blockage.
Further, the method for acquiring the area of the gray scale region corresponding to each layer is as follows:
and calculating to obtain the area of the corresponding gray level of each layer by using the number of the pixels in the corresponding gray level area of each layer.
Further, the method also comprises the optimization of a product defect judgment method; the method specifically comprises the following steps:
performing sliding window on the area ratio incidence matrix of every two layers of gray scale areas of the qualified product by setting a noise fluctuation value to obtain an area ratio interval incidence matrix of every two layers of gray scale areas of the qualified product, and taking the area ratio interval incidence matrix of every two layers of gray scale areas of the qualified product as an optimized template;
and if the area ratio of the gray level regions corresponding to each two layers changes and the changes are in the range of the template, judging that the product is a qualified product.
A plastic bottle defect detection system based on artificial intelligence and image processing comprises an image acquisition module, an image processing module, a gray level area ratio acquisition module and a product defect detection module;
the image acquisition module is used for acquiring an image of a product to be detected;
the image processing module is used for processing the acquired image of the product to be detected into a gray image;
the gray scale region area ratio acquisition module is used for carrying out gray scale layering on a gray scale image to acquire a plurality of layers of gray scale layers, carrying out gray scale region division by using the plurality of layers of gray scale layers, and calculating to acquire the gray scale region area ratio corresponding to each two layers by using the areas of different gray scale regions;
the product defect detection module is used for comparing the area ratio of the gray scale regions corresponding to each two layers with the area ratio of the gray scale regions corresponding to the set gray scale incidence matrix, and judging whether the plastic bottle has defects or not and which gray scale region the defects belong to by using the comparison result.
The invention has the beneficial effects that:
1. the method has the advantages of few operation steps, high detection efficiency, high accuracy, and capability of determining the defect of the plastic bottle by carrying out gray level layering on the gray level images and utilizing the change of the area ratio of the gray level areas corresponding to each two layers, thereby having the advantages of detecting the defect of the plastic bottle and determining the defect type;
2. the optimization of the product defect judgment method is added in the method, so that the detection result error is smaller and the accuracy is higher.
Drawings
FIG. 1 is a block flow diagram of the method of the present invention;
FIG. 2 is a schematic view of a product line of the present invention;
FIG. 3 is an original image of the gray scale of the product in the method of the present invention;
FIG. 4 is a gray scale layer diagram of a product in the method of the present invention;
FIG. 5 is a gray level histogram of a product in the method of the present invention;
FIG. 6 is a gray scale layered schematic diagram of four gray levels of product background, body, mouth and throat in the method of the present invention;
fig. 7 is a schematic diagram of the system of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and examples.
In the description of the present invention, it is to be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention.
The terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature; in the description of the present invention, "a plurality" means two or more unless otherwise specified.
The application environment of the invention is as follows: the throat defect of the plastic medicine bottle is the most fatal one. When a blowing needle waterway of the bottle blowing machine is blocked in the production process, the temperature of the blowing needle is easy to be higher, so that the plastic at the bottle opening is incompletely cooled and shaped, and the phenomenon of material blockage or non-circular round hole is caused by easily pulling the bottle opening when the blowing needle is reset; and because the vibrations of board, the leftover bits that remain on the board are easily shaken the throat and are formed the putty. Therefore, the bottle mouth/throat defect of the plastic medicine bottle needs to be detected.
Examples
As shown in fig. 1, the present embodiment provides a method for detecting defects of a mouth/throat of a plastic medicine bottle based on image processing, which specifically includes the following steps:
the method comprises the following steps: and acquiring an image of the product to be detected.
Since the detection is to detect the bottleneck/throat defect of the plastic medicine bottle, the image of the product to be detected obtained in the embodiment is an overlook image of the upper half of the plastic medicine bottle. The specific acquisition steps are as follows:
the prior knowledge selects an annular LED lamp as a light source, a CCD camera is selected as the camera, and a laser sensor is selected as the sensor.
Referring to fig. 2, a camera, an aperture and a laser sensor are arranged on the production line, the camera is located right above the product, the sensor is located right below the camera, and the purpose of the step is to acquire an image of the bottle mouth/throat of the medicine bottle, so that all the camera aperture sensors are located on a straight line, the bottle mouth/throat in the acquired image is guaranteed to be located in the center of the image, and image acquisition is performed on each medicine bottle on the production line, and the acquisition direction is right opposite to the bottle mouth.
The medicine bottle is basically a cylinder body by priori knowledge, when the distance between the medicine bottle and the sensor is minimum, the camera is controlled to shoot, and the bottle opening in the obtained image is just positioned in the center of the picture. Thereby acquiring an overhead image of the upper body of each plastic medicine bottle.
The beneficial effect of this step is that select reasonable light source and the position of rationally arranging components and parts, reducible operational environment, ambient light and the influence of testee self attribute and the influence of external factor make the plastics medicine bottle image quality who obtains higher, make the accuracy of system higher simultaneously.
Referring to fig. 3, step two: and converting the obtained overlook image of the upper half of the medicine bottle to be measured into a gray image by adopting an averaging method.
The specific method comprises the following steps: the values of 3 channels at the same pixel position are averaged, i.e.:
Figure BDA0003547776350000051
and (4) operating all the pixel points by adopting an averaging method, and converting the color image into a gray image.
Because the distance between the bottle body, the bottle opening and the throat is different from the camera and the bottle body is made of polyethylene, the gray level image of the bottle body is divided into three gray level layers of the bottle body, the bottle opening and the throat by adopting a clustering algorithm, and gray level area division is carried out by utilizing the three gray level layers of the bottle body, the bottle opening and the throat to obtain a background area, a bottle body area, a bottle opening area and a throat area.
The specific acquisition steps are as follows:
1. carrying out self-adaptive gray level layering on the gray level image:
referring to fig. 4, a K-means clustering algorithm is used to perform gray level layering on the gray level image, and the number K of the clustered categories needs to be determined first. The image can be divided into four gray scale areas of a background, a bottle body, a bottle mouth and a throat according to a K value determined by the number of wave crests of the gray scale histogram.
The K value self-adaptive method comprises the following steps: and constructing a gray histogram of all pixels in the digital image according to the size of the gray value and the number of the pixels, and counting the occurrence frequency of the pixels corresponding to each layer of gray level in the gray histogram. The gray histogram is a function of gray level distribution, and is a statistic of gray level distribution in an image. The gray level histogram is constructed by taking the gray level value as the abscissa of the gray level histogram and the number of pixels as the ordinate of the gray level histogram, and the K value is determined by the number of wave crests in the gray level histogram.
The K-means algorithm is as follows:
initially, K points are randomly selected from the sample set D ═ (x1, x2, … xm) as initial cluster centers for K classes.
In the ith iteration, the distance from any sample point to k clustering centers is calculated, and the sample point is classified into the class where the clustering center with the shortest distance is located.
And updating the clustering center of the class by using methods such as mean value and the like.
For all k clustering centers, if the values are kept unchanged or the difference is small after updating by using the iteration method of 2 and 3, the iteration is ended, otherwise, the iteration is continued.
2. Marking the gray level layering:
referring to fig. 5 and 6, after the images are layered by a K-means clustering algorithm, labels 1, 2, 3, and 4 are carried out on different gray levels, wherein 1 is a background, 2 is a bottle body, 3 is a bottle mouth, and 4 is a throat mouth. The gray scale of the inner diameter area between the bottle mouth and the throat is basically the same as that of the bottle body, so the bottle is classified as one.
The purpose of this step is that the number of gray levels can reflect the change of the object in three-dimensional space, and the closer the object is to the camera, the larger the gray level value is, so that the image can be gray-layered according to the gray level change. The grey self-adaption degree layering is carried out by adopting a clustering method, and the K value is a self-adaption value, so that when the system processes different medicine bottles, the corresponding K can be automatically obtained, and the generalization capability of the system is increased while the automation is realized.
Step three: and acquiring the area of the bottle body region, the area of the bottle mouth region and the area of the throat region.
Traversing the image, counting the number of pixel points in each layer of corresponding gray level region to obtain the area of each layer of corresponding gray level region, recording the area of the background region as A, the area of the bottle body region as B, the area of the bottle mouth region as C and the area of the throat region as D.
Step four: and obtaining the area ratio of the gray area.
As shown in table 1, the area ratio of the gray scale corresponding to each two layers is obtained by comparing the areas of the gray scale regions corresponding to the inner layer and the outer layer.
TABLE 1 regional area ratio of gray levels for each two layers
Figure BDA0003547776350000061
Step five: detection of product defects and defect types.
Since the defect of the product to be tested needs to be compared with the qualified product to determine whether the defect exists, the gray level correlation matrix constructed by the area ratio of the gray level regions corresponding to each two layers of the qualified product and the product to be tested needs to be obtained in this embodiment. The specific acquisition process is as follows:
the ratio incidence matrix of the areas of the corresponding gray level regions of every two layers of the qualified product is set as a threshold value, the ratio of the area of the inner-layer gray level region to the area of the outer-layer gray level region is used as a judgment basis in the embodiment, and an implementer can adjust the ratio relation according to actual conditions to obtain a new gray level change matrix.
As shown in table 2, according to the first step, an overlook image of the upper half of the qualified product is obtained, the obtained overlook image of the upper half of the qualified product is processed into a gray image, gray layering is performed on the gray image of the qualified product, a bottle body, a bottle mouth and a throat gray layer which are consistent with the product to be measured are obtained, gray area division is performed by using the bottle body, the bottle mouth and the throat gray layer, and the area ratio of gray area corresponding to each two layers consistent with the product to be measured is calculated and obtained by using the areas of different gray areas; and constructing a gray level incidence matrix according to the area ratio of the gray level regions corresponding to each two layers consistent with the product to be detected.
TABLE 2 threshold Gray level Association matrix
Figure BDA0003547776350000071
As shown in table 3, the threshold gray level correlation matrix is subjected to sliding window with a set fluctuation value to obtain a threshold interval correlation matrix, and the threshold interval correlation matrix is used as a template for determining optimization; the detection result has smaller error and higher accuracy.
TABLE 3 threshold Interval Association matrix
Figure BDA0003547776350000072
Step four: and comparing the area ratio of the gray level area corresponding to each two layers with the area ratio of the gray level area corresponding to each two layers of the qualified product in the incidence matrix to judge whether the product has defects.
And if the area ratio of the corresponding gray level areas of each two layers changes and the changes are all in the range of the template, judging the product to be qualified.
If the area ratio of the corresponding gray scale area of each two layers changes and the change exceeds the range of the template, the product is judged to be a defective product,
if it is
Figure BDA0003547776350000081
If the ratio of the bottle mouth to the bottle body is not changed, the ratios of other areas are changed, the background area and the throat area are free from defects, one gray area of the bottle mouth and the bottle body is preliminarily judged to have defects, and the bottle mouth or the throat defect and the defect type are judged according to the area change degree of the bottle mouth and the bottle body.
As shown in table 4, if the value corresponding to the area of the body region increases and the value corresponding to the area of the mouth region decreases, it is determined that the mouth has a crack or collapse defect.
TABLE 4 ratio change corresponding to a bottle mouth having a breach or collapse defect
Figure BDA0003547776350000082
As shown in table 5, if the area of the bottle body region decreases and the area of the bottle mouth region increases, it is determined that the bottle mouth has a burr defect.
TABLE 5 ratio change corresponding to burr defect at the bottle mouth
Figure BDA0003547776350000083
If it is
Figure BDA0003547776350000084
The ratio of the throat area to the bottle body is not changed, the ratios of other areas are changed, the background area and the bottle mouth area have no defects, one gray area of the throat opening and the bottle body is preliminarily judged to have defects, and the specific defects of the throat opening or the bottle body and the defect types are judged according to the area change degree of the throat opening and the bottle body.
As shown in table 6, if the area of the throat region decreases with an increase in the area of the body region, it is determined that burr defects occur in the throat.
TABLE 6 ratio change corresponding to burr defect at throat
Figure BDA0003547776350000091
As shown in table 7, when the value corresponding to the area of the body region was decreased and the value corresponding to the area of the throat region was increased, it was determined that the body had a hole defect.
TABLE 7 ratio variation corresponding to occurrence of hole-breaking defect in bottle body
Figure BDA0003547776350000092
If it is
Figure BDA0003547776350000093
The ratio of the bottle neck area to the bottle neck area is not changed, the ratios of other areas are changed, the throat area and the bottle neck area are not defective, one gray level area of the background and the bottle body is preliminarily judged to be defective, and the specific defect of the background or the bottle body and the defect type are judged according to the area change degree of the background and the bottle body
As shown in table 8, if the area of the corresponding body region increases and the area of the background region decreases, it is determined that the body has a burr defect.
TABLE 8 ratio change corresponding to rough selvedge defect of bottle body
Figure BDA0003547776350000094
Among them, those in tables 2 to 8
Figure BDA0003547776350000095
Indicating that the value in the corresponding table becomes large, → indicating that the value in the corresponding table does not change,
Figure BDA0003547776350000096
indicating that the values in the corresponding table become smaller.
Step five: and recording the defect types of the products, and sorting and removing the products according to the defect types.
The specific process is as follows:
if the defect is a burr defect, sorting to a defective product, and removing burrs through subsequent treatment for continuous use.
If the defect is a broken hole or a flat mouth defect, the product is sorted to defective products, and the product cannot be used and needs to be recycled and remolded.
The method has the advantages of few operation steps, high detection efficiency, high accuracy and capability of determining the defect of the plastic bottle by carrying out gray level layering on the gray level image and utilizing the change of the area ratio of the gray level areas corresponding to each two layers, and not only has the advantage of detecting the defect of the plastic bottle, but also has the advantage of determining the type of the defect.
Example 2
As shown in fig. 7, the present embodiment provides an artificial intelligence and image processing plastic bottle defect detecting system, which includes an image acquisition module, an image processing module, a gray scale area ratio obtaining module, and a product defect detecting module.
The image acquisition module is used for acquiring an image of a product to be detected.
The image processing module is used for processing the acquired image of the product to be detected into a gray image.
The gray scale region area ratio acquisition module is used for carrying out gray scale layering on the gray scale image to acquire a plurality of layers of gray scale layers, carrying out gray scale region division by using the plurality of layers of gray scale layers, and calculating to acquire the gray scale region area ratio corresponding to each two layers by using the areas of different gray scale regions.
The product defect detection module is used for comparing the area ratio of the corresponding gray scale regions of each two layers with the area ratio of the corresponding gray scale regions in the set gray scale incidence matrix, and judging whether the plastic bottle has defects or not and which gray scale region the defects belong to by using the comparison result.
The above embodiments are merely illustrative of the present invention, and should not be construed as limiting the scope of the present invention, and all designs identical or similar to the present invention are within the scope of the present invention.

Claims (8)

1. A plastic bottle defect detection method based on artificial intelligence and image processing is characterized by specifically comprising the following steps:
image acquisition: acquiring an image of a product to be detected;
image processing: processing the acquired image of the product to be detected into a gray image;
obtaining the area ratio of the gray area: carrying out gray level layering on the gray level image to obtain a plurality of layers of gray level layers, carrying out gray level region division by using the plurality of layers of gray level layers, and calculating to obtain the area ratio of the gray level regions corresponding to each two layers by using the areas of different gray level regions;
detecting product defects: and comparing the area ratio of the gray level regions corresponding to each two layers with the area ratio of the gray level regions corresponding to the set gray level incidence matrix, and judging whether the plastic bottle has defects or not and which gray level region the defects belong to by using the comparison result.
2. The method for plastic bottle defect detection based on artificial intelligence and image processing as claimed in claim 1, wherein said obtained gray scale layers are at least three layers.
3. The plastic bottle defect detection method based on artificial intelligence and image processing as claimed in claim 1, wherein said gray-level correlation matrix is obtained by:
acquiring an image of a qualified product, processing the acquired image of the qualified product into a gray level image, carrying out gray level layering on the gray level image of the qualified product, acquiring a plurality of gray level layers consistent with a product to be detected, carrying out gray level region division by utilizing the plurality of gray level layers consistent with the product to be detected, and calculating and acquiring a gray level region area ratio corresponding to each two layers consistent with the product to be detected by utilizing different gray level region areas;
and constructing a gray level incidence matrix according to the area ratio of the gray level regions corresponding to each two layers consistent with the product to be detected.
4. The method for detecting the defects of the plastic bottle based on the artificial intelligence and the image processing as claimed in claim 1, wherein the image of the product to be detected is an overhead image of the upper body of the bottle;
carrying out gray level layering on the overlooking image of the upper half body of the bottle to obtain four gray level layers of a background, the bottle body, a bottle opening and a throat;
carrying out gray level region division by utilizing four gray level layers of a background, a bottle body, a bottle mouth and a throat, and calculating to obtain the area of a background region, the area of a bottle body region, the area of a bottle mouth region and the area of a throat region;
and comparing the area ratio of the gray scale regions corresponding to each two layers with the area ratio of the gray scale regions corresponding to the set gray scale incidence matrix, and judging whether the bottle mouth/throat mouth is defective or not and the defect type by using the comparison result.
5. The artificial intelligence and image processing based plastic bottle defect detection method according to claim 4, wherein the bottle mouth/throat defect type detection method is as follows:
if the area of the gray scale area corresponding to the bottle opening is reduced and the area of the gray scale area corresponding to the bottle body is increased, judging that the bottle opening has a broken defect or a shriveled defect;
if the area of the gray scale region corresponding to the bottle mouth is increased and the area of the gray scale region corresponding to the bottle body is reduced, judging that the bottle mouth has a burr defect;
and if the area of the gray scale region corresponding to the throat is reduced and the area of the gray scale region corresponding to the bottle body is increased, judging that the throat has the defect of material blockage.
6. The plastic bottle defect detection method based on artificial intelligence and image processing as claimed in claim 1, wherein said gray scale region area acquisition method corresponding to each layer is:
and calculating to obtain the area of the corresponding gray level of each layer by using the number of the pixels in the corresponding gray level area of each layer.
7. The plastic bottle defect detection method based on artificial intelligence and image processing as claimed in claim 1, wherein the method further comprises optimizing a product defect judgment method; the method specifically comprises the following steps:
performing sliding window on the area ratio incidence matrix of every two layers of gray scale areas of the qualified product by setting a noise fluctuation value to obtain an area ratio interval incidence matrix of every two layers of gray scale areas of the qualified product, and taking the area ratio interval incidence matrix of every two layers of gray scale areas of the qualified product as an optimized template;
and if the area ratio of the gray scale regions corresponding to each two layers changes and the changes are all in the range of the template, judging the product to be qualified.
8. A plastic bottle defect detection system based on artificial intelligence and image processing is characterized by comprising an image acquisition module, an image processing module, a gray level area ratio acquisition module and a product defect detection module;
the image acquisition module is used for acquiring an image of a product to be detected;
the image processing module is used for processing the acquired image of the product to be detected into a gray image;
the gray scale region area ratio acquisition module is used for carrying out gray scale layering on a gray scale image to acquire a plurality of layers of gray scale layers, carrying out gray scale region division by using the plurality of layers of gray scale layers, and calculating to acquire the gray scale region area ratio corresponding to each two layers by using the areas of different gray scale regions;
the product defect detection module is used for comparing the area ratio of the gray scale regions corresponding to each two layers with the area ratio of the gray scale regions corresponding to the set gray scale incidence matrix, and judging whether the plastic bottle has defects or not and which gray scale region the defects belong to by using the comparison result.
CN202210255430.2A 2022-03-15 2022-03-15 Plastic bottle defect detection method and system based on artificial intelligence and image processing Withdrawn CN114612441A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210255430.2A CN114612441A (en) 2022-03-15 2022-03-15 Plastic bottle defect detection method and system based on artificial intelligence and image processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210255430.2A CN114612441A (en) 2022-03-15 2022-03-15 Plastic bottle defect detection method and system based on artificial intelligence and image processing

Publications (1)

Publication Number Publication Date
CN114612441A true CN114612441A (en) 2022-06-10

Family

ID=81862828

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210255430.2A Withdrawn CN114612441A (en) 2022-03-15 2022-03-15 Plastic bottle defect detection method and system based on artificial intelligence and image processing

Country Status (1)

Country Link
CN (1) CN114612441A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115091726A (en) * 2022-08-24 2022-09-23 南通广信塑料机械有限公司 Parameter control method and system of bottle blowing machine
CN115631198A (en) * 2022-12-21 2023-01-20 深圳新视智科技术有限公司 Crack detection method and device for glass display screen and computer equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115091726A (en) * 2022-08-24 2022-09-23 南通广信塑料机械有限公司 Parameter control method and system of bottle blowing machine
CN115631198A (en) * 2022-12-21 2023-01-20 深圳新视智科技术有限公司 Crack detection method and device for glass display screen and computer equipment
CN115631198B (en) * 2022-12-21 2023-08-08 深圳新视智科技术有限公司 Crack detection method and device for glass display screen and computer equipment

Similar Documents

Publication Publication Date Title
CN114612441A (en) Plastic bottle defect detection method and system based on artificial intelligence and image processing
TWI603074B (en) Optical film defect detection method and system thereof
CN115082683A (en) Injection molding defect detection method based on image processing
US5926556A (en) Systems and methods for identifying a molded container
CN103072718B (en) Machine vision detection system and method for food packaging production line
CN108896574B (en) Bottled liquor impurity detection method and system based on machine vision
CN113724231B (en) Industrial defect detection method based on semantic segmentation and target detection fusion model
US20060045324A1 (en) Method and device for preparing reference image in glass bottle inspection device
CN111815564B (en) Method and device for detecting silk ingots and silk ingot sorting system
CN116559183B (en) Method and system for improving defect judging efficiency
EP3745298B1 (en) Classification method and system for high-throughput transparent articles
CN114187289B (en) Plastic product shrinkage pit detection method and system based on computer vision
Kuo et al. Automated defect inspection system for CMOS image sensor with micro multi-layer non-spherical lens module
CN114742788A (en) Copper bar defect detection method and system based on machine vision
Akundi et al. A machine vision based automated quality control system for product dimensional analysis
CN114119591A (en) Display screen picture quality detection method
CN111487192A (en) Machine vision surface defect detection device and method based on artificial intelligence
CN114359190A (en) Plastic product molding control method based on image processing
CN116152242B (en) Visual detection system of natural leather defect for basketball
CN111426693A (en) Quality defect detection system and detection method thereof
CN105631481B (en) Iron based on genetic programming composes abrasive grain compound characteristics building method
CN114387269B (en) Fiber yarn defect detection method based on laser
US10147176B1 (en) Automated container inspection system
CN114266743A (en) FPC defect detection method, system and storage medium based on HSV and CNN
CN117237747B (en) Hardware defect classification and identification method based on artificial intelligence

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20220610

WW01 Invention patent application withdrawn after publication