Camera defect detection method and device, computer equipment and readable storage medium

By acquiring the defect form interval and quantity interval of the camera, determining the acceptance determination conditions, identifying and determining the defect information in the image to be detected, the problem of misjudgment of traditional camera defect detection methods is solved, and the accuracy of detection is improved.

CN119946249APending Publication Date: 2025-05-06SHANGHAI SMARTMORE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510132448.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Traditional camera defect detection methods are prone to misjudgment, resulting in inaccurate detection results.

Method used

By obtaining the defect pattern interval and the defect number interval, determining the acceptance determination conditions, and identifying and determining the defect information in the image to be detected, improving the accuracy of defect detection.

Benefits of technology

It has achieved improved the accuracy of camera defect detection, can detect according to various acceptance determination conditions, and is suitable for complex detection scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119946249A_ABST
    Figure CN119946249A_ABST
Patent Text Reader

Abstract

The invention relates to a camera defect detection method and device, computer equipment and a readable storage medium. The method comprises the following steps: acquiring a defect form interval, and determining a defect number interval according to the defect form interval; determining acceptance judgment conditions according to the defect form interval and the defect number interval; identifying target defect information of defects in the obtained to-be-detected image; the target defect information comprises defect form information corresponding to the defect form interval and defect number information corresponding to the defect number interval; and determining a defect acceptance result according to the acceptance judgment condition and the target defect information. By adopting the method and the device, the accuracy of camera defect detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of defect detection technology, and in particular to a camera defect detection method, device, computer equipment and readable storage medium. Background Art

[0002] Mobile phone cameras are widely used in daily life, and the quality of the camera is crucial to the user's use. In the process of producing cameras, foreign matter, scratches and other defects are inevitable, and defective products need to be eliminated through appearance inspection.

[0003] The appearance inspection of cameras usually includes defect detection and acceptance judgment. Commonly used defect detection algorithms include machine vision-based algorithms, deep learning-based algorithms, etc. These algorithms can output the location information of the defects. Based on this information and specific acceptance judgment methods, it can be determined whether the camera defects can pass the inspection.

[0004] However, in traditional camera defect detection methods, defect detection is prone to misjudgment, resulting in inaccurate camera defect detection results. Summary of the invention

[0005] Based on this, it is necessary to provide a camera defect detection method, device, computer equipment and readable storage medium that can improve the accuracy of camera defect detection in response to the above technical problems.

[0006] In a first aspect, the present application provides a camera defect detection method, comprising:

[0007] Obtain defect shape intervals, and determine defect quantity intervals based on the defect shape intervals;

[0008] Determine the acceptance criteria based on the defect shape range and defect quantity range;

[0009] Identify target defect information of defects in the acquired image to be detected; the target defect information includes defect morphology information corresponding to the defect morphology interval and defect quantity information corresponding to the defect quantity interval;

[0010] Determine the defect acceptance result based on the acceptance judgment conditions and target defect information.

[0011] In a second aspect, the present application also provides a camera defect detection device, comprising:

[0012] An interval determination module is used to obtain a defect shape interval and determine a defect quantity interval according to the defect shape interval;

[0013] The condition determination module is used to determine the acceptance judgment conditions according to the defect shape interval and defect quantity interval;

[0014] An identification module is used to identify target defect information of defects in the acquired image to be detected; the target defect information includes defect morphology information corresponding to the defect morphology interval and defect quantity information corresponding to the defect quantity interval;

[0015] The result determination module is used to determine the defect acceptance result according to the acceptance judgment conditions and the target defect information.

[0016] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the camera defect detection method provided in the first aspect are implemented.

[0017] In a fourth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the camera defect detection method provided in the first aspect.

[0018] In a fifth aspect, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the camera defect detection method provided in the first aspect.

[0019] The above-mentioned camera defect detection method, device, computer equipment, computer-readable storage medium and computer program product determine the defect quantity interval based on the acquired defect morphology interval, and determine the acceptance judgment condition based on the defect morphology interval and the defect quantity interval, and identify the defect information of the acquired image to be detected, and perform defect judgment on the identified target defect information through the determined acceptance judgment condition to obtain a defect acceptance result. Since the defect quantity interval can be determined by the acquired defect morphology interval, a variety of acceptance judgment conditions can be determined based on the defect morphology interval and the defect quantity interval, which is not limited to fixed acceptance judgment conditions, and is also suitable for determining the acceptance judgment conditions of complex detection scenarios. Defect detection judgment is performed based on the defect morphology information and defect quantity information corresponding to the acceptance judgment conditions, which can improve the accuracy of camera defect detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A diagram of an application environment of a camera defect detection method provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of a process flow of a camera defect detection method provided in an embodiment of the present application;

