A size defect detection method, device, equipment and storage medium
By using image acquisition components and deep learning models for automated inspection during the molding of the launch drug strip, the quality instability and safety hazards caused by manual detection are solved, and efficient and accurate size and defect detection are achieved.
Patent Information
- Application Number
- CN202211218094.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-09-30
AI Technical Summary
In the prior art, the molding process of the launching drug strips relies on manual online inspection, resulting in poor quality consistency, high false detection and error detection rate, low production capacity, poor real-time performance, and production safety hazards.
The image acquisition component is used to include a camera and a light source, and the size detection image and defect detection image of the drug strip are received and processed, and the foreground background separation and defect detection are performed using the Threshold algorithm and image classification neural network model to achieve automated size and defect detection.
It significantly reduces the false detection and missed detection rates, improves the detection speed and accuracy, solves the problems of large volatility in product quality and high labor intensity caused by manual testing, and improves production safety and production capacity.
Smart Images

Figure CN115435684B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field, and in particular to a method, device, equipment and storage medium capable of realizing online detection of propellant strip molding and high-accuracy dimensional defect detection. Background Art
[0002] The propellant production process in my country has always adopted the process technology and equipment from the factory establishment period. In recent years, comprehensive technical transformation and scientific research public relations have been carried out in the explosive preparation industry, but the original production model has not been changed. Online product quality inspection needs to be done manually. The formed propellant is transmitted on the belt line, and workers repeatedly inspect it with the naked eye from the side. The labor intensity of the human eye is high, and workers do not rest for a long time and are easily fatigued. It is easy to make false inspections and missed inspections, and even fatal defects will be missed, causing great quality and safety risks. At the same time, the volatile toxic and harmful gases from the propellant strips seriously threaten the health of the workers.
[0003] At present, most of the production lines of propellant and explosive factories in my country adopt a single-screw process to form four groups of propellant strips at the same time. With the development of science and technology, visual inspection has been widely used instead of manual inspection in quality inspection. However, the visual inspection in the existing technology is difficult to separate the background of the strips, which is prone to interference. In terms of software algorithms, the existing visual inspection technology has the following shortcomings: traditional algorithms cannot identify most defects such as scratches and burrs, and algorithms based on deep learning are difficult to accurately separate the strip body due to different foreground lighting conditions and background images, resulting in high false detection and missed detection rates of defect detection, and slow detection speed.
[0004] Therefore, how to provide a dimension defect detection method with low false detection rate, high production capacity and good real-time performance is a technical problem that urgently needs to be solved by technical personnel in this field. Summary of the invention
[0005] In view of the above problems, the present invention provides a dimensional defect detection method, device, equipment and storage medium for overcoming the above problems or at least partially solving the above problems, which solves the problems of poor consistency of molding quality, high false detection rate, low production capacity, poor real-time performance, insufficient production safety, etc. in the production process of traditional method of propellant strip molding, which relies on manual experience for online detection.
[0006] The present invention provides the following scheme:
[0007] A size defect detection method, comprising:
[0008] receiving a size detection image of the medicine strip sent by an image acquisition component, wherein the image acquisition component includes a camera and a light source, wherein the camera and the light source are respectively located on two sides of the medicine strip, and the camera and the light source are arranged opposite to each other, and the light source is used to provide background light to the medicine strip when the camera acquires the size detection image;
[0009] Judging whether the medicine strip has a size defect through the medicine strip area image;
[0010] If yes, then the drug strip is determined to be unqualified;
[0011] If not, receiving a defect detection image of the medicine strip sent by the image acquisition component, the camera providing foreground light to the medicine strip when acquiring the defect detection image;
[0012] Acquire a medicine strip area image through the size detection image;
[0013] Performing differential processing on the medicine strip area image and the defect detection image to obtain a separated image of the medicine strip;
[0014] An image classification neural network model and the separated image are used to determine whether a quality defect exists.
[0015] Preferably, judging whether the medicine strip has a size that is unqualified by using the medicine strip area image includes:
[0016] Perform threshold segmentation on the size detection image using a Threshold algorithm to obtain a size binary image with only black and white colors;
[0017] Performing edge extraction on the size binary image to obtain two edge curves of the medicine strip, and calculating the maximum and minimum distances between the two edge curves to obtain a size detection result;
[0018] It is determined whether the medicine strip has unqualified size according to the size detection result.
[0019] Preferably, the step of acquiring the medicine strip area image through the size detection image comprises:
[0020] Opening and closing operations are performed on the binary image to obtain a smooth region segmentation range, and the region of the medicine strip is screened out from the region by position and area to obtain the medicine strip region image.
[0021] Preferably, the method of using the image classification neural network model and the separated image to determine whether there are quality defects other than unqualified size includes:
[0022] The image classification neural network model constructed based on the MobileNetV2 skeleton network and the separated image are used to perform deep learning operations to determine whether there are quality defects.
[0023] A size defect detection device, comprising:
[0024] An image acquisition component group, the image acquisition component group includes a plurality of the above-mentioned image acquisition components; the image acquisition components are evenly distributed along the circumference of the medicine strip;
[0025] A visual computer, the visual computer is communicatively connected to the image acquisition component;
[0026] A PLC control system is communicatively connected with the visual computer and the image acquisition component, and is used to send detection instructions to the visual computer and receive size detection and defect detection results returned by the visual computer.
[0027] Preferably: the detection instruction includes a system instruction protocol package, and the system instruction protocol package includes a protocol package in the form of a camera number plus letters for size detection and a protocol package in the form of a camera number plus fixed numbers plus letters for defect detection; so that the visual computer calls a single camera public program package according to the camera number included in the system instruction protocol package to perform corresponding size detection and defect detection through the camera corresponding to the camera number.
[0028] Preferably: the image acquisition component group includes three cameras and three light sources, the three cameras are evenly distributed on the same mounting surface along the circumference of the medicine strip at an angle of 120° between each other, and the three light sources are distributed one-to-one between two cameras and arranged one-to-one relative to the three cameras.
[0029] Preferably, the image acquisition component group comprises a plurality of groups, and the plurality of image acquisition component groups are arranged one-to-one correspondingly relative to the plurality of medicine strips.
[0030] A size defect detection device, the device comprising a processor and a memory:
[0031] The memory is used to store program code and transmit the program code to the processor;
[0032] The processor is used to execute the above-mentioned size defect detection method according to the instructions in the program code.
[0033] A computer-readable storage medium is used to store program codes, and the program codes are used to execute the above-mentioned size defect detection method.
[0034] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0035] The embodiment of the present application provides a size defect detection method, device, equipment and storage medium. The method can couple size detection to the defect detection process, use the high-contrast image captured in the size detection process, use traditional algorithms to quickly separate the foreground and background, extract the regional image of the medicine strip, and use it as the input image for defect detection after differential with the defect detection image and use it to build a data set and train a deep learning model, thereby obtaining a method that greatly reduces the false detection rate and missed detection rate while taking into account the detection speed. The method of coupling size detection and defect detection optimizes parameters and hyperparameters, greatly improving the detection quality. It solves the problems of large product quality fluctuations, high labor intensity, high false detection and wrong detection rates, low production capacity, poor real-time performance, and certain safety hazards caused by manual identification in the traditional propellant production process.
[0036] In addition, under the preferred embodiment, each camera in the device provided by the present application can accurately separate the interference background; multiple medicine strips can be simultaneously detected in real time at 360° all-round and without blind spots. By synchronously controlling multiple groups of cameras, the image acquisition component group is used as an independent task, which shortens the detection time; each group of cameras adopts a polling detection mode, and completes the 12 visual cameras to detect the size of the propellant and the defects of the fast and effective real-time switching detection function, the software performs a joint detection of the size and defects of the medicine strips, and the medicine strip area pictures obtained by the size detection separation are used for defect detection, so that the defect detection reaches a very high accuracy rate.
[0037] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 is a flow chart of a size defect detection method provided by an embodiment of the present invention;
[0040] Figure 2 is a structural schematic diagram of a size defect detection device provided by an embodiment of the present invention;
[0041] Figure 3 It is a schematic diagram of the layout of cameras and light sources included in a single set of image acquisition components provided in an embodiment of the present invention;
[0042] Figure 4 is a simplified diagram of a control system of a size defect detection device provided by an embodiment of the present invention;
[0043] Figure 5 is a flow chart of a detection method including multiple groups of image acquisition components provided by an embodiment of the present invention;
[0044] Figure 6 is a sub-flow chart of the size defect detection of the medicine strip 1 provided by an embodiment of the present invention;
[0045] Figure 7 is a sub-flow chart of the size defect detection of the medicine strip 2 provided by an embodiment of the present invention;
[0046] Figure 8 It is a flow chart of a size defect detection algorithm including multiple groups of image acquisition components provided by an embodiment of the present invention.
[0047] In the figure: image acquisition component group 10, medicine strip 1, camera 2, light source 3, visual computer 4, PLC control system 5. DETAILED DESCRIPTION
[0048] The technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0049] See also Figure 1 , is a size defect detection method provided by an embodiment of the present invention, such as Figure 1 As shown, the method may include:
[0050] S101: receiving a size detection image of a medicine strip sent by an image acquisition component, wherein the image acquisition component includes a camera and a light source, wherein the camera and the light source are respectively located on two sides of the medicine strip, and the camera and the light source are arranged opposite to each other, and the light source is used to provide background light to the medicine strip when the camera acquires the size detection image;
[0051] S102: judging whether the medicine strip has a size defect through the medicine strip region image; specifically, performing threshold segmentation on the size detection image using a Threshold algorithm to obtain a size binary image consisting of only black and white colors;
[0052] Performing edge extraction on the size binary image to obtain two edge curves of the medicine strip, and calculating the maximum and minimum distances between the two edge curves to obtain a size detection result;
[0053] It is determined whether the medicine strip has unqualified size according to the size detection result.
[0054] S103: If yes, determining that the medicine strip is unqualified;
[0055] S104: if not, receiving the defect detection image of the medicine strip sent by the image acquisition component, and providing foreground light to the medicine strip when the camera acquires the defect detection image;
[0056] S105: Acquire a medicine strip area image through the size detection image; specifically, perform opening and closing operations on the size binary image to obtain a smooth area segmentation range, and filter out the medicine strip area from it by position and area to obtain the medicine strip area image.
[0057] S106: performing differential processing on the medicine strip region image and the defect detection image to obtain a separated image of the medicine strip;
[0058] S107: Using the image classification neural network model and the separated image to determine whether there are quality defects other than unqualified size. Specifically, using the image classification neural network model built based on the MobileNetV2 skeleton network and the separated image to perform deep learning operations to determine whether there are quality defects.
[0059] The size defect detection method provided in the embodiment of the present application can first determine whether the medicine strip has unqualified size through size detection. If the size is unqualified, it will be directly classified as an unqualified product, and no subsequent quality defect detection will be performed. In this way, the medicine strips with unqualified size can be quickly eliminated, and the useless work of quality detection of unqualified medicine strips will not occur, thereby achieving the problem of improving detection efficiency. When the size detection is qualified, by coupling the size detection to the defect detection process, using the high-contrast image captured in the size detection process, using the traditional algorithm to quickly separate the foreground and background, extracting the regional image of the medicine strip, and using the separated image obtained by differentiating the regional image and the defect detection image as the input image of the defect detection of the image classification neural network model, a method is obtained in which the false detection rate and missed detection rate are greatly reduced and the detection speed is taken into account.
[0060] The image acquisition component provided in the embodiment of the present application includes a camera and a light source. The light source and the camera are distributed on both sides of the medicine strip and arranged opposite to each other. The light source is placed opposite the camera. The light source can block other medicine strips from entering the camera's field of view and interfere with their detection.
[0061] At the same time, when acquiring the size detection image, the light source is used to provide background light to the medicine strip, and the background light can be used to create a bright background, while the opaque medicine strip can form a dark area with strong contrast. It is beneficial to obtain the outline image of the medicine strip. The outline is an easy-to-process image because it is two-dimensional and binary, which is convenient for judging whether the size of the medicine strip is unqualified.
[0062] In addition, in the method provided in the embodiment of the present application, when acquiring the defect detection image, foreground light can be provided to the medicine strip, and the foreground light can be provided in a variety of different ways, as long as the light source and the camera are located on the same side of the medicine strip. The foreground light helps to display the surface detail features of the medicine strip, ensuring that the obtained defect detection image can show various surface detail features of the medicine strip.
[0063] The method provided in the embodiment of the present application, when performing size and defect detection, first detects the size to obtain a medicine strip area image, and then performs differential processing on the defect detection image to obtain a medicine strip separation image. By using a deep learning algorithm, defect detection with a high accuracy rate can be achieved. This method can effectively reduce the false detection rate of defect detection.
[0064] See also Figure 2 , the embodiment of the present application may also provide a size defect detection device, including:
[0065] An image acquisition component group 10, the image acquisition component group includes a plurality of the above-mentioned image acquisition components; the image acquisition components are evenly distributed along the circumference of the medicine strip;
[0066] A visual computer 4, wherein the visual computer 4 is communicatively connected with the image acquisition component;
[0067] A PLC control system 5 is communicatively connected with the visual computer 1 and the image acquisition component, and is used to send detection instructions to the visual computer 4 and receive size detection and defect detection results returned by the visual computer.
[0068] Furthermore, the detection instruction includes a system instruction protocol package, and the system instruction protocol package includes a protocol package in the form of a camera number plus letters for size detection and a protocol package in the form of a camera number plus fixed numbers plus letters for defect detection; so that the visual computer calls a single camera public program package according to the camera number contained in the system instruction protocol package to perform corresponding defect detection through the camera corresponding to the camera number.
[0069] The image acquisition component group provided in the embodiment of the present application may include multiple cameras 2 and multiple light sources 3. For example, in one implementation, Figure 3 As shown, the image acquisition component group includes three cameras 2 and three light sources 3. The three cameras 2 are evenly distributed on the same mounting surface along the circumference of the medicine strip at an angle of 120° between each other, and the three light sources 3 are distributed one-to-one between two cameras 2 and arranged one-to-one relative to the three cameras 2.
[0070] Meanwhile, in practical applications, the image acquisition component group 10 may include multiple groups, and the multiple image acquisition component groups are arranged one by one with respect to the multiple medicine strips. The multiple image acquisition component groups can be used to perform size detection and defect detection on the multiple medicine strips.
[0071] The following describes in detail the device provided in the embodiment of the present application by taking the example of setting four groups of image acquisition component groups, each group including three cameras and three light sources.
[0072] Each camera provided by the device provided in the embodiment of the present application can accurately separate the interference background; the production line of the propellant and explosive factory adopts a single-screw simultaneous molding process for 4 groups of propellant strips, and each of the 4 groups of strips requires 360° all-round online real-time detection without dead angles. For this reason, the device provided in the embodiment of the present application needs to improve the photography efficiency of a single camera and quickly and effectively convert multiple sets of visual cameras for online real-time detection of sizes and defects.
[0073] The device provided in the embodiment of the present application can couple size detection to the defect detection process, utilize the high-contrast images captured in the size detection process, use traditional algorithms to quickly separate the foreground and background, extract the regional image of the medicine strip, and use it as the input image for defect detection after differential with the image captured for defect detection and use it to construct a data set and train a deep learning model, thereby obtaining a method that greatly reduces the false detection rate and missed detection rate while taking into account the detection speed. The method of coupling size detection and defect detection optimizes parameters and hyperparameters, greatly improving the detection quality. It solves the problems of large product quality fluctuations, high labor intensity, high false detection and misdetection rates, low production capacity, poor real-time performance, and certain safety hazards caused by manual identification in the traditional propellant production process.
[0074] The device includes 4 sets of image acquisition components for 360° all-round detection of drug strip forming without blind spots, such as Figure 4 As shown, the image acquisition component group includes 10-1, 10-2, 10-3, and 10-4. By setting 3 cameras for each group of medicine strips, arranging the angle between the two cameras in each group to be 120°, and configuring a light source between the angles, a total of 12 visual cameras complete the all-round and no-dead-angle detection function of the forming of 4 groups of medicine strips. By synchronously controlling the 4 groups of cameras, the image acquisition component group is used as an independent task to shorten the detection time; each group of cameras adopts a polling detection mode, and the 12 visual cameras complete the size detection and defect fast and effective real-time switching detection function of the propellant. The software performs joint detection of the size and defects of the medicine strips, and the medicine strip area pictures separated by the size detection are used for defect detection, so that the defect detection reaches a very high accuracy.
[0075] The device consists of 12 cameras and 12 light sources. A single group of medicine strips consists of 3 cameras and 3 light sources, with a total of 4 groups of medicine strips. The size and defects of the medicine strips are detected online in real time, and the 4 groups of medicine strips are relatively independent. Figure 5 .
[0076] The quality of the on-site medicine strips is collected by taking photos with a visual camera. The collected data is calculated by a computer vision algorithm and the test results are sent to the PLC control system. The PLC control system judges the calculation results and displays them to the host system or controls other cameras. Therefore, information interaction includes between the visual camera and the computer, and between the computer and the PLC control system. The PLC control system is responsible for sending and receiving signals, and the visual computer mainly parses the instructions issued by the PLC, and directly operates and calculates the camera after parsing.
[0077] See also Figure 8 The specific working process is as follows:
[0078] S1: 4 groups of propellant strips are formed independently. Three cameras are used for online detection of a single group of propellant strips at an angle of 120°. The field of view of these three cameras can achieve 360° detection without blind spots. A light source is placed opposite each single camera, which can also block other propellant strips from entering the camera's field of view and interfere with their detection. Each group of propellant strips is detected in the same way, so the four groups are staggered in the spatial installation to ensure that they do not affect each other and are relatively independent.
[0079] S2: Establish communication connections between 12 cameras and the visual computer to achieve real-time photography and obtain on-site photography information.
[0080] S3: Establish a TCPIP communication connection between the PLC control system and the visual computer, call the connection command, and after the connection is successful, set the communication protocol content between each other. For example, when the '01OKOK OR NONO' command is sent to the visual computer, the visual computer receives the information and determines it as the size detection command of camera No. 1 of image acquisition component group 1. Switch the station light source to background light, and take a photo to obtain the size detection image.
[0081] S4: Use the Threshold algorithm to perform threshold segmentation on the size detection image to obtain a binary image with only black and white colors. Perform edge extraction on the size binary image to obtain the edge curve of the medicine strip, and calculate the maximum and minimum distances between the two curves to obtain the size detection result. Perform open and close operations on the size binary image to obtain a smooth area segmentation range, and filter out the area of the medicine strip from it by position and area to obtain the medicine strip area image.
[0082] S5: '01OKOK' is obtained if the size of the result taken by camera No. 1 is qualified, and '01NONO' is obtained if the size of the result taken by camera No. 1 is unqualified; when the '21OKOK OR NONO' instruction is sent to the visual computer, the visual computer receives the information and determines it as a defect detection command of camera No. 1 of image acquisition component group 1, switches the station light source to foreground light, and takes a picture to obtain a defect detection image. It can be understood that the foreground light can be provided by the light sources corresponding to camera No. 2 and camera No. 3 of image acquisition component group 1, or it can be the flash light source of camera No. 1.
[0083] S6: Perform differential processing on the medicine strip area image obtained in step S4 and the defect detection image obtained in step S5 to obtain a separate medicine strip separation image.
[0084] S7: Collect a large number of images of drug strip separation in step S6, screen them, classify them, and make them into deep learning data sets. Use the MobileNetV2 skeleton network to build an image classification neural network model, train the above data set, and obtain the optimal network parameters after convergence.
[0085] S8: When the device is running, the network parameters obtained in step S7 are used to perform deep learning operations on the drug strip separation image obtained in step S6 to obtain defect detection classification results.
[0086] S9: '21OKOK' is obtained if the defect of the camera No. 1 shooting result is qualified, and '21NONO' is obtained if the defect of the camera No. 1 shooting result is unqualified; and so on, finally the instruction protocol package of the visual computer and the PLC control system is obtained.
[0087] S10: The single camera shooting program including the command protocol package is used as a public subroutine package. The program determines the camera number by assigning a value, sends the camera detection command of the number to the visual computer, and the computer obtains the shooting result after calculation.
[0088] S11: Establish the image acquisition component group (drug bar number) size defect detection sub-process, taking the image acquisition component group 1 as an example, Figure 6As shown, the communication connection is successful, light source 1 is turned on, light source 2 is turned off, and light source 3 is turned off. Camera No. 1 is assigned to perform size detection (N=1), and the single-camera common program package is called to complete the size detection of camera No. 1, and the size detection result is obtained. If it is unqualified, the program is terminated. If it is qualified, camera No. 1 is assigned to perform defect detection (N+20=21), and the single-camera common program package is called to complete the defect detection of camera No. 1. The defect detection result is obtained. If it is unqualified, the program is terminated. If it is qualified, the light source is changed, and camera No. 2 is assigned to perform the above operations. When all camera photo results are qualified, the photo results of image acquisition component group 1 are qualified. If one item is unqualified, it is considered unqualified and the program is terminated. And so on. Figure 7 As shown, the detection principles of other image acquisition component groups are the same.
[0089] S12: The obtained 4 sets of image acquisition component groups can be run as tasks in the PLC system at the same time, but cannot be used as subroutines or interrupt programs, and real-time detection cannot be achieved. As independent tasks in the PLC control system, real-time online detection can be achieved.
[0090] In the device, four groups of medicine strips are provided with four image acquisition component groups corresponding to each other, which are not limited to four image acquisition component groups and can be expanded to multiple image acquisition component groups. The established visual computer and PLC control system instruction protocol package, in which the size detection adopts the camera number plus letters, and the defect detection adopts the camera number plus fixed numbers plus letters; it includes a single camera public program package, which determines the camera number by assignment, sends the camera detection instruction of the number to the visual computer, and the computer obtains the camera result after calculation; it includes the image acquisition component group sub-process, which first assigns the camera number, and determines the size detection or defect detection, and calls the single camera public program package to obtain the detection result. It includes multiple groups of medicine strips as independent task detection, which can realize real-time online detection.
[0091] The device provided in the embodiment of the present application can also establish an instruction protocol package and an image acquisition component group sub-process, and use the image acquisition component group as an independent task of the PLC control system, thereby realizing real-time online synchronous detection, shortening the detection time, and adopting a polling detection mode to first detect the size and then detect the defect, thereby realizing size and defect detection and greatly improving the detection quality.
[0092] The embodiment of the present application may also provide a size defect detection device, which includes a processor and a memory:
[0093] The memory is used to store program code and transmit the program code to the processor;
[0094] The processor is used to execute the above-mentioned size defect detection method according to the instructions in the program code.
[0095] The embodiment of the present application may also provide a computer-readable storage medium, which is used to store program code, and the program code is used to execute the above-mentioned size defect detection method.
[0096] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0097] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0098] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for detecting size defects, characterized in that: include: Receive a size detection image of the medicine strip sent by an image acquisition component, wherein the image acquisition component includes three cameras and three light sources, wherein the three light sources are arranged opposite to the three cameras in a one-to-one correspondence and are respectively located on both sides of the medicine strip, and when the camera acquires the size detection image, one of the light sources opposite to the camera is used to provide background light to the medicine strip; Judging whether the medicine strip has a size defect through the medicine strip area image; If yes, then the drug strip is determined to be unqualified; If not, receiving the defect detection image of the medicine strip sent by the image acquisition component, and the two light sources that are not opposite to the camera provide foreground light to the medicine strip when the camera acquires the defect detection image; Acquire a medicine strip area image through the size detection image; Performing differential processing on the medicine strip area image and the defect detection image to obtain a separated image of the medicine strip; An image classification neural network model and the separated image are used to determine whether a quality defect exists.
2. The dimensional defect detection method according to claim 1, characterized in that: The step of judging whether the medicine strip has a size defective through the medicine strip area image includes: Perform threshold segmentation on the size detection image using a Threshold algorithm to obtain a size binary image with only black and white 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 between the two edge curves to obtain a size detection result; It is determined whether the medicine strip has unqualified size according to the size detection result.
3. The dimensional defect detection method according to claim 2, characterized in that: The step of acquiring the medicine strip area image through the size detection image comprises: Opening and closing operations are performed on the binary image to obtain a smooth region segmentation range, and the region of the medicine strip is screened out from the region by position and area to obtain the medicine strip region image.
4. The dimensional defect detection method according to claim 1, characterized in that: The method of using the image classification neural network model and the separated image to determine whether there are quality defects other than unqualified size includes: The image classification neural network model constructed based on the MobileNetV2 skeleton network and the separated image are used to perform deep learning operations to determine whether there are quality defects.
5. A size defect detection device, characterized in that: Used to perform the size defect detection method according to any one of claims 1 to 4, the device comprises: An image acquisition component group, the image acquisition component group includes image acquisition components; the image acquisition components are evenly distributed along the circumference of the medicine strip; A visual computer, the visual computer is communicatively connected to the image acquisition component; A PLC control system is communicatively connected with the visual computer and the image acquisition component, and is used to send detection instructions to the visual computer and receive size detection and defect detection results returned by the visual computer.
6. The size defect detection device according to claim 5, characterized in that: The detection instruction includes a system instruction protocol package, and the system instruction protocol package includes a protocol package in the form of a camera number plus letters for size detection and a protocol package in the form of a camera number plus fixed numbers plus letters for defect detection; so that the visual computer calls a single camera public program package according to the camera number contained in the system instruction protocol package to perform corresponding size detection and defect detection through the camera corresponding to the camera number.
7. The size defect detection device according to claim 5, characterized in that: The three cameras are evenly distributed on the same mounting surface along the circumference of the medicine strip at an angle of 120° between each other, and the three light sources are distributed one-to-one between two of the cameras and arranged one-to-one relative to the three cameras.
8. The size defect detection device according to claim 5, characterized in that: The image acquisition component groups include a plurality of groups, and the plurality of image acquisition component groups are arranged one by one correspondingly relative to the plurality of medicine strips.
9. A size defect detection device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the size defect detection method described in any one of claims 1-4 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the size defect detection method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Simple defect detection method and system based on object recognition
CN113920075A