Glass picture detection method and related device

By dividing the glass into multiple detection areas and configuring an adaptive detection algorithm, and combining multi-threading technology for defect detection, the problem of insufficient glass detection efficiency and accuracy in the prior art is solved, and efficient and accurate glass defect detection is achieved.

CN120163755APending Publication Date: 2025-06-17SKYVERSE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311682648.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-07
Publication Date
2025-06-17

Smart Images

  • Figure CN120163755A_ABST
    Figure CN120163755A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a detection method of a glass picture, which is used for improving the detection efficiency of glass and the detection accuracy of defects in the glass. The method provided by the embodiment of the invention comprises the following steps: acquiring to-be-detected glass and the type of the glass; dividing the glass to be detected into a plurality of areas to be detected; aiming at the type of the glass, configuring an adaptive detection algorithm for each to-be-detected area in the plurality of to-be-detected areas; detecting defects in the plurality of to-be-detected areas by adopting multiple threads to obtain a defect detection result of each to-be-detected area; and merging the defect detection results of the plurality of to-be-detected areas, and obtaining the defect detection result of the to-be-detected glass according to the merged defect detection result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and related device for detecting glass pictures. Background Art

[0002] Flat glass products are widely used in all aspects of life. From large glass doors and windows, automotive windshields to small mobile phone screens, backplates and watch surfaces, they all belong to flat glass products. Due to the physical and chemical properties of flat glass itself, flat glass is prone to damage during the production and transportation process, resulting in various defects. As a light-transmitting component, the defects of flat glass will greatly affect the user experience.

[0003] At present, during the glass detection process, it is generally necessary to complete the rapid detection of glass pictures within 3 seconds. Moreover, during the glass detection process, various types of glass are involved. Therefore, how to improve the detection efficiency of glass and the accuracy of glass detection is an urgent problem to be solved. Summary of the Invention

[0004] Embodiments of the present invention provide a method and related device for detecting glass pictures, which are used to cut the glass to divide the glass into multiple detection areas, and configure an appropriate detection algorithm for each piece of glass according to the type of glass, thereby improving the detection efficiency of glass and the accuracy of defect detection in glass.

[0005] The first aspect of the embodiments of the present application provides a method for detecting glass pictures, including:

[0006] Obtain the glass to be detected and the type of the glass;

[0007] Divide the glass to be detected into multiple areas to be detected;

[0008] For the type of the glass, configure an appropriate detection algorithm for each area to be detected among the multiple areas to be detected;

[0009] Use multi-threading to detect the defects in the multiple areas to be detected to obtain the defect detection results of each area to be detected;

[0010] Merge the defect detection results of the multiple areas to be detected, and obtain the defect detection result of the glass to be detected according to the merged defect detection result.

[0011] The second aspect of the embodiments of the present application provides a device for detecting glass pictures, including:

[0012] An acquisition unit, configured to obtain the glass to be detected and the type of the glass;

[0013] Partitioning unit, configured to partition the glass to be detected into a plurality of regions to be detected;

[0014] Configuration unit, configured to configure an adapted detection algorithm for each of the plurality of regions to be detected according to the type of the glass;

[0015] Detection unit, configured to detect defects in the plurality of regions to be detected by using multi-threading, so as to obtain defect detection results of each region to be detected;

[0016] Merging unit, configured to merge the defect detection results of the plurality of regions to be detected, and obtain a defect detection result of the glass to be detected according to the merged defect detection result.

[0017] A third aspect of the embodiments of the present application provides a computer device, including a processor, which, when executing a computer program stored in a memory, is configured to implement the method for detecting a glass picture provided in the first aspect of the embodiments of the present application.

[0018] A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is configured to implement the method for detecting a glass picture provided in the first aspect of the embodiments of the present application.

[0019] As can be seen from the above technical solutions, the embodiments of the present invention have the following advantages:

[0020] In the embodiments of the present application, in order to improve the detection efficiency and accuracy of the glass, the glass is first partitioned into a plurality of detection regions, and an adapted detection algorithm is configured for each detection region, and then defects in the plurality of detection regions are simultaneously detected by using multi-threading, so as to improve the detection efficiency of the glass and also improve the accuracy of detecting defects in the glass on the premise of improving the detection efficiency of the glass. Description of the Drawings

[0021] Figure 1 It is a schematic diagram of an embodiment of the method for detecting a glass picture in the embodiments of the present application;