[0022] Figure 3A schematic diagram of a process for identifying target defect information of defects in an image to be detected provided in an embodiment of the present application;

[0023] Figure 4 A schematic diagram of a process flow of another camera defect detection method provided in an embodiment of the present application;

[0024] Figure 5 A structural block diagram of a camera defect detection device provided in an embodiment of the present application;

[0025] Figure 6 An internal structure diagram of a computer device provided in an embodiment of the present application;

[0026] Figure 7 An internal structure diagram of another computer device provided in an embodiment of the present application;

[0027] Figure 8 An internal structure diagram of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0029] The camera defect detection method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. It is easy to understand that the camera defect detection method provided in the embodiment of the present application is not limited to the application scenario in which the above-mentioned server and terminal interact, but is also suitable for the application scenario of a single server or a single terminal.

[0030] like Figure 2 As shown, the embodiment of the present application provides a camera defect detection method, which is applied to Figure 1 The terminal 102 or the server 104 in the example is used for explanation. It is understandable that the computer device may include at least one of the terminal and the server. The method comprises the following steps:

[0031] S202, obtaining a defect shape interval, and determining a defect quantity interval according to the defect shape interval.

[0032] Among them, the defect morphology interval refers to the interval corresponding to the defect morphology, and the defect morphology is used to represent the morphological information of the defect, such as defect area, defect length, defect width, defect grayscale, etc. Correspondingly, the defect morphology interval may include at least one of the defect area interval, defect length interval, defect width interval and defect grayscale interval. The defect morphology can be selected according to the actual application scenario. The defect quantity interval refers to the interval corresponding to the defect quantity. It is easy to understand that the defect morphology interval or the defect quantity interval can also be represented in the form of a set. Multiple preset morphology intervals and preset quantity intervals can be pre-set, and the defect morphology interval can be any preset morphology interval, and the defect quantity interval can also be any preset quantity interval.

[0033] Specifically, the defect morphology interval can be obtained from the preset morphology interval, and then the defect quantity interval corresponding to the defect morphology interval can be determined from the preset quantity interval. Alternatively, the defect quantity interval associated with the defect morphology interval can be determined from the preset quantity interval.

[0034] Specifically, the defect morphology endpoint value may be obtained, the defect morphology interval may be determined according to the defect morphology endpoint value, and then the defect quantity endpoint value may be determined according to the defect morphology interval, and then the defect quantity interval may be determined according to the defect quantity endpoint value.

[0035] S204, determining acceptance criteria according to the defect shape interval and defect quantity interval.

[0036] Among them, the acceptance judgment condition is a judgment condition used to detect whether the defect meets the requirements. The acceptance judgment condition is used to determine whether the defect quantity corresponding to the defect in the defect shape interval is in the defect quantity interval. For example, if the defect quantity corresponding to the defect in the defect shape interval is in the defect quantity interval, it means that the acceptance judgment condition is met. If the defect quantity corresponding to the defect in the defect shape interval is not in the defect quantity interval, it means that the acceptance judgment condition is not met. Exemplarily, if the acceptance judgment condition is met, the defect acceptance result is passed acceptance. If the acceptance judgment condition is not met, the defect acceptance result is not passed acceptance.

[0037] Specifically, whether the defect is in the defect shape range and the defect quantity range can be used as acceptance judgment conditions.

[0038] S206, identifying target defect information of defects in the acquired image to be detected; wherein the target defect information includes defect morphology information corresponding to the defect morphology interval and defect quantity information corresponding to the defect quantity interval.

[0039] The image to be detected refers to an image to be inspected for defects. For example, a camera to be detected can be photographed to obtain the image to be detected. Then, it is identified whether there are defects in the acquired image to be detected. For example, it is identified whether there are defects in the image to be detected according to a preset defect model. If there are defects, target defect information of the defects in the image to be detected is identified.

[0040] The target defect information may include defect morphology information and defect quantity information. The defect morphology information may include one or more information corresponding to defect morphology. For example, the defect morphology information may include at least one of defect area information, defect length information, defect width information, and defect grayscale information. The defect morphology information corresponds to the defect morphology interval, that is, the defect morphology information can be determined by the defect morphology interval to determine whether the defect morphology information is in the defect morphology interval; the defect quantity information corresponds to the defect quantity interval, that is, the defect quantity information can be determined by the defect quantity interval to determine whether the defect quantity information is in the defect quantity interval.

