A magnet dispensing detection method
By installing Halcon software on the client, centralized dispensing inspection is realized, solving the problems of complex and high cost of dispensing inspection failure repair in the existing technology, reducing the server configuration requirements and saving costs.
Patent Information
- Application Number
- CN202411943412.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-12-27
AI Technical Summary
In the existing Halcon software-based dispensing detection method, each dispensing machine needs to be connected to a server, which leads to complex and high maintenance when detecting failures.
A magnet dispensing detection method is designed. By installing Halcon software on the client, the image taken by the dispensing machine is uploaded to the server, and the server interaction module enters the image into the Halcon neural network learning model for detection, outputs the detection results, and displays the results through the server display interface.
Simplifies the repair process when detecting faults, reduces the requirements for server configuration, and thus reduces costs.
Smart Images

Figure CN119395032B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of glue dispensing detection, and in particular to a magnet glue dispensing detection method. Background Art
[0002] In the current method of product dispensing detection based on Halcon software, each dispensing machine is connected to a server (i.e., a computer), and Halcon software is installed in each server. After taking a photo, the dispensing machine uploads the image to the server, inputs it into the Halcon software on the server, and detects the image transmitted by the dispensing machine through the neural network learning model in Halcon, and displays the detection result. In actual applications, there are multiple dispensing machines in the factory, and each dispensing machine is connected to a server. Therefore, there are multiple servers. If a fault occurs during the detection, it is necessary to find the server with the problem and then repair it, which is more troublesome. In addition, since the image needs to be detected, the configuration of each server is high, so the cost is high. Summary of the invention
[0003] The object of the present invention is to provide a magnet dispensing detection method, which is convenient for repair when image detection fails and saves costs.
[0004] To achieve the above object, the solution of the present invention is:
[0005] A magnet dispensing detection method relates to a detection system, which includes a client, multiple server ends and multiple dispensing machines, each server end is connected to the client end in communication, each server end is connected to a dispensing machine in communication, the client end is installed with Halcon software, the server end has a server end interaction module, the client end has a client end interaction module, and the server end interaction module and the client end interaction module can interact with each other, including the following steps:
[0006] S10: The glue dispensing machine is used to take photos after dispensing glue on the magnet and upload the images to the corresponding server;
[0007] S20: The server-side interaction module is used to obtain the image from the dispensing machine and transmit the image to the client-side interaction module. The client-side interaction module is used to input the image from the server into the trained neural network learning model in Halcon to detect the image and output the detection result category of NG or OK, NG for unqualified glue type and OK for qualified glue type;
[0008] S30: The client interaction module obtains the detection result category and transmits it back to the server interaction module. The server has a display interface that can display the detection result category transmitted to the server.
[0009] Furthermore, the Qtcreator framework is installed on both the client and the server, and the server interaction module and the client interaction module are two interaction modules edited under the Qtcreator framework.
[0010] Furthermore, in step S20, the following steps are also included:
[0011] S21: After the image is transmitted to the client, the client interaction module inputs the image into Halcon, thereby adjusting the resolution of the image so that the resolution of the image is the same as the resolution of the sample image trained by the neural network learning model in Halcon;
[0012] S22: A main function is established in the Qtcreator of the client, and the main function is used to digitize the image processed in step S21 by traversing each value on the image using the Halcon library function;
[0013] S23: There is a detection template in the client's Qtcreator. The detection template is used to connect to the neural network learning model trained in Halcon. The digitized image is input into the detection template, so that the digitized image is detected by the neural network learning model and outputs a value representing the NG or OK detection result category and the corresponding confidence level. The confidence level is the similarity between the detection image and the learning sample image in the training neural network learning model.
[0014] Furthermore, a sub-function is established in the Qtcreator of the client, which can draw the shape and color of the detection box at the glue dispensing position of the image processed in step S21, and the sub-function can also receive the numerical value representing NG or OK output by the neural network learning model, and display the detection box and the categories of OK and NG.
[0015] Furthermore, a confidence threshold is set in the client's Qtcreator. By comparing the confidence of the image output by the neural network learning model in step S23 with the confidence threshold, a value greater than the confidence threshold is defined as a positive sample, that is, it is considered that the target in the detection box is one of the two OK or NG targets, and a value less than the confidence threshold is defined as a negative sample, that is, it is considered that the target in the detection box is not one of the known OK or NG targets.
[0016] Furthermore, in step S23, in order to use the syntax and parameters of Halcon, the Halcon library function is installed in the client Qtcreator directory, the Halcon parameters that need to be called in the detection template are pre-defined according to the name, and then the parameters with the corresponding names of the Halcon neural network learning model are assigned to the parameters defined in the detection template to connect the detection template with the neural network learning model trained in Halcon.
[0017] Further, in step S30, a display interface is set in the server-side Qtcreator, and the server-side interaction module receives the image with the detection result category and transmits it to the display interface for display.
[0018] After adopting the above scheme, the beneficial effects of the present invention are:
[0019] The present invention is provided with a client, which is communicatively connected to multiple servers at the same time. Halcon software is only installed on the client. After the images taken by the dispensing machine are uploaded to the corresponding server, they are transmitted to the client through the server interaction module. The images are input into the Halcon neural network learning model through the client interaction module for detection, and the detection result category of NG or OK is output. The client interaction module obtains the detection result category and transmits it back to the server interaction module. The server has a display interface, which can display the detection result category transmitted to the server. The present invention only performs image detection in the client. Therefore, when a fault occurs during detection, the maintenance personnel only need to perform maintenance in the client, which is more convenient. Since the detection is only performed on the client, the configuration requirements for the server can be reduced to reduce the cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0021] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] like Figure 1 As shown, this embodiment provides a magnet dispensing detection method, which involves a detection system. The detection system includes a client, multiple server ends and multiple dispensing machines. Each server end is connected to the client end for communication. Each server end is connected to a dispensing machine for communication. The client end is installed with Halcon software, the server end has a server end interaction module, and the client end has a client end interaction module. The server end interaction module and the client end interaction module can interact with each other, and the following steps are included:
[0023] S10: The glue dispensing machine is used to take photos after dispensing glue on the magnet and upload the images to the corresponding server;
[0024] S20: The server-side interaction module is used to obtain the image from the dispensing machine and transmit the image to the client-side interaction module. The client-side interaction module is used to input the image from the server into the trained neural network learning model in Halcon to detect the image and output the detection result category of NG or OK, NG for unqualified glue type and OK for qualified glue type;
[0025] S30: The client interaction module obtains the detection result category and transmits it back to the server interaction module. The server has a display interface that can display the detection result category transmitted to the server.
[0026] It is understandable that after the neural network learning model detects the image, it at least outputs the detection result category of NG or OK.
[0027] The present invention is provided with a client, which is communicatively connected to multiple servers at the same time. Halcon software is only installed on the client. After the images taken by the dispensing machine are uploaded to the corresponding server, they are transmitted to the client through the server interaction module. The images are input into the neural network learning model in Halcon through the client interaction module for detection, and the detection result category of NG or OK is output. The client interaction module obtains the detection result category and transmits it back to the server interaction module. The server has a display interface, which can display the detection result category transmitted to the server. The present invention only performs image detection in the client. Therefore, when a fault occurs during detection, the maintenance personnel only need to perform maintenance in the client, which is more convenient. Since the detection is only performed on the client, the configuration requirements for the server can be reduced to reduce the cost.
[0028] Specifically, the client and the server establish a connection, and each server sets an IP address in the same network segment as the client, and communicates with each other through the TCP protocol.
[0029] Specifically, Halcon, as a commercial vision software, has powerful functions, rich built-in algorithm libraries, good two-dimensional and three-dimensional image processing effects, and can realize various industrial automatic detections. The present invention uses this software platform to design a training method for a training set and an image detection method. It can be understood that Halcon has a neural network learning model, and training the neural network learning model to make it converge is a conventional technical means, which is not limited here.
[0030] Specifically, the Qtcreator framework is installed on both the client and the server, and the server interaction module and the client interaction module are two interaction modules edited under the Qtcreator framework;
[0031] Specifically, Qtcreator (Qt for short) is developed by Qt company and can be applied across platforms. It is a graphical user interface framework compiled based on C++. It is an object-oriented framework with rich APIs and high integration. These features make it more convenient when working with Halcon and calling detection models.
[0032] Furthermore, in step S20, the following steps are also included:
[0033] S21: After the image is transmitted to the client, the client interaction module inputs the image into Halcon, thereby adjusting the image resolution to make the image resolution the same as the resolution of the sample image trained by the neural network learning model in Halcon; and it is also necessary to use image processing modes such as sharpening and contrast enhancement to highlight features for easy detection; further, it is necessary to select a GPU or CPU, set the model and temperature of the GPU or CPU, and set the number of images to be detected, and then let the GPU or CPU read the neural network learning model of Halcon;
[0034] S22: A main function is established in the Qtcreator of the client, and the main function is used to digitize the image processed in step S21 by traversing each value on the image using the Halcon library function;
[0035] S23: There is a detection template in the client's Qtcreator. The detection template is used to connect to the neural network learning model trained in Halcon. The digitized image is input into the detection template, so that the digitized image is detected by the neural network learning model and outputs a value representing the NG or OK detection result category and the corresponding confidence level. The confidence level is the similarity between the detection image and the learning sample image in the training neural network learning model.
[0036] Specifically, a sub-function is established in the Qtcreator of the client, which can draw the shape and color of the detection box at the glue dispensing position of the image processed in step S21, and the sub-function can also receive the numerical value representing NG or OK output by the neural network learning model, and display the detection box and the categories of OK and NG.
[0037] Specifically, in order to filter out redundant detection frames, a confidence threshold is set in the client's Qtcreator. By comparing the confidence of the image output by the neural network learning model in step S23 with the confidence threshold, a value greater than the confidence threshold is defined as a positive sample, that is, the detection frame is considered to be one of the two targets, OK or NG. A value less than the confidence threshold is defined as a negative sample, that is, the target in the detection frame is not considered to be one of the known OK or NG targets.
[0038] Specifically, in step S23, in order to use the syntax and parameters of Halcon, the Halcon library function is installed in the client Qtcreator directory, the Halcon parameters that need to be called in the detection template are pre-defined according to the name, and then the parameters with the corresponding names of the Halcon neural network learning model are assigned to the parameters defined in the detection template to connect the detection template with the neural network learning model trained in Halcon.
[0039] Specifically, in step S30, the display interface is set in the server-side Qtcreator, and the server-side interaction module receives the image with the detection result category and transmits it to the display interface for display.
[0040] Specifically, the above-mentioned Halcon refers to Halcon software, and Qtcreator refers to Qtcreator framework.
[0041] The above description is only a preferred embodiment of the present invention and is not a limitation on the design of this case. Any equivalent changes made based on the design key of this case shall fall within the protection scope of this case.
Claims
1. A magnet dispensing detection method, involving a detection system, the detection system includes a client, multiple server ends and multiple dispensing machines, each server end is connected to the client end in communication, each server end is connected to a dispensing machine in communication, the client end is installed with Halcon software, the server end has a server end interaction module, the client end has a client end interaction module, the server end interaction module and the client end interaction module can interact with each other, and the characteristics are: The following steps are involved: S10: The glue dispensing machine is used to take photos after dispensing glue on the magnet and upload the images to the corresponding server; S20: The server-side interaction module is used to obtain the image from the dispensing machine and transmit the image to the client-side interaction module. The client-side interaction module is used to input the image from the server into the trained neural network learning model in Halcon to detect the image and output the detection result category of NG or OK, NG for unqualified glue type and OK for qualified glue type; S30: The client interaction module obtains the detection result category and transmits it back to the server interaction module. The server has a display interface that can display the detection result category transmitted to the server; The Qtcreator framework is installed on both the client and the server. The server interaction module and the client interaction module are two interaction modules edited under the Qtcreator framework. In step S20, the following steps are also included: S21: After the image is transmitted to the client, the client interaction module inputs the image into Halcon, thereby adjusting the resolution of the image so that the resolution of the image is the same as the resolution of the sample image trained by the neural network learning model in Halcon; S22: A main function is established in the Qtcreator of the client, and the main function is used to digitize the image processed in step S21 by traversing each value on the image using the Halcon library function; S23: There is a detection template in the client's Qtcreator. The detection template is used to connect the neural network learning model trained in Halcon. The digitized image is input into the detection template, so that the digitized image is detected by the neural network learning model and outputs a value representing the NG or OK detection result category and the corresponding confidence level. The confidence level is the similarity between the detection image and the learning sample image in the training neural network learning model. A sub-function is established in the Qtcreator of the client, and the sub-function can draw the shape and color of the detection frame at the dispensing position of the image processed in step S21, and the sub-function can also receive the value representing NG or OK output by the neural network learning model, and display the detection frame and the categories of OK and NG; A confidence threshold is set in the client's Qtcreator. The confidence of the image output by the neural network learning model in step 23 is compared with the confidence threshold. A value greater than the confidence threshold is defined as a positive sample, that is, it is considered that the detection box is one of the two targets OK or NG. A value less than the confidence threshold is defined as a negative sample, that is, it is considered that the target in the detection box is not one of the known OK or NG targets. In step 23, in order to use Halcon's syntax and parameters, Halcon's library functions are installed in the client's Qtcreator directory, the Halcon parameters that need to be called in the detection template are pre-defined by name, and then the parameters with corresponding names of Halcon's neural network learning model are assigned to the parameters defined in the detection template to connect the detection template with the neural network learning model trained in Halcon.
2. A magnet dispensing detection method as claimed in claim 1, characterized in that: In step S30, a display interface is set in the server-side Qtcreator, and the server-side interaction module receives the image with the detection result category and transmits it to the display interface for display.
Citation Information
Patent Citations
Battery monomer flexible connector detection system and point inspection method
CN117890377A
Intelligent detection system for glue dispensing defect of lens
CN118090752A