[0022] Figure 2 It is a logical architecture diagram of the detection unit in the embodiments of the present application;

[0023] Figure 3 It is a refined step of step 104 in the embodiments of the present application;

[0024] Figure 4 It is another refined step of step 104 in the embodiments of the present application;

[0025] Figure 5 It is a schematic diagram of the process of an embodiment for training a defect detection model for a target detection region in the embodiments of the present application;

[0026] Figure 6 This is a schematic diagram of an embodiment of the detection device for glass pictures in the embodiments of the present application. Specific embodiments

[0027] The embodiments of the present invention provide a method and related device for detecting glass pictures, which are used to cut the glass to divide the glass into multiple detection areas, and configure an appropriate detection algorithm for each piece of glass according to the type of glass, thereby improving the detection efficiency of the glass and the accuracy of defect detection in the glass.

[0028] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

[0029] The terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order different from that shown or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0030] For the convenience of understanding, the detection method of glass pictures in the embodiments of the present application will be described below. Please refer to Figure 1 , an embodiment of the detection method of glass pictures in the present application, includes:

[0031] 101. Obtain the glass to be detected and the type of the glass;

[0032] Because the possible defects of each type of glass may be different during detection. For example, some glasses are prone to scratches, while some glasses are prone to local protrusions or depressions. Therefore, when detecting glass in the present application, different detection strategies can be configured for each piece of glass according to the type of glass, thereby improving the accuracy of defect detection in each type of glass.

[0033] 102. Divide the glass to be detected into multiple areas to be detected;

[0034] When detecting glass, in order to improve the detection efficiency of glass, the glass can be divided into multiple regions to be detected, such as edge regions, midline regions, and corner regions. The edge regions can be further divided into left edges, right edges, upper edges, and lower edges. The left edge region can be further divided into a flat left edge region and an uneven left edge region. The specific region division can be configured according to specific detection strategies, and the method of dividing the regions to be detected for the glass is not specifically limited here.

[0035] 103. For the type of the glass, configure an appropriate detection algorithm for each region to be detected among the multiple regions to be detected;

[0036] Because for different types of glass, different defects may appear in different regions, and different defects are suitable for different detection algorithms, so this application can configure an appropriate detection algorithm for each region to be detected among the multiple regions to be detected according to the specific type of glass. Here, the configuration can be an automated configuration or receiving a manual configuration, etc., and the process of the configuration is not specifically limited here.

[0037] 104. Use multi-threading to detect the defects in the multiple regions to be detected to obtain the defect detection results of each region to be detected;

[0038] After completing the configuration of the detection algorithm for each region to be detected, in order to improve the detection efficiency of the glass, this application uses multi-threading to detect the defects in the regions to be detected to obtain the defect detection effects of each region to be detected.

[0039] Specifically, because multi-threading processing can have the following benefits:

[0040] Multi-threading can execute the detection tasks of multiple regions to be detected simultaneously, thereby improving the running efficiency of the program;

[0041] Multi-threading can also make full use of CPU and memory resources to improve the resource utilization rate of the system;

[0042] Multi-threading can also enable the program to continue to execute the detection tasks of other regions to be detected when waiting for the detection tasks of some regions to be detected, thereby improving the response speed of the program.

[0043] 105. Merge the defect detection results of the multiple regions to be detected, and obtain the defect detection result of the glass to be detected according to the merged defect detection result.

[0044] Since the detection result of a piece of glass needs to synthesize the detection results of multiple regions to be detected, after obtaining the detection results of multiple regions to be detected in this application, it is also necessary to merge the defect detection results of multiple regions to be detected, and based on the merged defect detection results, obtain the defect detection result of the glass to be detected.

[0045] In the embodiments of this application, in order to improve the detection efficiency and accuracy of glass, the glass is first divided into multiple regions to be detected, and an adapted detection algorithm is configured for each region to be detected. Then, multiple threads are used to simultaneously detect the defects in multiple regions to be detected, thereby improving the detection efficiency of the glass and also improving the accuracy of detecting glass defects.

[0046] Based on Figure 1 the above embodiments, step 104 will be described in detail below:

[0047] Specifically, when using multiple threads to detect the defects in multiple regions to be detected, it can be to first detect whether there are multiple messages (such as messages for detecting the defects in the regions to be detected). If there are multiple messages, then create multiple target threads corresponding to the multiple messages, and each of the multiple target threads calls the adapted detection algorithm to detect the defects in the multiple regions to be detected, so as to obtain the defect detection results of the multiple regions to be detected. Among them, the association relationship between the region to be detected identifier, the target thread identifier, and the detection algorithm is stored in each message.

[0048] As an optional embodiment, this application can use the detection unit to detect the defects in multiple regions to be detected by using multiple threads. Among them, the detection unit in this application includes a thread configuration module and a thread management module. The thread configuration module is used to configure the upper limit number, the reserved number of thread objects in the thread management module, and the association relationship between the thread objects and the message objects. The thread management module includes a thread object sub-module, a thread monitoring sub-module, a message management sub-module, and a result management sub-module. The thread object sub-module is used to store thread objects. The thread monitoring sub-module is used to monitor the running state of the thread objects. The message management sub-module includes a message sub-module, and the message sub-module is used to store messages. The result management sub-module is used to store the execution results of each message. For ease of understanding, Figure 2 the logical architecture diagram of the detection unit in this application is given.

[0049] As an alternative embodiment, when the message management sub-module detects that there are multiple messages stored in the message sub-module, it triggers the thread object sub-module to create multiple target threads corresponding to the multiple messages, and the multiple target threads respectively call the adapted detection algorithms to detect the defects in multiple regions to be detected, so as to obtain the defect detection results of the multiple regions to be detected, where the association relationship between the region to be detected identifier, the target thread identifier, and the detection algorithm identifier is stored in each message.

[0050] It is easy to understand that generally, the association relationship between the region to be detected, the target thread, and the detection algorithm can be obtained from the attributes of the message.

[0051] For easy understanding, the following is an example:

[0052] Suppose the first message stores the region to be detected 1, the target thread 2, and the detection algorithm 3. When the message management sub-module detects the first message, it triggers the thread object module to create the target thread 2, and uses the target thread 2 to call the detection algorithm 3 to obtain the message execution result of the region to be detected.

[0053] Furthermore, in order to manage and store the data in the message execution result, the present application also sets up a data object sub-module in the result management sub-module, where the data object sub-module is used to store the data objects of the execution results of each message, so as to display the defect detection data in the data object.

[0054] When the message in the message sub-module is a non-initialized message, generally, it is also necessary to judge whether the message result data of the message contains the information for triggering the creation of a thread object from the message result data stored in the data object, that is, to judge whether the current message can create a target thread. If the data object does not contain the message result data, it is promoted that the target thread creation fails. If the data object includes the message result data, it triggers the thread object module to create a target thread corresponding to the message, and continues to process the message.

[0055] In the embodiment of the present application, the thread configuration module and the thread management module in the detection unit are used. Among them, the thread management module further uses the thread object sub-module, the thread monitoring sub-module, the message management sub-module, and the result management sub-module to enable multiple messages (that is, multiple tasks) to be executed simultaneously. On the one hand, it ensures the efficiency of task execution, and on the other hand, it also ensures the accuracy of task execution.

[0056] Based on Figure 2In the architecture diagram shown, when the embodiments of the present application use multiple threads to detect defects in multiple detection regions, the messages are further divided into upper-layer messages and lower-layer messages (where the message level can be identified in the attributes of the message. Here, the upper-layer message in the present application is the first-layer message, and the lower-layer message is a non-first-layer message. The level of the message can be customized according to user needs, such as 2, 3, 4... n layers, etc.). When the message is an upper-layer message, a first processing strategy is used to process the upper-layer message, and when the message is a lower-layer message, a second processing strategy is used to process the lower-layer message, so as to ensure that each message (each detection task) can be processed normally without being discarded, thereby improving the success rate and accuracy of defect detection.

[0057] I. When the message is an upper-layer message:

[0058] Please refer to Figure 3 , Figure 3 which is a detailed step of step 104:

[0059] 301. If the message is an upper-layer message, create a first target thread corresponding to the upper-layer message, and the first target thread calls an adapted detection algorithm to detect the defects in the area to be detected;

[0060] As an optional embodiment, it can be that when the message management sub-module recognizes that the message is an upper-layer message, it triggers the thread object sub-module to create a first target thread corresponding to the upper-layer message, and the first target thread calls an adapted detection algorithm to detect the defects in the area to be detected.

[0061] 302. Monitor the running state of the first target thread;