[0041] Among them, the defect length information can be determined according to the number of pixels of the long side of the minimum circumscribed rectangle of the defect area and the unit pixel length. For example, the product of the number of pixels of the long side of the minimum circumscribed rectangle of the defect area and the unit pixel length is used as the defect length information. The defect width information can be determined according to the distance from the internal point of the defect area to the defect edge and the unit pixel length. For example, the minimum distance from each internal point of the defect area to the defect edge is calculated. It is easy to understand that since the shape of the area corresponding to the defect is often an irregular shape, there are multiple distances from the same internal point to the defect edge. The minimum distance is selected from the multiple distances, and then the maximum distance is selected from the minimum distances corresponding to each internal point. The maximum distance is used as the reference distance, and the defect width information is determined according to the reference distance and the unit pixel length. The product of twice the reference distance and the unit pixel length can be used as the defect width information. The defect grayscale information may include relative grayscale information and absolute grayscale information. The defect area information and the defect grayscale information can refer to the detailed description of the following embodiments.

[0042] It is easy to understand that the specific type of defect morphology information included in the target defect information can be set accordingly according to the defect morphology interval. For example, the defect morphology interval includes the defect area interval, the defect grayscale interval and the defect length interval, then the defect morphology information corresponding to the defect to be identified includes the defect area information, the defect grayscale information and the defect length information respectively. The specific type setting of the defect morphology interval can be selected according to the actual application scenario.

[0043] S208, determining the defect acceptance result according to the acceptance judgment condition and the target defect information.

[0044] The defect acceptance result is used to indicate whether the target defect information meets the acceptance judgment condition. The defect acceptance result may include passing acceptance and failing acceptance.

[0045] Specifically, the target defect information can be compared with the corresponding acceptance judgment condition. If the target defect information meets the acceptance judgment condition, the defect acceptance result is determined to be accepted; if the target defect information does not meet the acceptance judgment condition, the defect acceptance result is determined to be not accepted.

[0046] It can be seen that in the embodiments of the present application, the defect quantity interval is determined according to the acquired defect morphology interval, and the acceptance judgment condition is determined according to the defect morphology interval and the defect quantity interval, and the defect information of the acquired image to be detected is identified, and the identified target defect information is subjected to defect judgment according to the determined acceptance judgment condition to obtain a defect acceptance result. Since the defect quantity interval can be determined according to the acquired defect morphology interval, a variety of acceptance judgment conditions can be determined according to the defect morphology interval and the defect quantity interval, which is not limited to fixed acceptance judgment conditions, and is also suitable for determining the acceptance judgment conditions of complex detection scenarios. Defect detection judgment is performed based on the defect morphology information and defect quantity information corresponding to the acceptance judgment conditions, which can improve the accuracy of camera defect detection.

[0047] In some embodiments, the defect morphology interval includes a first morphology interval and a second morphology interval, and the first morphology interval and the second morphology interval are different defect morphology intervals; obtaining the defect morphology interval in S202, and determining the defect quantity interval according to the defect morphology interval, includes:

[0048] Acquire a first morphological interval, and determine a second morphological interval according to the first morphological interval;

[0049] Determine the defect quantity interval according to the second morphological interval;

[0050] In S204, the acceptance judgment conditions are determined according to the defect shape interval and the defect quantity interval, including:

[0051] The acceptance judgment conditions are determined based on the first form interval, the second form interval and the defect quantity interval.

[0052] Among them, the first morphological interval is the defect morphological interval corresponding to the first defect morphology, and the second morphological interval is the defect morphological interval corresponding to the second defect morphology. For example, if the first defect morphology is defect area, then the first morphological interval is defect area interval, and the second defect morphology is defect length, then the second morphological interval is defect length interval; or, if the first defect morphology is defect width, the first morphological interval is defect width interval, and the second defect morphology is defect grayscale, and the second morphological interval is defect grayscale interval; or, if the first defect morphology is defect grayscale, the first morphological interval is defect grayscale interval, and the second defect morphology is defect area, and the second morphological interval is defect area interval, etc. It is easy to understand that in the first morphological interval and the second morphological interval, any one of the defect morphological intervals can be obtained first, and then another defect morphological interval can be determined based on the obtained defect morphological interval.

