Double-station online visual detection method and system
By adopting multi-threading technology and deep learning algorithms in the vision detection system, the problem of inefficient double-station visual detection is solved, and efficient and accurate double-station online detection is achieved.
Patent Information
- Application Number
- CN202411880904.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-03-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing visual detection technology is mainly suitable for online detection of single stations, and it is difficult to effectively solve the visual detection problem of dual stations, resulting in insufficiency of detection.
Using multi-threading technology and machine vision detection technology integrated with deep learning algorithms, we use two sub-threads to process the detection tasks of the two production lines separately by creating two sub-threads in the software control system, and use the culling queue to identify and eliminate unqualified products.
The independent online detection of double stations is realized, which avoids mutual interference during the detection process, improves the accuracy and efficiency of detection and identification, and reduces production costs.
Smart Images

Figure CN119619130A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of dual-station online visual inspection, and in particular to a dual-station online visual inspection method and system. Background Art
[0002] With the continuous improvement of online visual inspection technology, its application scope is also expanding, and its role in industrial automation and intelligent manufacturing is becoming more and more important. Nowadays, visual inspection technology has been widely used in many fields of manufacturing, such as home appliances, automobiles, electronics, new energy and other industries, and has become an important means to improve production efficiency and ensure product quality. The key to the dual-station visual inspection technology is how a software system can enable two production lines to be inspected independently without interfering with each other. In order to achieve this project, a multi-threaded approach is used to control the implementation process.
[0003] Visual inspection technology is an advanced technology based on computer vision and image processing. It uses machine vision products, such as industrial cameras, to convert captured targets into image signals, which are then analyzed and processed by a dedicated image processing system to achieve product detection, measurement and judgment. The principle of visual inspection technology is to collect product image information, use computer algorithms to calculate pixel distribution, brightness, color, etc., extract target features, and then compare them with preset standards to determine whether the product is qualified.
[0004] The current visual inspection technology is generally only used for online inspection at a single workstation, which has obvious limitations and seriously restricts the efficiency of online inspection. Summary of the invention
[0005] In response to the above technical problems, the present invention proposes a dual-station online visual inspection method and system, which solves the dual-station visual inspection problem through multi-threading technology and machine vision inspection technology integrated with deep learning algorithms. To a certain extent, it reduces the burden on the human eye, liberates manpower, reduces the production costs of enterprises, and improves production efficiency.
[0006] A dual-station online visual inspection method, the inspection process is as follows:
[0007] S1. Build a quick-plug and unplug interface for industrial cameras and IO control boards, and complete the initialization configuration of industrial cameras and IO control boards;
[0008] S2. Build the detection process and complete the initialization configuration of the detection signal input port and the rejection signal output port;
[0009] S3, the main thread creates two sub-threads, including sub-thread 1 and sub-thread 2, wherein sub-thread 1 is used to detect the incoming signal of station A, and initialize the product image acquisition and processing thread 3 and the product rejection processing thread 4 of station A, and sub-thread 2 is used to detect the incoming signal of station B, and initialize the product image acquisition and processing thread 5 and the product rejection processing thread 6 of station B;
[0010] S4. Establish two culling queues, complete initialization, and allocate memory space for culling data storage;
[0011] S5, after receiving the signals from the corresponding sensors 1 and 2 respectively, the sub-thread 1 and sub-thread 2 respectively obtain the corresponding threads from the corresponding image acquisition thread pool to perform photo taking and recognition and comparison processing, and push the results into the elimination queue;
[0012] S6. At the same time, the sub-thread 1 and the sub-thread 2 respectively obtain corresponding threads from the corresponding product rejection thread pool and perform rejection processing for unqualified products;
[0013] S7. Save and display the processing results, and save the photos with recognition errors locally to facilitate subsequent data query and model optimization.
[0014] 6. A dual-station online visual inspection method according to claim 1, characterized in that: in step S1, two sets of quick plug-in interfaces of color mark sensors, cameras, and light sources are constructed, so as to complete the sensor IO port configuration for the perception of incoming material signals, complete the camera initialization for the acquisition of image frames, and complete the light source port configuration for the provision of photo brightness.
[0015] As a preferred embodiment of the above technical solution, in step S2, based on the interactive initialization of the detection signal input port and the rejection signal output port, a detection and data processing process pool is constructed to detect and identify the collected image information, and the recognition result is compared with the set character, and then the rejection action is executed.
[0016] As a preferred embodiment of the above technical solution, in step S4, the two constructed reject queues are divided into reject queue 1 and reject queue 2, which are respectively used to store reject information of two production lines, wherein the reject queue is a deque double-ended queue.
[0017] As a preferred embodiment of the above technical solution, in steps S5 and S6, after receiving the signal from the color mark sensor 1, the sub-thread 1 obtains the image acquisition processing thread 3 from the image acquisition thread pool for processing, the image acquisition processing thread 3 controls the camera to take pictures, image recognition and comparison analysis, and pushes the processing result data information into the end of the rejection queue 1. At the same time, the product rejection processing thread 4 is obtained from the product rejection processing thread pool for processing, the product rejection processing thread 4 obtains and parses the head data from the rejection queue 1, determines whether to perform the rejection action, and sends a rejection signal if rejection is required;
[0018] After receiving the signal from the color mark sensor 2, the child thread 2 obtains the image acquisition processing thread 5 from the image acquisition thread pool for processing. The image acquisition processing thread 5 controls the camera to take pictures, image recognition, and comparison analysis, and pushes the processing result data information into the end of the rejection queue 2. At the same time, the product rejection processing thread 6 is obtained from the product rejection processing thread pool for processing. The product rejection processing thread 6 obtains and parses the head data from the rejection queue 2 to determine whether to perform a rejection action. If rejection is required, a rejection signal is sent.
[0019] A dual-station online visual inspection system, the system is applied to the online visual inspection method according to any one of claims 1 to 5, including a software control system and an image acquisition module, a light source control module, a signal input and output module and a human-computer interaction module respectively connected to the software control system, the image acquisition module is composed of a camera 1 and a camera 2, the light source control module is composed of a light source 1 and a light source 2, the signal input and output module is composed of a sensor 1 and a sensor 2, a rejection device 1 and a rejection device 2, and the human-computer interaction module is composed of an industrial computer and a touch display.
[0020] The beneficial effects of the present invention are:
[0021] Based on multi-threading technology and machine vision detection technology integrated with deep learning algorithms, the present invention rationally distributes the two detection processes of the software control system to two thread pools. By using multi-threading technology, the problem of mutual interference between the two production lines during the detection process is avoided. Each module of the system has high independence, which is convenient for separate use or integrated use, and is also convenient for maintenance and upgrading. The machine vision detection technology integrated with deep learning algorithms provided by the present invention effectively improves the detection and recognition accuracy, cooperates with multi-threading technology, improves the detection and recognition efficiency, and reduces production costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of the dual-station online visual inspection method.
[0023] Figure 2 This is a schematic diagram of the composition of a dual-station online visual inspection system.
[0024] Figure 3 This is a structural diagram of the software architecture of the dual-station online visual inspection system. DETAILED DESCRIPTION
[0025] The technical solution of the present invention is described clearly and completely below in conjunction with the accompanying drawings of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] like Figure 1 A dual-station online visual inspection method is shown, and the inspection process is as follows:
[0027] S1. Build a quick-plug and unplug interface for industrial cameras and IO control boards, and complete the initialization configuration of industrial cameras and IO control boards;
[0028] S2. Build the detection process and complete the initialization configuration of the detection signal input port and the rejection signal output port;
[0029] S3, the main thread creates two sub-threads, including sub-thread 1 and sub-thread 2, the sub-thread 1 is used to detect the incoming signal of station A, and initialize the product image acquisition and processing thread 3 and product rejection processing thread 4 of station A, the sub-thread 2 is used to detect the incoming signal of station B, and initialize the product image acquisition and processing thread 5 and product rejection processing thread 6 of station B, such as Figure 3 As shown;
[0030] S4. Establish two culling queues, complete initialization, and allocate memory space for culling data storage;
[0031] S5, after receiving the signals from the corresponding sensors 1 and 2 respectively, the sub-thread 1 and sub-thread 2 respectively obtain the corresponding threads from the corresponding image acquisition thread pool to perform photo taking and recognition and comparison processing, and push the results into the elimination queue;
[0032] S6. At the same time, the sub-thread 1 and the sub-thread 2 respectively obtain corresponding threads from the corresponding product rejection thread pool and perform rejection processing for unqualified products;
[0033] S7. Save and display the processing results, and save the photos with recognition errors locally to facilitate subsequent data query and model optimization.
[0034] In this embodiment, in step S1, two sets of quick plug-in interfaces of color mark sensors, cameras, and light sources are constructed, so as to complete the sensor IO port configuration for sensing incoming material signals, complete the camera initialization for acquiring image frames, and complete the light source port configuration for providing photo brightness.
[0035] Specifically, first, connect the two color mark sensors to the IO control board, install them at the color mark position of the packaging film through the color mark sensor bracket, align the color mark and adjust the sensitivity of the sensor to make it trigger the signal normally to prevent missed triggering or repeated triggering; then, connect the two industrial cameras to the USB3.0 port of the industrial computer through cables, and then install the industrial camera at the specified position through the bracket so that the lens faces the detection area to prevent unclear images from being captured; finally, build the color mark sensor and camera quick plug-in interface in the software system to complete the camera initialization configuration and sensor IO port configuration.
[0036] In this embodiment, in step S2, based on the interactive initialization of the detection signal input port and the rejection signal output port, a detection and data processing process pool is constructed to detect and identify the collected image information, and the recognition result is compared with the set character, and then the rejection action is executed.
[0037] Specifically, a main thread is constructed through the software system, and a detection process pool and a data processing process for detecting data storage are constructed, and multiple detection processes are initialized in the detection process pool.
[0038] In this embodiment, in step S4, the two constructed reject queues are divided into reject queue 1 and reject queue 2, which are respectively used to store reject information of two production lines, wherein the reject queue is a deque double-ended queue.
[0039] Specifically, by establishing two double-ended rejection queues and initializing the data in the queues to 0, it is convenient to reject transitional products at the moment of startup, and memory space for storing rejected data is allocated in advance.
[0040] In this embodiment, in steps S5 and S6, after the sub-thread 1 and sub-thread 2 receive the signals from the corresponding sensors 1 and 2 respectively, they respectively obtain the corresponding threads from the corresponding image acquisition thread pool to perform photo taking and recognition and comparison processing, and push the results into the rejection queue; at the same time, the sub-thread 1 and sub-thread 2 respectively obtain the corresponding threads from the corresponding product rejection thread pool and perform rejection processing for unqualified products.
[0041] Specifically, after receiving the signal from the color mark sensor 1, the child thread 1 obtains the image acquisition processing thread 3 from the image acquisition thread pool for processing. The image acquisition processing thread 3 controls the camera to take pictures, image recognition, and comparison analysis, and pushes the processing result data information into the end of the rejection queue 1; at the same time, the product rejection processing thread 4 is obtained from the product rejection processing thread pool for processing. The product rejection processing thread 4 obtains and parses the head data from the rejection queue 1 to determine whether to perform a rejection action. If rejection is required, a rejection signal is sent.
[0042] Specifically, after receiving the signal from the color mark sensor 2, the child thread 2 obtains the image acquisition processing thread 5 from the image acquisition thread pool for processing. The image acquisition processing thread 5 controls the camera to take pictures, image recognition, and comparison analysis, and pushes the processing result data information into the end of the rejection queue 2; at the same time, the product rejection processing thread 6 is obtained from the product rejection processing thread pool for processing. The product rejection processing thread 6 obtains and parses the head data from the rejection queue 2 to determine whether to perform a rejection action. If rejection is required, a rejection signal is sent.
[0043] It should be noted that in step S7, first, the solenoid valve control end is connected to the output end of the IO control board, and the cylinder is connected to the solenoid valve; then, when the rejection action is to be performed, the industrial computer delays for a period of time and sends a rejection signal to the IO control card; finally, the solenoid valve is controlled by the relay to attract, and the cylinder is actuated to kick out the defective products. The processing results are displayed and saved through the software system, and the images of the recognition errors are saved on the local disk of the computer to facilitate subsequent data query and model optimization.
[0044] like Figure 2 A dual-station online visual inspection system is shown, and the system is applied to the online visual inspection method described in any one of claims 1-5, including a software control system and an image acquisition module, a light source control module, a signal input and output module and a human-computer interaction module respectively connected to the software control system, the image acquisition module is composed of camera 1 and camera 2, the light source control module is composed of light source 1 and light source 2, the signal input and output module is composed of sensor 1 and sensor 2, and the rejection device 1 and rejection device 2 are composed of the human-computer interaction module. The industrial computer and the touch display are composed of.
[0045] It should be noted that in actual application, the computational load and call time of multiple threads are different. Different threads are opened for incoming signals of different production lines. This method designs a multi-level multi-threaded structure to further improve the multi-threaded work efficiency. The system can also include a power supply system, safety protection devices, alarm devices, etc., which can be increased or decreased as needed.
[0046] On the one hand, the present invention solves the problem of simultaneously recognizing characters on the surfaces of products of two high-speed production lines, and on the other hand, it reduces manpower input, cuts production costs, overcomes misjudgment caused by human factors, and improves detection accuracy and efficiency.
[0047] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A dual-station online visual inspection method, characterized in that: The detection process is as follows: S1. Build a quick-plug and unplug interface for industrial cameras and IO control boards, and complete the initialization configuration of industrial cameras and IO control boards; S2. Build the detection process and complete the initialization configuration of the detection signal input port and the rejection signal output port; S3, the main thread creates two sub-threads, including sub-thread 1 and sub-thread 2, wherein sub-thread 1 is used to detect the incoming signal of station A, and initialize the product image acquisition and processing thread 3 and the product rejection processing thread 4 of station A, and sub-thread 2 is used to detect the incoming signal of station B, and initialize the product image acquisition and processing thread 5 and the product rejection processing thread 6 of station B; S4. Establish two culling queues, complete initialization, and allocate memory space for culling data storage; S5, after receiving the signals from the corresponding sensors 1 and 2 respectively, the sub-thread 1 and sub-thread 2 respectively obtain the corresponding threads from the corresponding image acquisition thread pool to perform photo taking and recognition and comparison processing, and push the results into the elimination queue; S6. At the same time, the sub-thread 1 and the sub-thread 2 respectively obtain corresponding threads from the corresponding product rejection thread pool and perform rejection processing for unqualified products; S7. Save and display the processing results, and save the photos with recognition errors locally to facilitate subsequent data query and model optimization.
2. A dual-station online visual inspection method according to claim 1, characterized in that: In step S1, two sets of quick plug-in interfaces of color mark sensors, cameras, and light sources are constructed, so as to complete the sensor IO port configuration for sensing incoming signals, complete the camera initialization for acquiring image frames, and complete the light source port configuration for providing photo brightness.
3. A dual-station online visual inspection method according to claim 1, characterized in that: In step S2, based on the interactive initialization of the detection signal input port and the rejection signal output port, a detection and data processing process pool is constructed to detect and identify the collected image information, and the recognition result is compared with the set character, and then the rejection action is executed.
4. A dual-station online visual inspection method according to claim 1, characterized in that: In step S4, the two constructed reject queues are divided into reject queue 1 and reject queue 2, which are respectively used to store reject information of two production lines, wherein the reject queues are deque double-ended queues.
5. A dual-station online visual inspection method according to claim 1, characterized in that: In steps S5 and S6, after receiving the signal from the color mark sensor 1, the sub-thread 1 obtains the image acquisition processing thread 3 from the image acquisition thread pool for processing. The image acquisition processing thread 3 controls the camera to take pictures, image recognition and comparison analysis, and pushes the processing result data information into the end of the rejection queue 1. At the same time, the product rejection processing thread 4 is obtained from the product rejection processing thread pool for processing. The product rejection processing thread 4 obtains and parses the head data from the rejection queue 1 to determine whether to perform the rejection action. If rejection is required, a rejection signal is sent; After receiving the signal from the color mark sensor 2, the child thread 2 obtains the image acquisition processing thread 5 from the image acquisition thread pool for processing. The image acquisition processing thread 5 controls the camera to take pictures, image recognition, and comparison analysis, and pushes the processing result data information into the end of the rejection queue 2. At the same time, the product rejection processing thread 6 is obtained from the product rejection processing thread pool for processing. The product rejection processing thread 6 obtains and parses the head data from the rejection queue 2 to determine whether to perform a rejection action. If rejection is required, a rejection signal is sent.
6. A dual-station online visual inspection system, characterized in that: The system is applied to the online visual inspection method described in any one of claims 1 to 5, including a software control system and an image acquisition module, a light source control module, a signal input and output module and a human-computer interaction module respectively connected to the software control system, the image acquisition module is composed of camera 1 and camera 2, the light source control module is composed of light source 1 and light source 2, the signal input and output module is composed of sensor 1 and sensor 2, rejection device 1 and rejection device 2, and the human-computer interaction module is composed of an industrial computer and a touch display.
Citation Information
Patent Citations
Multichannel visual detection control method, system software framework and construction method
CN111069062A
Multi-station visual identification system
CN112024426A
Software system based on machine vision algorithm and construction method
CN114490092A
Six-surface visual detection system and detection method after battery film coating
CN117129479A
Machine imaging apparatus and method for detecting foreign materials
US20090080706A1