[0062] Furthermore, in order to ensure the normal operation of the first target thread and prevent it from being stuck, the embodiments of the present application also set up a thread monitoring sub-module in the detection module, and use the thread monitoring sub-module to monitor the running state of the first target thread.

[0063] Specifically:

[0064] When the thread monitoring sub-module monitors the first target thread, it monitors whether the first target thread outputs the execution result of the defect detection message. If so, it means that the first target thread has ended its normal operation, and then the first target thread is removed from the thread monitoring sub-module. If the first target thread does not output the execution result of the defect detection message, it further determines whether the first target thread is abnormal (such as running abnormally, or software running abnormally or algorithm call abnormally, etc.). If the first target thread is abnormal, it determines whether the upper-layer message belongs to the last-level message. If the upper-layer message belongs to the last-level message, it prompts to output the abnormality. If the upper-layer message does not belong to the last-level message, it pushes the upper-layer message into the lower-layer message queue to wait for further processing.

[0065] If the first target thread is normal, continue to monitor the first target thread until the first target thread outputs the execution result of the defect detection message.

[0066] 303. If the first target thread outputs the execution result of the defect detection message, determine whether the execution result has ended;

[0067] If the first target thread outputs the execution result of the defect detection message, further determine whether the execution result has ended (that is, whether further processing is required). If it has not ended (that is, further processing is required), execute step 304. If no further processing is required, that is, it has ended, execute step 305.

[0068] 304. Take the execution result as a new message;

[0069] If the execution result of the defect detection message requires further processing, store the execution result of the defect detection message as a new message, or push the new message into the message sub-module to wait for further processing.

[0070] 305. End the processing flow of the first target thread.

[0071] If the execution result of the defect detection message does not require further processing, end the processing flow.

[0072] II. When the message is a lower-layer message:

[0073] 401. If the message is a lower-layer message, determine whether the current computing resource is greater than the preset threshold;

[0074] As an optional embodiment, it can be that when the message management sub-module identifies that the message is a lower-layer message, it determines whether the current computing resource is greater than the preset threshold. For example, it determines whether the CPU occupancy rate and the memory occupancy rate are greater than 50%. If it is greater than 50%, it determines that the current computing resource is insufficient. If it is not greater than 50%, it determines that the computing resource is sufficient.

[0075] If the current computing resources are sufficient, step 402 is executed; otherwise, the lower-layer message processing waiting state is controlled.

[0076] 402. Create a second target thread corresponding to the lower-layer message, and the second target thread calls an adapted detection algorithm to detect defects in the area to be detected;

[0077] If the current computing resources are sufficient, create a second target thread corresponding to the lower-layer message, and the second target thread calls an adapted detection algorithm to detect defects in the area to be detected.

[0078] As an optional embodiment, when creating the second target thread, it may be triggering the thread object sub-module to create the second target thread.

[0079] In the embodiments of the present application, messages are divided into upper-layer messages and lower-layer messages. When the upper-layer message is not successfully processed, the upper-layer message is pushed into the lower-layer message queue, so that the lower-layer message can be processed again when the computing resources are sufficient, thereby ensuring the integrity of the detection data in the detection area, that is, improving the success rate of detecting the detection area.

[0080] 403. Monitor the running state of the second target thread;

[0081] Furthermore, in order to ensure the normal operation of the second target thread and prevent it from being stuck, the embodiments of the present application can also monitor the running state of the second target thread.

[0082] As an optional embodiment, it may be using the thread monitoring sub-module to monitor the running state of the second target thread.

[0083] Specifically, the process of the thread monitoring sub-module monitoring the running state of the second target thread is as follows:

[0084] The thread monitoring sub-module monitors whether the second target thread outputs the execution result of the defect detection message. If the execution result of the defect detection message is output, the detection of the second target thread ends, that is, the second target thread is pushed out of the thread monitoring sub-module. If the execution result of the defect detection message is not output, it is further determined whether the second target thread is abnormal (operation timeout, software exception or algorithm exception). If the second target thread is abnormal, the processing flow of the second target thread ends. If the second target thread is normal, continue to monitor the second target thread until the second target thread outputs the execution result of the defect detection message.

[0085] 404. If the second target thread outputs the execution result of the defect detection message, determine whether the execution result has ended;

[0086] If the second target thread outputs the execution result of the defect detection message, determine whether the execution result has ended, that is, determine whether the execution result needs further processing. If further processing is required, execute step 405; if no further processing is required, execute step 406.