[0053] Specifically, the first morphological interval can be obtained by user input or selection, that is, the input first morphological interval is obtained, or the first morphological interval is obtained in response to the selection trigger of the defect morphological interval. The second morphological interval of the corresponding position is determined according to the first morphological interval, and then the defect quantity interval of the corresponding position is determined according to the second morphological interval, so as to determine the acceptance judgment condition according to the first morphological interval, the second morphological interval and the defect quantity interval. Accordingly, it is necessary to identify the target defect information corresponding to the defect in the image to be detected, the target defect information includes defect morphological information and defect quantity information, the defect morphological information includes first defect morphological information and second defect morphological information, the first defect morphological information corresponds to the first morphological interval, and the second defect morphological information corresponds to the second morphological interval.

[0054] Specifically, the defect morphology interval may further include a third morphology interval, and the first morphology interval, the second morphology interval, and the third morphology interval are different defect morphology intervals. For example, the first morphology interval is obtained, the second morphology interval is determined according to the first morphology interval, the third morphology interval is determined according to the second morphology interval, the defect quantity interval is determined according to the third morphology interval, and then the acceptance judgment condition is determined according to the first morphology interval, the second morphology interval, the third morphology interval, and the defect quantity interval. It is easy to understand that the defect morphology interval may include intervals corresponding to multiple defect morphologies, which may be 4, 5, or more, and will not be described one by one here.

[0055] It can be seen that in this embodiment, the second morphology interval is determined by obtaining the first morphology interval, the defect quantity interval is determined according to the second morphology interval, and the acceptance judgment condition is determined according to the first morphology interval, the second morphology interval and the defect quantity interval. More complex acceptance judgment conditions can be determined, and defect detection can be performed through more types of defect morphology information, which can improve the accuracy of camera defect detection.

[0056] In some embodiments, determining the defect quantity interval according to the defect morphology interval in S202 includes:

[0057] In the preset defect quantity set, a preset quantity interval corresponding to the position of the defect shape interval in the preset defect shape set is used as the defect quantity interval.

[0058] The preset defect quantity set refers to a set of preset defect quantities. The preset defect quantity set usually includes multiple preset quantity intervals. For example, the preset defect quantity set is [0, 10000], and the preset quantity intervals may include [0, 1), [1, 10], (10, 10000], that is, the union of each preset quantity interval is the preset defect quantity set. It is easy to understand that the preset defect quantity set and the preset quantity intervals included therein can be set according to the actual application scenario.

[0059] The preset defect form set refers to a set of preset defect forms. The preset defect form set may include multiple preset form intervals. For example, the preset defect form set is , the preset pattern interval can include , , That is to say, the union of each preset form interval is the preset defect form set. It is easy to understand that the preset defect form set and the preset form intervals included therein can be set according to the actual application scenario.

[0060] Specifically, if the defect shape interval is in the first position in the preset defect shape set, the preset number interval in the second position corresponding to the first position in the defect quantity set is used as the defect quantity interval. For example, the preset shape intervals included in the preset defect shape set include , , , the preset number intervals included in the preset defect number set include [0,1), [1,10], (10,10000], then if the defect shape interval is , then the preset number interval corresponding to the position of the defect shape interval in the preset defect shape set is [1,10], and the preset number interval [1,10] is the defect quantity interval. It is easy to understand that the preset shape intervals included in the preset defect shape set and the preset number intervals included in the preset defect quantity set are usually arranged in order from small to large according to the interval endpoint values.

[0061] In some embodiments, if the defect morphology interval includes intervals corresponding to multiple defect morphologies, for example, the defect morphology interval includes a first morphology interval and a second morphology interval, then the first morphology interval is obtained, and the method for determining the second morphology interval based on the first morphology interval can refer to the method for determining the defect quantity interval based on the defect morphology interval, that is, the preset morphology interval in the complete set of preset defect morphologies corresponding to the second defect morphology, which corresponds to the position of the first morphology interval in the complete set of preset defect morphologies corresponding to the first defect morphology, can be used as the second morphology interval. If more types of defect morphology intervals are included, the same applies.

[0062] It can be seen that in this embodiment, by using the preset number interval corresponding to the position of the defect morphology interval in the preset defect number set as the defect number interval, the defect number interval can be quickly determined according to the defect morphology interval, thereby improving the camera defect detection efficiency.

[0063] In some embodiments, the defect morphology information includes absolute grayscale information; the target defect information of the defect in the image to be detected obtained by identifying in S206 includes:

[0064] Determine the number of pixels of defects in the acquired image to be inspected and the gray value of each pixel;

[0065] The absolute grayscale information of the defect is determined based on the grayscale value of each pixel and the number of pixels.

[0066] Among them, the absolute grayscale information is used to characterize the average grayscale value of the pixels corresponding to the defect. It can be understood that when performing defect recognition on the image to be inspected, if there is a defect, it is easy to determine the location of the defect and the number of pixels in the area corresponding to the defect, and obtain the grayscale value of each pixel in the area corresponding to the defect.

[0067] Specifically, for each defect, the sum of the grayscale values ​​of each pixel corresponding to the defect area is calculated, and the quotient of the sum of the grayscale values ​​of each pixel and the number of pixels is used as the absolute grayscale information of the corresponding defect, as shown in the following formula (1).

[0068] Formula (1)

[0069] Among them, G x Indicates absolute grayscale, G irepresents the gray value of the i-th pixel, and n represents the number of pixels.

[0070] Specifically, the product of the sum of the grayscale values ​​of each pixel corresponding to the defect area and the number of pixels and the reference coefficient can be used as the absolute grayscale information of the defect. The reference coefficient can be set according to the actual application scenario.

[0071] It can be seen that in this embodiment, by determining the absolute grayscale information of the defect according to the grayscale value of each pixel and the number of pixels, accurate absolute grayscale information can be obtained.

[0072] In some embodiments, the defect morphology information includes relative grayscale information; the target defect information of the defect in the image to be detected obtained by identifying in S206 includes:

[0073] Determine respectively the absolute grayscale information of the defect in the acquired image to be detected and the absolute grayscale information of the defect background corresponding to the defect; the defect background is determined by performing a dilation operation based on the defect image corresponding to the defect;

[0074] The relative grayscale information of the defect is determined based on the absolute grayscale information of the defect and the absolute grayscale information of the defect background.

[0075] The relative grayscale information is used to characterize the difference between the grayscale of the defect and the grayscale of the defect background. The defect background may refer to an annular area outside the defect area, and the annular area corresponding to the defect background may be determined based on the dilation operation result of the defect image corresponding to the defect area.

[0076] The defect image corresponding to the defect area can be dilated to determine the area corresponding to the defect background. For example, the defect image corresponding to the defect area is dilated by a first dilation kernel to obtain a first dilation image, and the defect image is dilated by a second dilation kernel to obtain a second dilation image. The defect background corresponding to the defect is determined based on the first dilation image and the second dilation image. For example, the first dilation image is removed from the pixels at the corresponding position of the second dilation image to obtain the defect background, and the first dilation kernel is larger than the second dilation kernel. Exemplarily, the first dilation kernel is 5 and the second dilation kernel is 3; or, the first dilation kernel is 6 and the second dilation kernel is 5, etc. For example, defect background = dilate (defect, 5) - dilate (defect, 3), where dilate (*, k) represents a dilation operation, k is the dilation kernel size, and subtraction refers to a difference operation of sets.

[0077] Specifically, the sum of the grayscale values ​​of the pixels in the area corresponding to the defect background and the number of pixels of the defect background can be obtained, and the absolute grayscale of the defect background can be determined according to the quotient of the sum of the grayscale values ​​of the pixels of the defect background and the number of pixels of the defect background, thereby obtaining the absolute grayscale information of the defect background. It is easy to understand that the absolute grayscale information of the defect can be determined in the same way, or the absolute grayscale information of the defect can refer to the description of the corresponding content in the above embodiment, which will not be repeated here.

[0078] Specifically, the relative grayscale information of the defect can be determined according to the difference between the absolute grayscale information of the defect and the absolute grayscale information of the defect background. For example, the difference between the absolute grayscale information of the defect and the absolute grayscale information of the defect background is used as the relative grayscale information of the defect.

[0079] It can be seen that in this embodiment, by determining the relative grayscale information of the defect based on the absolute grayscale information of the defect and the absolute grayscale information of the defect background, the relative grayscale information of the defect can be accurately determined.

[0080] In some embodiments, the defect morphology information includes defect area information; Figure 3 As shown, the target defect information of the defect in the image to be detected obtained by identifying in S206 includes:

[0081] S302: If the defect quantity corresponding to the defect quantity information is greater than or equal to the target quantity, the distance between any two defects in the target quantity of defects is calculated.

