CN115435684A - Size defect detection method, device, equipment and storage medium - Google Patents

Size defect detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN115435684A
CN115435684A CN202211218094.0A CN202211218094A CN115435684A CN 115435684 A CN115435684 A CN 115435684A CN 202211218094 A CN202211218094 A CN 202211218094A CN 115435684 A CN115435684 A CN 115435684A
Authority
CN
China
Prior art keywords
image
detection
size
defect
camera
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.)
Pending
Application number
CN202211218094.0A
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.)
China South Industries Group Automation Research Institute
Original Assignee
China South Industries Group Automation Research Institute
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 China South Industries Group Automation Research Institute filed Critical China South Industries Group Automation Research Institute
Priority to CN202211218094.0A priority Critical patent/CN115435684A/en
Publication of CN115435684A publication Critical patent/CN115435684A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation
    • G01N2021/0106General arrangement of respective parts
    • G01N2021/0112Apparatus in one mechanical, optical or electronic block
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Abstract

The invention discloses a size defect detection method, a device, equipment and a storage medium, wherein the method can couple size detection to a defect detection process, utilize a high-contrast image shot in the size detection process to quickly separate a foreground and a background by using a traditional algorithm, extract a region image of a drug strip, and use the region image as an input image of the defect detection after the region image is differentiated from a shot image of the defect detection to construct a data set and train a deep learning model, so that the method which greatly reduces false detection rate and missing detection rate and gives consideration to detection speed is obtained. The coupling method of size detection and defect detection optimizes parameters and hyper-parameters, and greatly improves the detection quality. The problems of large product quality fluctuation, high labor intensity, high false detection and error detection rate, low capacity, poor real-time performance, certain potential safety hazard and the like caused by manual identification in the traditional propellant powder production process are solved.

Description