[0087] 405. Use the execution result as a new message.

[0088] If the execution result of the defect detection message needs further processing, store the execution result as a new message, or push the new message into the message sub-module to wait to be processed again.

[0089] 406. End the processing flow of the second target thread.

[0090] If the execution result of the defect detection message does not need further processing, directly end the processing flow of the second target thread.

[0091] In the embodiments of the present application, when using multiple threads to process detection tasks (each detection task is represented by at least one message) in the detection area, the messages in each thread are divided into upper-layer messages and lower-layer messages. When the message belongs to the upper-layer message, if the message is not successfully processed, the upper-layer message is pushed into the lower-layer message queue to wait to be processed again. When the message is a lower-layer message, if the computing resources are sufficient, the target thread is called again to process the lower-layer message, thereby improving the success rate of the detection task and also improving the accuracy of the detection task.

[0092] For Figure 1 the above-described embodiments, before executing step 104, the following steps may also be executed to ensure the success rate of detecting each type of glass. Please refer to Figure 5 :

[0093] 501. Determine whether there is a target detection algorithm adapted to the target detection area among the multiple detection areas, where the target detection area is any one of the multiple detection areas;

[0094] For each type of glass, there may be an inadaptable detection algorithm. Therefore, when configuring detection algorithms for multiple detection areas, it can be first determined whether there is a target detection algorithm adapted to the target detection area among the multiple detection areas. If not, execute step 502.

[0095] 502. Collect the corresponding training sample set in the defect library for the target detection area.

[0096] If there is no object detection algorithm for the target detection area, corresponding training sample sets can be collected from the defect library for the target detection area. The defect library can receive defect sets (i.e., training sample sets) manually collected for the target area.

[0097] 503. Use the training sample set to train a defect detection model to obtain a defect detection model for detecting the target detection area.

[0098] After obtaining the training sample set, use the training sample set to train a defect detection model to obtain a defect detection model adapted to the target detection area. The defect detection model includes, but is not limited to, a convolutional neural network model, an attention neural network model, etc., and no specific limitation is made here.

[0099] 504. Use the defect detection model to detect defects in the target detection area.

[0100] After obtaining the trained defect detection model, the defect detection model can be used to detect defects in the target detection area.

[0101] In the embodiments of the present application, when there is no detection algorithm applicable to the target detection area, for the target area, a training sample set of this area can be collected, and the defect detection model can be trained using the training sample set, so as to obtain a defect detection model for the target detection area. Finally, the defect detection model is used to detect defects in the target detection area. That is, the embodiments of the present application can collect a training sample set for a different area and perform defect detection model training. The number of training sample sets in this different area is relatively small, which can improve the training speed on the one hand, and on the other hand, the trained defect detection model can detect the target detection area, which also improves the accuracy of defect detection in the target detection area.

[0102] The above has described in detail the detection method for glass pictures in the embodiments of the present application. Next, the detection device for glass pictures in the embodiments of the present application will be described. Please refer to Figure 6 , an embodiment of the detection device for glass pictures in the embodiments of the present application includes:

[0103] An acquisition unit 601, configured to acquire the glass to be detected and the type of the glass.

[0104] A division unit 602, configured to divide the glass to be detected into multiple regions to be detected.

[0105] A configuration unit 603, configured to configure an adapted detection algorithm for each region to be detected among the multiple regions to be detected according to the type of the glass.

[0106] The detection unit 604 is configured to detect defects in the multiple areas to be detected by using multiple threads, so as to obtain the defect detection results of each area to be detected;

[0107] The merging unit 605 is configured to merge the defect detection results of the multiple areas to be detected, and obtain the defect detection result of the glass to be detected according to the merged defect detection results.

[0108] Preferably, the detection unit 604 includes a thread configuration module and a thread management module;

[0109] The thread configuration module is configured to configure the upper limit number, the reserved number of thread objects in the thread management module, and the association relationship between the thread objects and the message objects;

[0110] The thread management module includes a thread object sub-module, a thread monitoring sub-module, a message management sub-module, and a result management sub-module;

[0111] The thread object sub-module is used to store thread objects;

[0112] The thread monitoring sub-module is used to monitor the running status of thread objects;

[0113] The message management sub-module includes a message sub-module, and the message sub-module is used to store messages;