[0082] For example, if the defect quantity information corresponds to 5 defects and the target quantity is 3, then 3 defects are selected in sequence, and the distance between any two defects is calculated in each of the 3 defects selected. The target quantity can be set according to the actual application scenario, and the target quantity can be 2, 3, 4 or 5, for example.

[0083] Specifically, the distance between any two defects may be the distance between the centers of gravity corresponding to the any two defects.

[0084] S304: If the distance between any two defects in the target number of defects is less than the distance threshold, the target number of defects is used as a defect connected domain.

[0085] Among them, the distance threshold can be set according to the actual application scenario, for example, the distance threshold is 10 mm, 15 mm or 20 mm, etc. If the distance between any two defects is less than the distance threshold, it means that the distance between the defects in the target number of defects is relatively small, and the target number of defects is relatively concentrated, then the target number of defects can be regarded as a larger defect, that is, a defect connected domain is formed, and then the defect information corresponding to the defect connected domain is determined. It is easy to understand that the distance involved in this embodiment refers to the actual distance, and the distance between any two defects refers to the actual distance between the two defects on the corresponding actual object.

[0086] If the distance between two defects in the target number of defects is greater than or equal to the distance threshold, the defect area information of each defect is calculated, and the acceptance judgment condition is determined based on the defect area interval corresponding to the single defect.

[0087] S306, determining the defect area information of the defect connected domain according to the defect area information of the target number of defects in the defect connected domain.

[0088] Among them, each defect corresponds to a corresponding defect area, and the defect connected domain includes a target number of defects. Then, the sum of the defect areas of the target number of defects can be used as the defect area information of the defect connected domain.

[0089] Specifically, the defect area of ​​each defect can be determined based on the number of pixels corresponding to the defect area and the unit pixel length. The unit pixel length refers to the length of the actual object corresponding to each pixel in the image to be detected. For example, the product of the square of the unit pixel length and the number of pixels can be used as the defect area of ​​each defect.

[0090] It is easy to understand that if the target number of defects is regarded as a defect connected domain, when judging the defect area information of the defect connected domain, the defect area interval obtained by accumulating the single defect area intervals of the target number will be used as the acceptance judgment condition for judgment. Among them, the single defect area interval refers to the defect area interval corresponding to a single defect. For example, the single defect area interval is [0.1, 0.2], and the target number is 3, then the defect area interval obtained by accumulating the single defect area intervals of the target number is [0.3, 0.6].

[0091] It can be seen that in this embodiment, by comparing the number of defects with the target number, if the number of defects is greater than or equal to the target number, the distance between any two defects in the target number of defects is calculated; if the distance between any two defects is less than the distance threshold, the defects of the target number are taken as the defect connected domain, and the defect area information of the defect connected domain is determined based on the defect area information of the target number of defects in the defect connected domain. This can avoid the situation where multiple small defects are clustered together and cause missed detection, thereby improving the accuracy of camera defect detection.

[0092] In some embodiments, the camera defect detection method flow chart is as follows: Figure 4 As shown, the defect morphology interval includes a defect area interval and a defect grayscale interval, and the defect grayscale interval is a preset grayscale interval corresponding to the relative grayscale information.

[0093] The defect grayscale interval can be obtained by specifying the interval endpoints corresponding to the defect grayscale interval, the defect area interval can be determined based on the defect grayscale interval, and the defect quantity interval can be determined based on the defect area interval. For example, the interval endpoint corresponding to the specified defect grayscale interval is [0.35, 0.6], and the corresponding preset defect grayscale set includes the preset grayscale interval (-∞, 0.35], (0.35, 0.6], (0.6, +∞). If the defect grayscale interval is determined to be (0.35, 0.6], then the interval endpoint corresponding to the defect area interval at the corresponding position is [0.015], and the corresponding preset defect area set includes the preset area interval (-∞, 0.015], (0.015, +∞). Assuming that the preset defect quantity set includes the preset quantity interval (0, 1], (1, 10000], for the defect area interval (-∞, 0.015], the defect quantity interval at the corresponding position is (1, 10000], and for the defect area interval (0.015, +∞), the defect quantity interval at the corresponding position is (0, 1]. The endpoints of the defect grayscale interval, defect area interval, and defect quantity interval are shown in Table 1 below.

[0094] Table 1

[0095]

[0096] According to Table 1, if the target defect information corresponding to a particle defect includes: relative grayscale information of 0.4, defect area information of 0.018 square millimeters, the corresponding relative grayscale interval is [0.35, 0.6], the defect area interval is (0.015, +∞), and the defect quantity interval is (0, 1], then the number of particle defects is 1, which is within the defect quantity interval, indicating that the acceptance judgment condition is met, and the defect acceptance result is passed acceptance.