Size defect detection method, device, equipment and storage medium
Technical Field
The invention relates to the technical field, in particular to a size defect detection method, a device, equipment and a storage medium, which can realize the online detection of the formation of a propellant charge strip and have high detection accuracy.
Background
The production process of the propellant in China always adopts process technology and equipment in the factory building period, comprehensive technical improvement and scientific research are carried out in the explosive and powder preparation industry in recent years, but the original production mode is not changed, the online detection of the product quality needs manual work, the formed propellant powder is transmitted on a belt line, workers carry out repeated detection by naked eyes from the side, the labor intensity of human eyes is high, the workers do not have a rest for a long time, the workers are extremely easy to be fatigued, wrong detection and missing detection easily occur, even fatal defects can be missed, the great quality safety hidden danger is caused, and meanwhile, toxic gas and harmful gas volatilized by explosive strips seriously threaten the health of the workers.
At present, the production lines of most of the production factories for producing the propellant powder and the explosive in China adopt a single-screw 4-group propellant powder and explosive strip simultaneous forming process, and with the development of science and technology, the visual detection instead of manual detection is widely adopted in a quality detection mode. However, in the prior art, visual detection has the defects that the background of the medicine strip shooting is difficult to separate and interference is easy to occur. In terms of software algorithm, the existing visual detection technology has the following defects that most defects such as scratches, burrs and the like cannot be identified by the traditional algorithm, and due to different image foreground illumination conditions and different background pictures, a medicine strip body is difficult to accurately separate out in the algorithm based on deep learning, so that the defect detection error detection rate and the omission rate are high, and the detection speed is low.
Therefore, how to provide a method for detecting a size defect with low false detection rate, high productivity and good real-time performance is a technical problem that needs to be solved by the technical personnel in the field.
Disclosure of Invention
In view of the above problems, the present invention provides a method, an apparatus, a device and a storage medium for detecting a size defect, which overcome or at least partially solve the above problems, and solves the problems of poor consistency of the forming quality, high false detection rate, low productivity, poor real-time performance, insufficient production safety and the like of the traditional method for forming a propellant stick by means of manual experience in an online detection process.
The invention provides the following scheme:
a dimensional defect detection method, comprising:
receiving a size detection image of the medicine strip sent by an image acquisition component, wherein the image acquisition component comprises a camera and a light source, the camera and the light source are respectively positioned at two sides of the medicine strip, the camera and the light source are oppositely arranged, and the light source is used for providing background light for the medicine strip when the camera acquires the size detection image;
judging whether the medicine strips are unqualified in size or not according to the medicine strip area image;
if so, determining that the medicine strip is unqualified;
if not, receiving a defect detection image of the medicine strip sent by an image acquisition assembly, and providing foreground light for the medicine strip when the camera acquires the defect detection image;
acquiring a medicine strip area image through the size detection image;
carrying out differential processing on the medicine strip area image and the defect detection image to obtain a separation image of the medicine strip;
and determining whether the quality defect exists by adopting an image classification neural network model and the separation image.
Preferably: judging whether the medicine strip has unqualified size through the medicine strip region image comprises the following steps:
carrying out Threshold segmentation on the size detection image by using a Threshold algorithm to obtain a size binary image only with black and white two colors;
performing edge extraction on the size binary image to obtain two edge curves of the medicine strip, and calculating the maximum and minimum distances of the two edge curves to obtain a size detection result;
and judging whether the medicine strip has unqualified size according to the size detection result.
Preferably: the obtaining of the medicine strip area image through the size detection image includes:
and performing opening operation and closing operation on the size binary image to obtain a smooth region segmentation range, and screening out the region of the drug strip through the position and the area to obtain the drug strip region image.
Preferably: the step of determining whether the quality defect except the unqualified size exists by adopting the image classification neural network model and the separation image comprises the following steps:
and carrying out deep learning operation by adopting the image classification neural network model constructed based on the MobileNet V2 skeleton network and the separated image to determine whether quality defects exist.
A dimensional defect inspection apparatus, comprising:
an image acquisition component group, wherein the image acquisition component group comprises a plurality of image acquisition components; the image acquisition assemblies are uniformly distributed along the circumferential direction of the medicine strip;
a vision computer communicably coupled to the image acquisition component;
the PLC control system is in communication connection with the vision computer and the image acquisition assembly and is used for sending detection instructions to the vision computer and receiving size detection and defect detection results returned by the vision computer.
Preferably: the detection instruction comprises a system instruction protocol packet, wherein the system instruction protocol packet comprises a camera number plus letter protocol packet for size detection and a camera number reinforced digital plus letter protocol packet for defect detection; and calling a single photographing public program package by the vision computer according to the camera number contained in the system instruction protocol package so as to carry out corresponding size detection and defect detection through the camera corresponding to the camera number.
Preferably: the image acquisition component group comprises three cameras and three light sources, the three cameras form an included angle of 120 degrees between every two cameras and are uniformly distributed on the same mounting surface along the circumferential direction of the medicine strip, and the three light sources are distributed between the two cameras in a one-to-one correspondence manner and are arranged opposite to the three cameras in a one-to-one correspondence manner.
Preferably: the image acquisition component group comprises a plurality of groups, and the plurality of groups of image acquisition component groups are arranged in a one-to-one correspondence manner and are opposite to the plurality of medicine strips.
A dimensional defect detection apparatus, the apparatus comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the above-mentioned size defect detection method according to instructions in the program code.
A computer-readable storage medium for storing program code for performing the dimensional defect detection method described above.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
according to the size defect detection method, the size detection device, the size defect detection equipment and the storage medium, size detection can be coupled into a defect detection flow, high-contrast images shot in the size detection flow are utilized, separation of foreground and background is rapidly carried out by using a traditional algorithm, area images of medicine strips are extracted, the area images and the defect detection shot images are differentiated to be used as input images of defect detection and used for constructing a data set and training a deep learning model, and therefore the method that the false detection rate and the missing detection rate are greatly reduced and the detection speed is considered is achieved. The coupling method of size detection and defect detection optimizes parameters and hyper-parameters, and greatly improves the detection quality. The problems of high product quality fluctuation, high labor intensity, high false detection rate, low productivity, poor instantaneity, certain potential safety hazards and the like caused by manual identification in the traditional propellant powder production process are solved.
In addition, in a preferred embodiment, each camera in the device provided by the application can accurately separate out the interference background; can simultaneously carry out 360-degree all-dimensional dead-angle-free online real-time detection on a plurality of medicine strips. The image acquisition component group is taken as an independent task by synchronously controlling the multiple groups of cameras, so that the detection time is shortened; each group of cameras adopts a polling detection mode, the size detection and the defect quick and effective real-time switching detection functions of the 12 vision cameras on the propellant powder are completed, the size and the defect of the medicine strip are jointly detected on software, and the medicine strip area picture obtained by size detection and separation is used for defect detection, so that the defect detection reaches extremely high accuracy.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can also be derived from them without inventive effort.
FIG. 1 is a flow chart of a method for detecting a dimensional defect according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a size defect detection apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a layout of cameras and light sources included in a single image capturing component set according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a control system of a dimensional defect inspection apparatus according to an embodiment of the present invention;
FIG. 5 is a flowchart of a method for detecting when a group of image capturing components is included according to an embodiment of the present invention;
FIG. 6 is a sub-flowchart of the detection of size defects of the drug strip 1 according to the embodiment of the present invention;
FIG. 7 is a sub-flowchart of the detection of size defects of the drug strip 2 provided by the embodiment of the present invention;
FIG. 8 is a flowchart of a size defect detection algorithm when the image capture assembly group includes a plurality of image capture assembly groups according to an embodiment of the present invention.
In the figure: the device comprises an image acquisition component group 10, a medicine strip 1, a camera 2, a light source 3, a vision computer 4 and a PLC control system 5.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. It is to be understood that the described embodiments are merely a few embodiments of the invention, and not all embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present invention.
Referring to fig. 1, a method for detecting a size defect according to an embodiment of the present invention is shown in fig. 1, and the method may include:
s101: receiving a size detection image of the medicine strip sent by an image acquisition component, wherein the image acquisition component comprises a camera and a light source, the camera and the light source are respectively positioned at two sides of the medicine strip, the camera and the light source are oppositely arranged, and the light source is used for providing background light for the medicine strip when the camera acquires the size detection image;
s102: judging whether the medicine strips are unqualified in size or not according to the medicine strip area image; specifically, threshold segmentation is carried out on the size detection image by using a Threshold algorithm to obtain a size binary image only with black and white two colors;
performing edge extraction on the size binary image to obtain two edge curves of the medicine strip, and calculating the maximum and minimum distances of the two edge curves to obtain a size detection result;
and judging whether the medicine strip has unqualified size according to the size detection result.
S103: if yes, determining that the medicine strip is unqualified;
s104: if not, receiving a defect detection image of the medicine strip sent by an image acquisition assembly, and providing foreground light for the medicine strip when the camera acquires the defect detection image;
s105: acquiring a medicine strip area image through the size detection image; specifically, opening and closing operations are performed on the size binary image to obtain a smooth region segmentation range, and the region in which the drug strip is screened out is subjected to position and area to obtain the drug strip region image.
S106: carrying out differential processing on the medicine strip area image and the defect detection image to obtain a separation image of the medicine strip;
s107: and determining whether quality defects except unqualified sizes exist by adopting an image classification neural network model and the separated images. Specifically, the image classification neural network model constructed based on the MobileNet V2 skeleton network and the separated image are adopted to perform deep learning operation to determine whether quality defects exist.
According to the size defect detection method provided by the embodiment of the application, whether the medicine strips are unqualified in size or not can be determined through size detection, if the medicine strips are unqualified in size, the medicine strips are directly divided into unqualified products, subsequent quality defect detection is not performed, the medicine strips with unqualified sizes can be rapidly removed, useless work for performing quality detection on the medicine strips with unqualified sizes cannot be generated, and the problem of improving the detection efficiency is solved. When the size detection is qualified, the size detection is coupled to the defect detection flow, the separation of the foreground and the background is rapidly carried out by using a traditional algorithm by using a high-contrast image shot in the size detection flow, the area image of the medicine strip is extracted, and the separated image obtained after the difference between the area image and the defect detection shot image is used as an input image of the defect detection of the image classification neural network model, so that the method for greatly reducing the false detection rate and the missing detection rate and considering the detection speed is obtained.
The image acquisition assembly that this application embodiment provided includes a camera and a light source, this light source and camera distribute in the both sides of medicine strip and relative arrangement, and the light source is placed to the camera face to face, and the light source can block other medicine strips and get into camera field of vision within range, detects the interference to it.
And the light source is used for providing background light to the medicine strip when the size detection image is acquired, the background light can be used for creating a bright background, and the opaque medicine strip can form a dark area with strong contrast. The method is favorable for obtaining the outline image of the medicine strip, the outline is an image which is easy to process, and the method is two-dimensional and binary and is convenient for judging whether the size of the medicine strip is unqualified.
In addition, in the method provided by the embodiment of the application, the foreground light can be provided for the drug strip when the defect detection image is acquired, the foreground light can be provided in various different modes, and only the light source and the camera are ensured to be positioned at the same side of the drug strip. The foreground light is helpful for displaying the detailed surface characteristics of the medicine strips, and the obtained defect detection image can show various detailed surface characteristics of the medicine strips.
According to the method provided by the embodiment of the application, when the size and the defect detection are carried out, the size is detected firstly to obtain the medicine strip area image, then the medicine strip area image and the defect detection image are subjected to difference processing to obtain the medicine strip separation image, the defect detection with higher accuracy rate can be realized by applying the deep learning algorithm, and the false detection rate of the defect detection can be effectively reduced.
Referring to fig. 2, an embodiment of the present application may also provide a size defect detecting apparatus, including:
an image acquisition component group 10, said image acquisition component group comprising a plurality of said image acquisition components; the image acquisition assemblies are uniformly distributed along the circumferential direction of the medicine strip;
a vision computer 4, said vision computer 4 being communicatively coupled to said image capture assembly;
the PLC control system 5 is in communication connection with the vision computer 1 and the image acquisition assembly, and the PLC control system 5 is used for sending a detection instruction to the vision computer 4 and receiving a size detection result and a defect detection result returned by the vision computer.
Further, the detection instruction comprises a system instruction protocol packet, wherein the system instruction protocol packet comprises a camera number plus letter protocol packet for size detection and a camera number reinforced digital plus letter protocol packet for defect detection; and calling a single photographing public program package by the vision computer according to the camera number contained in the system instruction protocol package so as to carry out corresponding defect detection through the camera corresponding to the camera number.
The image acquisition component group provided in the embodiment of the present application may include a plurality of cameras 2 and a plurality of light sources 3, for example, in an implementation manner, as shown in fig. 3, the image acquisition component group includes three cameras 2 and three light sources 3, three cameras 2 form an included angle of 120 ° between each two cameras and are uniformly distributed on the same mounting surface along the circumferential direction of the drug strip, three light sources 3 are distributed between two cameras 2 in a one-to-one correspondence manner, and one-to-one correspondence is arranged opposite to three cameras 2.
Meanwhile, in practical applications, the image capturing component group 10 may include a plurality of groups, and the plurality of groups of image capturing component groups are arranged in one-to-one correspondence with the plurality of drug strips. The multiple image acquisition component groups can be used for carrying out size detection and defect detection on multiple medicine strips.
The following describes the apparatus provided in the embodiment of the present application in detail by taking four sets of image capturing components, each set including three cameras and three light sources as an example.
Each camera provided by the device provided by the embodiment of the application can accurately separate the interference background; the propellant powder explosive factory production line adopts 4 groups of propellant powder medicine strips simultaneous forming processes of single screw rod, and every group of 4 groups of medicine strips all needs 360 all-round no dead angles online real-time detection, and the device that provides for this application embodiment need promote single camera efficiency of shooing and change the online real-time detection of many sets of vision camera sizes and defects fast effectively for this reason.
The device provided by the embodiment of the application can couple size detection to a defect detection process, and can rapidly separate a foreground from a background by using a traditional algorithm by using a high-contrast image shot in the size detection process, extract a regional image of a drug strip, and take the regional image and the defect detection shot image after difference as an input image of the defect detection to construct a data set and train a deep learning model, so that the method with greatly reduced false detection rate and missed detection rate and detection speed is obtained. The coupling method of size detection and defect detection optimizes parameters and hyper-parameters, and greatly improves the detection quality. The problems of large product quality fluctuation, high labor intensity, high false detection and error detection rate, low capacity, poor real-time performance, certain potential safety hazard and the like caused by manual identification in the traditional propellant powder production process are solved.
The device comprises 4 groups of image acquisition component groups for medicine strip forming 360-degree omnibearing dead angle-free detection, wherein the image acquisition component groups comprise 10-1, 10-2, 10-3 and 10-4 as shown in figure 4. Set up 3 cameras through every group medicine strip, two liang of camera contained angles 120 in the overall arrangement every group, configuration light source between the contained angle, totally 12 vision cameras have accomplished 4 groups medicine strip shaping all-round no dead angle detection function. By synchronously controlling the 4 groups of cameras, the image acquisition component group is taken as an independent task, so that the detection time is shortened; each group of cameras adopts a polling detection mode, the size detection and the defect quick and effective real-time switching detection functions of the 12 vision cameras on the propellant powder are completed, the size and the defect of the medicine strip are jointly detected on software, and the medicine strip area picture obtained by size detection and separation is used for defect detection, so that the defect detection reaches extremely high accuracy.
The device consists of 12 cameras and 12 light sources. The single group of medicine strips consists of 3 cameras and 3 light sources, and 4 groups of medicine strips are used, the size and the defects of the medicine strips are detected on line in real time, and the 4 groups of medicine strip detection are relatively independent. See fig. 5.
The quality of the field drug strips is acquired by photographing through a visual camera, the acquired data is calculated through a computer vision algorithm, then the detection result is sent to a PLC control system, and the PLC control system judges the calculation result and then displays the result to an upper computer system or controls other cameras. Therefore, information interaction comprises the steps of receiving and transmitting signals between the visual camera and the computer and between the computer and the PLC control system, the PLC control system is responsible for receiving and transmitting signals, the visual computer mainly analyzes instructions issued by the PLC, and the camera is directly operated and operated after the instructions are analyzed.
Referring to fig. 8, the specific working process is as follows:
s1: the 4 groups of the propellant powder strips are independently formed, the 3 cameras are respectively arranged at an included angle of 120 degrees in the online detection of the single group of the propellant powder strips, and the 3 cameras can realize 360-degree dead-angle-free detection in the visual field range. And a light source is arranged opposite to each camera, and the light source can also block other medicine strips from entering the visual field range of the cameras to detect and interfere the medicine strips. The detection mode of each group of medicine strips is the same, so that 4 groups of medicine strips are arranged in a staggered manner in space installation, do not influence each other and are relatively independent.
S2: the communication connection between the 12 cameras and the visual computer is established, so that real-time photographing can be realized, and on-site photographing information can be obtained.
S3: establishing TCPIP communication connection between a PLC control system and a vision computer, calling a connection instruction, setting communication protocol contents among the PLC control system and the vision computer after the connection is successful, and judging that the camera size 1 detection command of the image acquisition component group 1 is the information when the vision computer receives the information, if the communication protocol contents between the PLC control system and the vision computer send a '01OKOK OR NONO' instruction to the vision computer. And switching the station light source to background light, and taking a picture to obtain a size detection image.
S4: and (4) carrying out Threshold segmentation on the size detection image by using a Threshold algorithm to obtain a binary image only with black and white two colors. And performing edge extraction on the size binary image to obtain an edge curve of the medicine strip, and calculating the maximum and minimum distances of the two curves to obtain a size detection result. And performing opening operation and closing operation on the size binary image to obtain a smooth region segmentation range, and screening out the region of the drug strip through the position and the area to obtain a drug strip region image.
S5: the obtained '01OKOK' is qualified in the size of the shooting result of the No. 1 camera, and the obtained '01NONO' is unqualified in the size of the shooting result of the No. 1 camera; when a 21OKOK OR NONO command is sent to the vision computer, the vision computer judges that the No. 1 camera defect detection command of the image acquisition component group 1 is received by the information, switches the station light source to the foreground light and takes a picture to obtain a defect detection image. It is understood that the foreground light may be provided by the light sources corresponding to the camera 2 and the camera 3 of the image capturing assembly group 1, or may be a flash light source of the camera 1.
S6: and (5) carrying out difference processing on the medicine strip area image obtained in the step (S4) and the defect detection image obtained in the step (S5) to obtain an independent medicine strip separation image.
S7: and (4) collecting a large number of medicine strip separation images in the step (S6), screening, classifying the images, and making into a deep learning data set. And constructing an image classification neural network model by using a MobileNet V2 skeleton network, training the data set, and converging to obtain the optimal network parameters.
S8: and (4) when the device runs, performing deep learning operation on the medicine strip separation image obtained in the step (S6) by using the network parameters obtained in the step (S7) to obtain a defect detection classification result.
S9: the obtained '21OKOK' is qualified as the shooting result defect of the No. 1 camera, and the obtained '21NONO' is unqualified as the shooting result defect of the No. 1 camera; and by analogy, finally obtaining an instruction protocol packet of the vision computer and the PLC control system.
S10: and taking a single camera photographing program containing the instruction protocol package as a common subprogram package. The program determines the number of the photographing camera through assignment, sends a camera detection instruction to the visual computer, and the computer obtains a photographing result through calculation.
S11: establishing an image acquisition component group (drug article number) size defect detection sub-process, taking an image acquisition component group 1 as an example, as shown in fig. 6, connecting the image acquisition component group, switching on a light source 1, switching off a light source 2, switching off a light source 3, assigning a camera number 1 for size detection (N = 1), calling a single photographing common program package, completing the size detection of the camera number 1, obtaining a size detection result, if the size detection result is not qualified, terminating the program, if the size detection result is qualified, assigning the camera number 1 for defect detection (N +20= 21), calling the single photographing common program package, completing the defect detection of the camera number 1, obtaining a defect detection result, if the size detection result is not qualified, terminating the program, if the size detection result is qualified, converting the light source, and assigning the camera number 2 for the above operations. And when all the obtained camera photographing results are qualified, the photographing result is qualified if the image acquisition component group 1 is qualified, and if one camera is unqualified, the camera is judged to be unqualified, and the program is terminated. And so on, as shown in fig. 7, the detection principle of other image acquisition component groups is the same.
S12: the obtained 4 groups of image acquisition component groups are used as tasks, can be simultaneously operated in a PLC system, cannot be used as subprograms or interrupt programs, and cannot realize real-time detection. As an independent task in a PLC control system, real-time online detection can be realized.
4 image acquisition component groups are correspondingly arranged on 4 groups of medicine strips in the device, wherein the device is not limited to the 4 image acquisition component groups and can be expanded into a plurality of image acquisition component groups, and an established instruction protocol package of a visual computer and a PLC control system is established, wherein the size detection adopts a camera number plus letter form, and the defect detection adopts a camera number strengthening digital plus letter form; the method comprises the steps that a single common photographing program package is included, the program package determines the number of a photographing camera through assignment, a camera detection instruction is sent to a visual computer, and the computer obtains a photographing result through calculation; the method comprises an image acquisition component sub-process, wherein a camera number is assigned to determine, size detection or defect detection is determined, and a single photographing common program package is called to obtain a detection result. The detection of a plurality of groups of medicine strips as independent tasks can be realized, and real-time online detection can be realized.
The device provided by the embodiment of the application can also use the image acquisition component group as an independent task of the PLC control system through the established instruction protocol packet and the image acquisition component group sub-process, so that real-time online synchronous detection is realized, the detection time is shortened, the polling detection mode is adopted, the size is detected firstly, then the defect is detected, the size and defect detection is realized, and the detection quality is greatly improved.
The embodiment of the present application may further provide a size defect detecting apparatus, where the apparatus includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the above-described size defect detection method according to instructions in the program code.
Embodiments of the present application may also provide a computer-readable storage medium for storing program code for performing the above-mentioned size defect detecting method.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute the method according to the embodiments or some portions of the embodiments of the present application.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method of detecting dimensional defects, comprising:
receiving a size detection image of the medicine strip sent by an image acquisition component, wherein the image acquisition component comprises a camera and a light source, the camera and the light source are respectively positioned at two sides of the medicine strip, the camera and the light source are oppositely arranged, and the light source is used for providing background light for the medicine strip when the camera acquires the size detection image;
judging whether the medicine strips have unqualified sizes or not through the medicine strip area images;
if so, determining that the medicine strip is unqualified;
if not, receiving a defect detection image of the medicine strip sent by an image acquisition assembly, and providing foreground light for the medicine strip when the camera acquires the defect detection image;
acquiring a medicine strip area image through the size detection image;
carrying out differential processing on the medicine strip area image and the defect detection image to obtain a separation image of the medicine strip;
and determining whether the quality defect exists by adopting an image classification neural network model and the separation image.
2. The method for detecting the size defect according to claim 1, wherein the judging whether the medicine strip has the unqualified size through the medicine strip area image comprises the following steps:
carrying out Threshold segmentation on the size detection image by using a Threshold algorithm to obtain a size binary image only with black and white two colors;
performing edge extraction on the size binary image to obtain two edge curves of the medicine strip, and calculating the maximum and minimum distances of the two edge curves to obtain a size detection result;
and judging whether the medicine strip has unqualified size according to the size detection result.
3. The method for detecting the size defect according to claim 2, wherein the step of obtaining the medicine strip area image through the size detection image comprises the following steps:
and performing opening operation and closing operation on the size binary image to obtain a smooth region segmentation range, and screening out the region of the drug strip through the position and the area to obtain the drug strip region image.
4. The method of claim 1, wherein the determining whether a quality defect other than a dimensional defect exists using an image classification neural network model and the separate images comprises:
and carrying out deep learning operation by adopting the image classification neural network model constructed based on the Mobi LeNetV2 skeleton network and the separated image to determine whether quality defects exist.
5. A dimensional defect inspection apparatus, comprising:
an image acquisition assembly group comprising a number of image acquisition assemblies as claimed in any one of claims 1 to 4; the image acquisition assemblies are uniformly distributed along the circumferential direction of the medicine strip;
a vision computer communicably coupled to the image acquisition component;
the PLC control system is in communication connection with the vision computer and the image acquisition assembly and is used for sending a detection instruction to the vision computer and receiving a size detection result and a defect detection result returned by the vision computer.
6. The apparatus according to claim 5, wherein the inspection instruction includes a system instruction protocol packet including a camera number plus letter format protocol packet for size inspection and a camera number reinforced digital plus letter format protocol packet for defect inspection; and calling a single photographing public program package by the vision computer according to the camera number contained in the system instruction protocol package so as to carry out corresponding size detection and defect detection through the camera corresponding to the camera number.
7. The apparatus according to claim 5, wherein the image capturing assembly group includes three cameras and three light sources, the three cameras are uniformly distributed on a same mounting surface along a circumferential direction of the drug strip with an included angle of 120 ° between every two cameras, and the three light sources are distributed between the two cameras in a one-to-one correspondence manner and are arranged opposite to the three cameras in a one-to-one correspondence manner.
8. The apparatus according to claim 5, wherein the image capturing assembly group comprises a plurality of groups, and the plurality of groups of image capturing assembly groups are arranged in one-to-one correspondence with the plurality of drug strips.
9. A dimensional defect inspection apparatus, comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to perform the dimensional defect detection method of any one of claims 1-4 according to instructions in the program code.
10. A computer-readable storage medium for storing program code for performing the method of any one of claims 1-4.
CN202211218094.0A 2022-09-30 2022-09-30 Size defect detection method, device, equipment and storage medium Pending CN115435684A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211218094.0A CN115435684A (en) 2022-09-30 2022-09-30 Size defect detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211218094.0A CN115435684A (en) 2022-09-30 2022-09-30 Size defect detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115435684A true CN115435684A (en) 2022-12-06