[0114] The result management sub-module is used to store the execution results of each message.

[0115] Specifically, the detection unit 604 is configured to:

[0116] When the message management sub-module detects that there are multiple messages stored in the message module, the thread object sub-module is triggered to create multiple target threads corresponding to the multiple messages, and the multiple target threads respectively call adapted detection algorithms to detect defects in the multiple areas to be detected, so as to obtain the defect detection results of the multiple areas to be detected, where each message stores the association relationship between the area to be detected identifier, the target thread identifier, and the detection algorithm identifier.

[0117] Preferably, the result management sub-module further includes a data object sub-module, where the data object sub-module is used to store the data objects of the execution results of each message;

[0118] The apparatus further includes:

[0119] The judgment unit 606 is configured to judge whether the data object contains information for triggering the creation of a thread object according to the data object in the data object sub-module;

[0120] If so, trigger the thread object sub-module to create a target thread corresponding to the message;

[0121] If not, prompt that the creation of the target thread fails.

[0122] Preferably, the message includes an upper-layer message and a lower-layer message;

[0123] The detection unit 604 is specifically configured to:

[0124] When the message management sub-module detects a message for defect detection in the to-be-detected area stored in the message sub-module, identify the category of the message according to the attribute information of the message;

[0125] If the message belongs to an upper-layer message, adopt a first processing strategy to process the message for defect detection in the to-be-detected area to obtain an execution result of the defect detection message;

[0126] If the message belongs to a lower-layer message, adopt a second processing strategy to process the message for defect detection in the to-be-detected area to obtain an execution result of the defect detection message, wherein the first processing strategy allows pushing the upper-layer message into the lower-layer message queue when the processing of the upper-layer message is abnormal, and the second processing strategy ends the processing flow when the processing of the lower-layer message is abnormal.

[0127] Preferably, if the message belongs to an upper-layer message, the detection unit 604 is specifically configured to:

[0128] If the message management sub-module identifies the message as an upper-layer message, trigger the thread object sub-module to create a first target thread corresponding to the upper-layer message, and the first target thread calls an adapted detection algorithm to detect the defects in the to-be-detected area;

[0129] Trigger the thread monitoring sub-module to monitor the running state of the first target thread;

[0130] If the first target thread outputs an execution result of the defect detection message, determine whether the execution result has ended;

[0131] If it has not ended, push the execution result as a new message into the message sub-module;

[0132] If it has ended, end the processing flow of the first target thread.

[0133] Preferably, the detection unit 604 is specifically configured to:

[0134] Trigger the thread monitoring sub-module to monitor whether the first target thread outputs the execution result of the defect detection message;

[0135] If the execution result of the defect detection message is output, then push the first target thread out of the thread monitoring sub-module;

[0136] If the execution result of the defect detection message is not output, then determine whether the first target thread is abnormal;

[0137] If the first target thread is abnormal, then determine whether the upper-layer message belongs to the message of the last level;

[0138] If the upper-layer message belongs to the message of the last level, then prompt to output an exception;

[0139] If the upper-layer message does not belong to the message of the last level, then push the upper-layer message into the lower-layer message queue;

[0140] If the first target thread is normal, then continue to monitor the first target thread until the first target thread outputs the execution result of the defect detection message.

[0141] Preferably, if the message belongs to the lower-layer message, the detection unit 604 is specifically used for:

[0142] If the message management module identifies the message as a lower-layer message, then determine whether the current computing resource is greater than the preset threshold;

[0143] If so, trigger the thread object sub-module to create a second target thread corresponding to the lower-layer message, and the second target thread calls an adapted detection algorithm to detect the defects in the area to be detected;

[0144] Trigger the thread monitoring sub-module to monitor the running state of the second target thread;

[0145] If the second target thread outputs the execution result of the defect detection message, then determine whether the execution result has ended;

[0146] If it has not ended, then push the execution result as a new message into the message sub-module;

[0147] If it has ended, then end the processing flow of the second target thread.

[0148] Preferably, the detection unit 604 is specifically used for:

[0149] Trigger the thread monitoring sub-module to monitor whether the second target thread outputs the execution result of the defect detection message;

[0150] If so, push the second target thread out of the thread monitoring sub-module;

[0151] If not, determine whether the second target thread is abnormal;

[0152] If the second target thread is abnormal, end the processing flow of the second target thread;