[0097] In the process of calculating the defect area information, if the defect number corresponding to the defect quantity information is greater than or equal to the target number, the distance between any two defects in the target number of defects is calculated; if the distance between any two defects in the target number of defects is less than the distance threshold, the target number of defects is taken as the defect connected domain, and the sum of the defect area information of the target number of defects in the defect connected domain is taken as the defect area information of the defect connected domain.

[0098] It can be seen that in this embodiment, by combining the defect grayscale information, defect area information and defect quantity threshold to determine whether the defect meets the acceptance judgment conditions, it is possible to achieve joint judgment of various types of defect information, which is suitable for various complex defect acceptance judgment scenarios; at the same time, multiple defect information is combined for judgment, and the position relationship of the defects is considered, and the more concentrated small defects are regarded as connected domains, and the area of ​​the connected domain is calculated for judgment, so as to avoid the situation where multiple small defects are clustered together and cause misjudgment, thereby improving the accuracy of camera defect detection.

[0099] It should be understood that, although the steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0100] Based on the same inventive concept, the embodiment of the present application also provides a camera defect detection device. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more camera defect detection device embodiments provided below can refer to the limitations of the camera defect detection method above, and will not be repeated here.

[0101] like Figure 5 As shown, the embodiment of the present application provides a camera defect detection device, comprising:

[0102] The interval determination module 502 is used to obtain the defect shape interval and determine the defect quantity interval according to the defect shape interval;

[0103] The condition determination module 504 is used to determine the acceptance judgment condition according to the defect shape interval and the defect quantity interval;

[0104] The identification module 506 is used to identify target defect information of defects in the acquired image to be detected; the target defect information includes defect morphology information corresponding to the defect morphology interval and defect quantity information corresponding to the defect quantity interval;

[0105] The result determination module 508 is used to determine the defect acceptance result according to the acceptance judgment condition and the target defect information.

[0106] In some embodiments, the defect morphology interval includes a first morphology interval and a second morphology interval, and the first morphology interval and the second morphology interval are different defect morphology intervals; in acquiring the defect morphology interval and determining the defect quantity interval according to the defect morphology interval, the interval determination module 502 is specifically used to:

[0107] Acquire a first morphological interval, and determine a second morphological interval according to the first morphological interval;

[0108] Determine the defect quantity interval according to the second morphological interval;

[0109] In terms of determining the acceptance judgment condition according to the defect shape interval and the defect quantity interval, the condition determination module 504 is specifically used to:

[0110] The acceptance judgment conditions are determined based on the first form interval, the second form interval and the defect quantity interval.

[0111] In some embodiments, in determining the defect quantity interval according to the defect morphology interval, the interval determination module 502 is specifically used to:

[0112] In the preset defect quantity set, a preset quantity interval corresponding to the position of the defect shape interval in the preset defect shape set is used as the defect quantity interval.

[0113] In some embodiments, the defect morphology information includes absolute grayscale information; in terms of identifying target defect information of defects in the acquired image to be detected, the identification module 506 is specifically used to:

[0114] Determine the number of pixels of defects in the acquired image to be inspected and the gray value of each pixel;

[0115] The absolute grayscale information of the defect is determined based on the grayscale value of each pixel and the number of pixels.

[0116] In some embodiments, the defect morphology information includes relative grayscale information; in terms of identifying target defect information of defects in the acquired image to be detected, the identification module 506 is specifically used to:

[0117] Determine the absolute grayscale information of the defect in the acquired image to be detected and the absolute grayscale information of the defect background corresponding to the defect; the defect background is determined by performing a dilation operation based on the defect image corresponding to the defect;

[0118] The relative grayscale information of the defect is determined based on the absolute grayscale information of the defect and the absolute grayscale information of the defect background.

[0119] In some embodiments, the defect morphology information includes defect area information; in terms of identifying target defect information of defects in the acquired image to be detected, the identification module 506 is specifically used to:

[0120] If the number of defects corresponding to the defect quantity information is greater than or equal to the target number, the distance between any two defects in the target number of defects is calculated;

[0121] If the distance between any two defects in the target number of defects is less than the distance threshold, the target number of defects is regarded as the defect connected domain;

[0122] Determine the defect area information of the defect connected domain according to the defect area information of the target number of defects in the defect connected domain.