Family

ID=84251314

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211218094.0A Pending CN115435684A (en) 2022-09-30 2022-09-30 Size defect detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115435684A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116399874A (en) * 2023-06-08 2023-07-07 华东交通大学 Method and program product for shear speckle interferometry to non-destructive detect defect size

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116399874A (en) * 2023-06-08 2023-07-07 华东交通大学 Method and program product for shear speckle interferometry to non-destructive detect defect size
CN116399874B (en) * 2023-06-08 2023-08-22 华东交通大学 Method and program product for shear speckle interferometry to non-destructive detect defect size

Similar Documents

Publication Publication Date Title
CN106770332B (en) A kind of electronic die blank defects detection implementation method based on machine vision
CN108229665A (en) A kind of the System of Sorting Components based on the convolutional neural networks by depth
CN107194559B (en) Workflow identification method based on three-dimensional convolutional neural network
CN112871703B (en) Intelligent management coal preparation platform and method thereof
CN111222478A (en) Construction site safety protection detection method and system
CN109389105B (en) Multitask-based iris detection and visual angle classification method
CN115435684A (en) Size defect detection method, device, equipment and storage medium
CN110560376B (en) Product surface defect detection method and device
CN112184648A (en) Piston surface defect detection method and system based on deep learning
CN102879404B (en) System for automatically detecting medical capsule defects in industrial structure scene
CN208092786U (en) A kind of the System of Sorting Components based on convolutional neural networks by depth
CN105844282A (en) Method for detecting defects of fuel injection nozzle O-Ring through line scanning camera
WO2023134286A1 (en) Online automatic quality testing and classification method for cathode copper
CN114638797A (en) Method and device for detecting copper surface defects based on linear array camera
CN107958253A (en) A kind of method and apparatus of image recognition
KR102391501B1 (en) Classification System and method for atypical recycled goods using Deep learning
JPWO2020149001A1 (en) Information processing equipment, control methods, and programs
CN114264607B (en) Machine vision-based tile color difference online detection system and method
CN110796008A (en) Early fire detection method based on video image
CN108957384A (en) A kind of turnover box and electric energy measuring equipment discriminating direction method and apparatus
CN113618737A (en) Visual identification system for industrial platform
Matić et al. Real time contour based ceramic tile edge and corner defects detection
CN111428813A (en) Panel number identification and pressing method based on deep learning
CN106156801B (en) A kind of coloured particle selection method based on image procossing
CN107992497B (en) Picture display method and device

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