[0153] If the second target thread is normal, continue to monitor the second target thread until the execution result of the defect detection message is output by the second target thread.

[0154] Preferably, the determination unit 606 is further configured to:

[0155] Determine whether there is a target detection algorithm adapted to the target detection area among the multiple detection areas, where the target detection area is any detection area among the multiple detection areas;

[0156] The device further includes:

[0157] The collection unit 607 is configured to, if there is no target detection algorithm adapted to the target detection area, collect the corresponding training sample set in the defect library for the target detection area;

[0158] The training unit 608 is configured to use the training sample set to train the defect detection model to obtain a defect detection model for detecting the target detection area;

[0159] The detection unit 604 is further configured to use the defect detection model to detect the defects in the target detection area.

[0160] In the embodiment of the present application, in order to improve the detection efficiency and accuracy of glass, the partitioning unit 602 first partitions the glass into multiple detection areas, and the configuration unit 603 configures an adapted detection algorithm for each detection area, and then simultaneously detects the defects in the multiple detection areas through multi-threading, so as to improve the accuracy of glass defect detection while improving the detection efficiency of glass.

[0161] The detection device of the glass picture in the embodiment of the present invention has been described above from the perspective of modular functional entities. The computer device in the embodiment of the present invention will be described below from the perspective of hardware processing:

[0162] The computer device is used to implement the functions of the detection device of the glass picture. An embodiment of the computer device in the embodiment of the present invention includes:

[0163] A processor and a memory;

[0164] The memory is used to store a computer program. When the processor is used to execute the computer program stored in the memory, the detection method of the glass picture as described in Figures 1 to 5 can be implemented.

[0165] It can be understood that when the processor in the above-described computer device executes the computer program, the functions of each unit in the corresponding device embodiments can also be implemented, which will not be elaborated here. Exemplarily, the computer program can be divided into one or more modules / units. The one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the glass picture detection device. For example, the computer program can be divided into the respective units in the above-described glass picture detection device, and each unit can implement the specific functions as described in the corresponding glass picture detection device description above.

[0166] The computer device can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The computer device may include but is not limited to a processor and a memory. Those skilled in the art can understand that the processor and the memory are only examples of the computer device, and do not constitute a limitation on the computer device. It may include more or fewer components, or combine certain components, or different components. For example, the computer device may further include input / output devices, network access devices, a bus, etc.

[0167] The processor can be a Central Processing Unit (CPU), or can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The processor is the control center of the computer device, and connects all parts of the entire computer device through various interfaces and lines.

[0168] The memory can be used to store the computer programs and / or modules. By running or executing the computer programs and / or modules stored in the memory and invoking the data stored in the memory, the processor realizes various functions of the computer device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0169] The present invention also provides a computer-readable storage medium, which is used to implement the functions of the glass picture detection device. A computer program is stored thereon. When the computer program is executed by a processor, the processor can be used to implement the glass picture detection method as Figures 1 to 5 described in.

[0170] It can be understood that if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a corresponding computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above corresponding embodiment methods of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0171] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0172] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0173] 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 can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0174] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0175] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0176] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting a glass picture, characterized in that, Including: Obtain the glass to be detected and the type of the glass; Divide the glass to be detected into multiple regions to be detected; For the type of the glass, configure an adapted detection algorithm for each region to be detected among the multiple regions to be detected; Detect defects in the multiple regions to be detected by using multi-threading to obtain defect detection results for each region to be detected; Merge the defect detection results of the multiple regions to be detected, and obtain the defect detection result of the glass to be detected according to the merged defect detection result.

2. The method according to claim 1, characterized in that, Detect defects in the multiple detection regions by using multi-threading to obtain defect detection results for each region to be detected, including: When multiple messages are detected, create multiple target threads corresponding to the multiple messages, and the multiple target threads respectively call the adapted detection algorithms to detect defects in the multiple regions to be detected to obtain the defect detection results of the multiple regions to be detected, where each message stores the association relationship between the region to be detected identifier, the target thread identifier, and the detection algorithm.

3. The method according to claim 2, characterized in that, Before creating the multiple target threads corresponding to the multiple messages, the method further includes: Obtain the data object of each message in the multiple messages; Judge whether the data object contains information for creating a thread object; If so, create a target thread corresponding to each message; If not, prompt that the target thread creation fails.