[0123] Each module in the above-mentioned camera defect detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0124] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to defect detection. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the above-mentioned camera defect detection method are implemented.

[0125] In some embodiments, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, the steps in the above-mentioned camera defect detection method are implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0126] Those skilled in the art will understand that Figure 5 or Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0127] In some embodiments, a computer device is provided, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above-mentioned camera defect detection method embodiments when executing the computer program.

[0128] In some embodiments, Figure 7 The figure shows an internal structure diagram of a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned camera defect detection method embodiments are implemented.

[0129] In some embodiments, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned camera defect detection method embodiments are implemented.

[0130] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0131] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0132] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0133] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A camera defect detection method, characterized in that: include: Obtaining a defect morphology interval, and determining a defect quantity interval according to the defect morphology interval; Determining acceptance criteria according to the defect shape interval and the defect quantity interval; Identify target defect information of defects in the acquired image to be detected; the target defect information includes defect morphology information corresponding to the defect morphology interval and defect quantity information corresponding to the defect quantity interval; A defect acceptance result is determined according to the acceptance judgment condition and the target defect information.

2. The method according to claim 1, characterized in that The defect morphology interval includes a first morphology interval and a second morphology interval, and the first morphology interval and the second morphology interval are different defect morphology intervals; the obtaining of the defect morphology interval and determining the defect quantity interval according to the defect morphology interval includes: Acquire the first morphological interval, and determine the second morphological interval according to the first morphological interval; determining a defect quantity interval according to the second morphological interval; The determining of the acceptance judgment condition according to the defect shape interval and the defect quantity interval includes: An acceptance judgment condition is determined according to the first form interval, the second form interval, and the defect quantity interval.

3. The method according to claim 1, characterized in that: The step of determining the defect quantity interval according to the defect morphology interval includes: In the preset defect quantity set, a preset quantity interval corresponding to the position of the defect morphology interval in the preset defect morphology set is used as the defect quantity interval.

4. The method according to claim 1, characterized in that The defect morphology information includes absolute grayscale information; the target defect information of the defect in the image to be detected obtained by identification includes: Respectively determining the number of pixels of defects in the acquired image to be detected and the grayscale value of each pixel; The absolute grayscale information of the defect is determined according to the grayscale value of each pixel and the number of pixels.

5. The method according to claim 1, characterized in that The defect morphology information includes relative grayscale information; the target defect information of the defect in the image to be detected obtained by identification includes: Determine respectively the absolute grayscale information of the defect in the acquired image to be detected and the absolute grayscale information of the defect background corresponding to the defect; the defect background is determined by performing a dilation operation based on the defect image corresponding to the defect; The relative grayscale information of the defect is determined according to the absolute grayscale information of the defect and the absolute grayscale information of the defect background.

6. The method according to claim 1, characterized in that The defect morphology information includes defect area information; the target defect information of the defect in the image to be detected obtained by identification includes: If the number of defects corresponding to the defect quantity information is greater than or equal to the target number, then calculating the distance between any two defects in the target number of defects; If the distance between any two defects in the target number of defects is less than the distance threshold, the target number of defects is regarded as a defect connected domain; The defect area information of the defect connected domain is determined according to the defect area information of the target number of defects in the defect connected domain.

7. A camera defect detection device, characterized in that: include: An interval determination module, used to obtain a defect morphology interval and determine a defect quantity interval according to the defect morphology interval; A condition determination module, used to determine an acceptance judgment condition according to the defect shape interval and the defect quantity interval; An identification module, which identifies target defect information of defects in the acquired image to be detected; the target defect information includes defect morphology information corresponding to the defect morphology interval and defect quantity information corresponding to the defect quantity interval; The result determination module is used to determine the defect acceptance result according to the acceptance judgment condition and the target defect information.

8. The device according to claim 7, characterized in that The defect morphology interval includes a first morphology interval and a second morphology interval, and the first morphology interval and the second morphology interval are different defect morphology intervals; in terms of obtaining the defect morphology interval and determining the defect quantity interval according to the defect morphology interval, the interval determination module is specifically used to: Acquire the first morphological interval, and determine the second morphological interval according to the first morphological interval; determining a defect quantity interval according to the second morphological interval; In terms of determining the acceptance judgment condition according to the defect shape interval and the defect quantity interval, the condition determination module is specifically used to determine the acceptance judgment condition according to the first shape interval, the second shape interval and the defect quantity interval.

9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.