4. The method according to claim 2, characterized in that, The message includes an upper-layer message and a lower-layer message; When the message stores a message for defect detection in the region to be detected, identify the category of the message according to the attribute information of the message; If the message belongs to the upper-layer message, process the message for defect detection in the region to be detected by using a first processing strategy to obtain the execution result of the defect detection message; If the message belongs to the lower-layer message, process the message for defect detection in the region to be detected by using a second processing strategy to obtain the execution result of the defect detection message, where the first processing strategy pushes the upload message into the lower-layer message queue when the upload message processing is abnormal, and the second processing strategy ends the processing flow when the lower-layer message processing is abnormal.

5. The method according to claim 4, characterized in that, If the message belongs to the upper-layer message, process the message for defect detection in the region to be detected by using a first processing strategy to obtain the execution result of the defect detection message, including: If it is recognized that the message is the upper-layer message, create a first target thread corresponding to the upper-layer message, and the first target thread calls the adapted detection algorithm to detect defects in the region to be detected; Monitor the running state of the first target thread; If the first target thread outputs the execution result of the defect detection message, judge whether the execution result has ended; If it has not ended, use the execution result as a new message; If it has ended, end the processing flow of the first target thread.

6. The method according to claim 5, characterized in that, The monitoring of the running state of the first target thread includes: Monitor whether the first target thread outputs the execution result of the defect detection message; If the execution result of the defect detection message is output, then the monitoring of the first target thread ends; If the execution result of the defect detection message is not output, then determine whether the first target thread is abnormal; If the first target thread is abnormal, then determine whether the upper-layer message belongs to the message of the last level; If the upper-layer message belongs to the message of the last level, then prompt to output an abnormality; If the upper-layer message does not belong to the message of the last level, then push the upper-layer message into the lower-layer message queue; If the first target thread is normal, then continue to monitor the first target thread until the first target thread outputs the execution result of the defect detection message.

7. The method according to claim 4, characterized in that, If the message belongs to the lower-layer message, then use a second processing strategy to process the message of defect detection in the area to be detected to obtain the execution result of the defect detection message, including: If the message belongs to the lower-layer message, then determine whether the current computing resource is greater than a preset threshold; If so, create a second target thread corresponding to the lower-layer message, and the second target thread calls an adapted detection algorithm to detect the defects in the area to be detected; Monitor the running state of the second target thread; If the second target thread outputs the execution result of the defect detection message, then determine whether the execution result has ended; If it has not ended, then use the execution result as a new message; If it has ended, then end the processing flow of the second target thread.

8. The method according to claim 7, wherein, The monitoring of the running state of the second target thread includes: Monitoring whether the second target thread outputs the execution result of the defect detection message; If the execution result of the defect detection message is output, then end the monitoring of the second target thread; If the execution result of the defect detection message is not output, then determine whether the second target thread is abnormal; If the second target thread is abnormal, then end the processing flow of the second target thread; If the second target thread is normal, then continue to monitor the second target thread until the second target thread outputs the execution result of the defect detection message.

9. The method according to claim 1, wherein, Before configuring an adapted detection algorithm for each of the multiple detection areas according to the type of the glass, the method further includes: Determine whether there is a target detection algorithm adapted to a target detection area in the multiple detection areas, where the target detection area is any one of the multiple detection areas; If there is no target detection algorithm adapted to the target detection area, then collect a corresponding training sample set in the defect library for the target detection area; Use the training sample set to train a defect detection model to obtain a defect detection model for detecting the defects in the target detection area; Use the defect detection model to detect the defects in the target detection area.

10. A detection device for glass pictures, wherein, Including: An acquisition unit, configured to acquire the glass to be detected and the type of the glass; A division unit, configured to divide the glass to be detected into multiple areas to be detected; A configuration unit for configuring an adapted detection algorithm for each of the multiple regions to be detected according to the type of the glass; A detection unit for detecting defects in the multiple regions to be detected by using multi-threading to obtain defect detection results for each region to be detected; A merging unit for merging the defect detection results of the multiple regions to be detected and obtaining the defect detection result of the glass to be detected according to the merged defect detection results.

11. A computer device, comprising a processor, wherein, When the processor executes the computer program stored in the memory, it is used to implement the detection method of the glass picture according to any one of claims 1 to 9.

12. A computer-readable storage medium, on which a computer program is stored, wherein, When the computer program executes the computer program stored in the memory, it is used to implement the detection method of the glass picture according to any one of claims 1 to 9.