CN115965608A - Defect detection method, device, equipment and storage medium - Google Patents
Defect detection method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115965608A CN115965608A CN202211741907.4A CN202211741907A CN115965608A CN 115965608 A CN115965608 A CN 115965608A CN 202211741907 A CN202211741907 A CN 202211741907A CN 115965608 A CN115965608 A CN 115965608A
- Authority
- CN
- China
- Prior art keywords
- display
- frame
- display frame
- display device
- defect
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Testing Of Optical Devices Or Fibers (AREA)
Abstract
The embodiment of the disclosure discloses a defect detection method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a current display image of a display device to be tested; the current display image is obtained by the display device to be tested through displaying a standard graph; determining a display frame of the standard graph from a current display image; detecting defects of the display device to be detected based on the geometric characteristics of the display frame to obtain a detection result of the display device to be detected; the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of endpoints in the display frame.
Description
Technical Field
The present disclosure relates to, but not limited to, the field of computer technologies, and in particular, to a defect detection method, apparatus, device, and storage medium.
Background
In the process of producing the display screens of computers, flat panels and the like, defects often occur at the positions of the screens and the outer frames due to the factors that the screens and the plastic outer frames are not assembled in place, foreign matter shielding exists in the frame areas and the like, and the defects are difficult to find through human eye observation and need to invest a large amount of labor cost. In the related art, the detection of the defect is performed by using an automatic device and technology based on computer vision, but the problems of low execution speed, inaccurate result, inaccurate positioning of the position of the defect and the like exist.
Disclosure of Invention
In view of the above, the embodiments of the present disclosure at least provide a defect detection method, apparatus, device and storage medium.
The technical scheme of the embodiment of the disclosure is realized as follows:
in one aspect, an embodiment of the present disclosure provides a defect detection method, including: acquiring a current display image of a display device to be tested; the current display image is obtained by the display device to be tested through displaying a standard graph; determining a display frame of the standard graph from the current display image; based on the geometric characteristics of the display frame, performing defect detection on the display device to be detected to obtain a detection result of the display device to be detected; the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of the endpoints in the display frame.
In another aspect, an embodiment of the present disclosure provides a defect detection apparatus, including: the acquisition module is used for acquiring a current display image of the display device to be detected; the current display image is obtained by the display device to be tested through displaying a preset standard graph; the determining module is used for determining a display frame of the standard graph from the current display image; the detection module is used for detecting the defects of the display device to be detected based on the geometric characteristics of the display frame to obtain the detection result of the display device to be detected; the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of the endpoints in the display frame.
In yet another aspect, the present disclosure provides a computer device, including a memory and a processor, where the memory stores a computer program executable on the processor, and the processor implements some or all of the steps of the above method when executing the program.
In yet another aspect, the disclosed embodiments provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements some or all of the steps of the above-described method.
In yet another aspect, the disclosed embodiments provide a computer program comprising computer readable code, which when run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
In yet another aspect, the disclosed embodiments provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program, which when read and executed by a computer, implements some or all of the steps of the above method.
In the embodiment of the disclosure, firstly, a current display image of a display device to be tested is obtained; the current display image is obtained by the display device to be tested through displaying a standard graph; and determining the display frame of the standard graph from the current display image. In this way, the display frame generated by the device to be displayed by displaying the standard graph can be quickly acquired, and then whether the device to be displayed has defects or the like can be determined by determining the integrity of the display frame. Then, based on the geometric characteristics of the display frame, defect detection is carried out on the display device to be detected, and the detection result of the display device to be detected is obtained quickly and accurately; the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of endpoints in the display frame. Therefore, the defect detection can be accurately realized, and the position of the defect can be accurately determined under the condition that the defect exists, so that the defect detection efficiency, the defect detection precision and the like of the device to be displayed can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the technical aspects of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic view illustrating an implementation flow of a defect detection method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart illustrating an implementation of a defect detection method according to an embodiment of the present disclosure;
fig. 3 is a schematic view illustrating an implementation flow of a defect detection method according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart illustrating an implementation of a defect detection method according to an embodiment of the present disclosure;
fig. 5A is a schematic diagram of a currently displayed image according to an embodiment of the present disclosure;
fig. 5B is a schematic diagram of a currently displayed image according to an embodiment of the disclosure;
fig. 5C is a schematic diagram of a currently displayed image according to an embodiment of the disclosure;
FIG. 5D is a schematic diagram of a currently displayed image according to an embodiment of the disclosure;
fig. 6 is a schematic flow chart illustrating an implementation of a defect detection method according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a connected core provided by an embodiment of the present disclosure;
fig. 8A is a schematic diagram of a currently displayed image according to an embodiment of the present disclosure;
FIG. 8B is a schematic diagram of a currently displayed image according to an embodiment of the disclosure;
FIG. 9 is a schematic diagram of a rectangular side region provided by an embodiment of the present disclosure;
FIG. 10 is a schematic illustration of a break in a rectangular edge region provided by an embodiment of the present disclosure;
FIG. 11A is a schematic diagram of an endpoint location provided by an embodiment of the present disclosure;
FIG. 11B is a schematic diagram of an endpoint location provided by an embodiment of the present disclosure;
fig. 12A is a schematic diagram of a rectangular edge region after a masking process according to an embodiment of the disclosure;
FIG. 12B is a schematic diagram illustrating an endpoint location provided by an embodiment of the present disclosure;
fig. 13 is a schematic structural diagram illustrating a defect detection apparatus according to an embodiment of the present disclosure;
fig. 14 is a hardware entity diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
For the purpose of making the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure are further elaborated with reference to the drawings and the embodiments, the described embodiments should not be construed as limiting the present disclosure, and all other embodiments obtained by a person of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present disclosure.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. Reference to the terms "first/second/third" merely distinguishes similar objects and does not denote a particular ordering for the objects, and it is understood that "first/second/third" may, where permissible, be interchanged in a particular order or sequence so that embodiments of the present disclosure described herein can be practiced other than as specifically illustrated or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing the disclosure only and is not intended to be limiting of the disclosure.
Embodiments of the present disclosure provide a method of defect detection that may be performed by a processor of a computer device. The computer device may be a server, a notebook computer, a tablet computer, a desktop computer, a mobile device (e.g., a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable game device), or other devices with defect detection capabilities. Fig. 1 is a schematic view of an implementation flow of a defect detection method provided in an embodiment of the present disclosure, and as shown in fig. 1, the method includes the following steps S101 to S103:
and S101, acquiring a current display image of the display device to be tested.
Here, the device to be displayed may refer to a display screen for displaying an image, such as a mobile phone display screen, a computer display screen, a television display screen, and the like; the type of the display screen is not limited herein, and may be, for example, a mirror image display, a liquid crystal display, or the like. The current display image is obtained by the to-be-displayed device by displaying the standard graph, and the current display image may refer to an image displayed by the to-be-displayed device, for example, an image currently displayed on a display screen. The standard graph may refer to a two-dimensional space which may be defined by a contour to form a plurality of spatial shapes, such as a circle, a polygon, and the like. For example: the standard graph is an ellipse, the major axis of the ellipse is 15 cm, and the minor axis of the ellipse is 8 cm; controlling the television display screen to display an ellipse with a long axis of 15 cm and a short axis of 8 cm through a control instruction, wherein the current display image of the television display screen can be an ellipse with a long axis of 15 cm and a short axis of 8 cm; the edge of the ellipse can be white, and other parts of the television display screen can display black; due to the quality of a television display screen and other problems, an ellipse in a currently displayed image may have defects, so that the ellipse is not standard, for example, a part of an edge of the ellipse is not displayed, the ellipse is distorted, and the like.
In the implementation process of step S101, the method may include: shooting a device to be displayed by using a preset image acquisition device such as a camera and the like to obtain a current display image in a state to be displayed; the currently displayed image may be a color image, a grayscale image, or the like, but is not limited thereto.
And S102, determining a display frame of the standard graph from the current display image.
Here, in the currently displayed image, the standard graph is displayed in a display frame, that is, the display frame may refer to the standard graph in the currently displayed image; in the actual display process of the device to be displayed, due to factors such as a gap existing between the display screen of the device to be displayed and the outer frame, the actually displayed display frame and the preset standard graph have shape difference, for example, the display frame has a gap, and the display frame is distorted; here, the detection result may be obtained by detecting a defect of the display frame, and whether the device to be displayed has a defect and information such as a position of the defect may be determined according to the detection result of the display frame. The step S102 includes: determining a matching template corresponding to the standard graph; matching the current display image based on the matching template to obtain a matching result; the matching result comprises position information of a display frame; based on the matching result, the current display image is cut to obtain a display frame corresponding to the standard image, and the influence of factors such as other noises in the current display image on the defect detection of the display frame is eliminated.
And S103, detecting the defects of the display device to be detected based on the geometric characteristics of the display frame to obtain a detection result of the display device to be detected.
Here, the defect detection result of the display bezel may be determined as a defect detection result of the device to be displayed, the detection result including whether the device to be displayed has a defect, and location information of the defect in a case where the defect is detected. The geometric features of the display bezel include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of the end points in the display frame. The position relation of the endpoints in the display frame comprises the number of the endpoints, whether the endpoints belong to the same straight line, and the like, for example, whether the endpoint of a certain frame of the display frame belongs to the same connected domain, and if the endpoint belongs to the same connected domain, the frame is determined to be continuous; if not, the frame is determined to be discontinuous. For example: the standard graph is rectangular, so that the geometric characteristics of the display frame can be subjected to linear detection to obtain a plurality of frames of the display frame, and the included angle of the display frame is determined based on the slope of each frame; the end point detection can be carried out on the display frame to determine whether the frame is continuous or not; the number of pixel points corresponding to the display frame can be counted, and the number of the pixel points is determined as the frame area of the display frame and the like; if the area of the frame is smaller than the preset threshold, it may be determined that the display frame has a defect, if the included angle of the display frame is smaller than 90 degrees, it may be determined that the display frame has a defect, if a certain frame of the display frame has a plurality of end points (for example, 5 end points), it may be determined that the frame is discontinuous, and the position of the defect is the coordinate of the end point.
In the embodiment of the disclosure, firstly, a current display image of a display device to be tested is obtained; the current display image is obtained by the display device to be tested through displaying a standard graph; and determining the display frame of the standard graph from the current display image. In this way, the display frame generated by the device to be displayed by displaying the standard graph can be quickly acquired, and then whether the device to be displayed has defects or the like can be determined by determining the integrity of the display frame. Then, based on the geometric characteristics of the display frame, defect detection is carried out on the display device to be detected, and the detection result of the display device to be detected is obtained quickly and accurately; the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of the end points in the display frame. Therefore, the defect detection can be accurately realized, and the position of the defect can be accurately determined under the condition that the defect exists, so that the defect detection efficiency, the defect detection precision and the like of the device to be displayed can be improved.
The embodiment of the present disclosure provides a defect detection method, as shown in fig. 2, the method includes the following steps S201 to S204:
steps S201 to S202 correspond to steps S101 to S102, respectively, and specific embodiments of steps S101 to S102 may be referred to in implementation.
Step S203, performing first detection on the display device to be detected based on the display area of the display frame to obtain a detection result of whether the display device to be detected has defects.
Here, a pixel area a corresponding to the standard pattern may be set in advance, and an appropriate area range may be set based on the pixel area, for example, the area range may be 0.5A to 2A or the like. The number of the pixels of the display frame can be obtained by counting the pixels represented by the display frame, and the number of the pixels is determined as the display area of the display frame; if the display area exceeds the preset area range, the defect of the display frame can be preliminarily determined; if the display area does not exceed the preset area range, the display frame may have a defect or may not have a defect, and the display frame needs to be further detected.
And S204, performing secondary detection on the display device to be detected based on the included angle of the display frame and the position relation of the end points in the display frame under the condition that the display area of the display frame belongs to a preset area range, so as to obtain the position information of the defect under the condition that the defect exists.
Here, an angle range may be set in advance, and if the included angle of the display frame belongs to the angle range, it is determined that there is no defect in the included angle. Taking an angle range of 88 degrees to 92 degrees as an example for explanation, if the display area of the display frame does not exceed the preset area range and the included angle of the display frame is 70 degrees, it can be determined that the included angle of the display frame has a defect, and the position of the defect is the position of the included angle; if the display area of the display frame does not exceed the preset area range and the included angle of the display frame is 91 degrees, determining that the included angle of the display frame has no defect; if the display area of the display frame does not exceed the preset area range and the number of the endpoints in the lower frame of the display frame is 4, the lower frame can be determined to be discontinuous, the lower frame has defects, and the positions of the defects are coordinates of the endpoints; if the display area of the display frame does not exceed the preset area range and the number of the endpoints in the upper frame of the display frame is 2, it can be determined that the upper frame is continuous and the upper frame has no defects.
In the embodiment of the disclosure, firstly, whether a device to be displayed has defects or not can be preliminarily determined by quickly and simply determining the display area of the display frame based on the display area; and then accurately determining whether the device to be displayed has defects or not and the positions of the defects under the condition of the defects by using the position relation between the included angle of the display frame and the end point.
In some embodiments, the acquisition information is at a first application layer; the step S204 may include the following steps S2041 to S2043:
step S2041, determining the corner points of the display frame based on the coordinates of the pixel points in the display frame.
Here, the standard graphics are described as rectangles, and the display frame may be handled as a rectangle. Therefore, the display frame has four corner points, the first corner point is positioned at the upper left corner of the display frame, and the abscissa and the ordinate of the first corner point are minimum; the second corner point is positioned at the upper right corner of the display frame, and the abscissa and the ordinate of the second corner point are the largest and the smallest; the third corner is positioned at the lower right corner of the display frame, and the abscissa and the ordinate of the third corner are the maximum; the fourth corner point is positioned at the lower left corner of the display frame, and the abscissa of the fourth corner point is minimum, and the ordinate of the fourth corner point is maximum. According to the characteristics of the abscissa and the ordinate of each corner point, each corner point can be quickly and accurately determined from all pixel points in the display frame.
Step S2042, based on the angular points, determining included angles between adjacent frames in the display frames.
Here, the first edge of the first included angle may be obtained by connecting based on the first corner point and the second corner point; connecting the first corner point and the fourth corner point to obtain a second edge of the first included angle; the slope of the first side may be determined based on the coordinates of the first corner point and the coordinates of the second corner point, and the slope of the second side may be determined based on the coordinates of the first corner point and the coordinates of the fourth corner point; a first angle between the first edge and the second edge is determined based on the slope of the first edge and the slope of the second edge.
Step S2043, determining that the display device to be tested has corner point defects under the condition that the included angle is larger than the angle threshold.
Here, the corner defect may refer to a defect at a corner, for example, an angle of an included angle corresponding to the corner is too large. If the standard graph is rectangular, the angle threshold value can be 93 degrees, and the like, and if the first included angle is 100 degrees, it can be determined that the first included angle has a defect, that is, the device to be displayed has an angular point defect; the coordinates of the corner point with the corner point defect can obtain the position information of the corner point defect, for example, the coordinates of the first end point corresponding to the first included angle are determined as the position information of the corner point defect.
In the embodiment of the disclosure, the angle of the display frame can be accurately determined by determining the angle point of the display frame, and then whether the device to be displayed has the angle point defect or not can be quickly and accurately judged.
In some embodiments, the standard pattern is a rectangle with diagonal lines; the above step S211 may include the following step S213:
step S211, when the included angle is smaller than or equal to the angle threshold, acquiring a rectangular frame region of the rectangle from the current display image based on the coordinates of the corner point.
Here, the rectangular bounding box region may refer to a region including a certain bounding box of a rectangle, not a region including the entire rectangle, such as an upper bounding box region, a lower bounding box region, a left bounding box region, and a right bounding box region. If the included angle is determined to be smaller than or equal to the angle threshold, it can be determined that the display frame has no corner defect, and then a rectangular frame region of a rectangle can be obtained from the current display image based on the coordinates of the corner of the display frame, due to subsequent defect detection. For example: determining the length of the rectangular frame area (namely, the upper frame area) based on the coordinates of the first endpoint and the second endpoint; acquiring a top border area of the display border from the current display image based on the length and the preset width; determining the width of the rectangular frame area (namely the left frame area) based on the coordinates of the first endpoint and the fourth endpoint; and acquiring a left frame area of the display frame from the current display image based on the width and the preset length.
In step S212, a first endpoint and a second endpoint are determined from the rectangular frame region.
Here, the first endpoint and the second endpoint are located on the same rectangular side of the rectangle, and the distance between the first endpoint and the second endpoint is the minimum distance between the endpoints on the same rectangular side of the rectangle, that is, the first endpoint and the second endpoint are the endpoints on a certain border on the display border.
Step S213, determining that the display device to be tested has a frame defect when the first endpoint and the second endpoint belong to different connected domains in the rectangular frame region.
Here, the bezel defect may refer to a bezel discontinuity or the like. The connected domain in the rectangular frame region can be counted again, and if the first end point and the second end point belong to the same connected domain, the continuous frames in the rectangular frame region are determined, and no defect exists; and if the first end point and the second end point belong to different connected domains, determining that the frame in the rectangular frame region is discontinuous and has frame defects. The coordinates of the first endpoint and the coordinates of the second endpoint can obtain the position information of the frame defect, for example, the coordinates of the second endpoint of the coordinates of the first endpoint may be determined as the position information of the frame defect.
In the embodiment of the present disclosure, it is determined whether the first endpoint and the second endpoint belong to the same connected domain, and whether a certain frame of the display frame has a frame defect, and position information of the frame defect in the case of the frame defect, and the like are accurately determined.
In some embodiments, the step S2141 may include the following steps S221 to S223:
step S221, performing image masking on the rectangular frame region to obtain a masked rectangular frame region.
Here, the Mask (Mask) may refer to a selected image, graphic or object, which is used to block (wholly or partially) the image of fig. 5 to be processed to control the image processing area or process; wherein the particular image or object used for overlay is referred to as a mask or template. Since the standard graph is a rectangle with diagonal lines, in order to obtain the end points on the display frame, the end points on the diagonal lines need to be excluded. The rectangular frame region can be subjected to image masking processing, diagonal lines are filtered out, and the masked rectangular frame region is obtained.
Step S222, acquiring all endpoints of the rectangular edge in the masked rectangular frame region.
0 here, the endpoint, which is the display, can be directly obtained from the rectangular frame region after the mask processing
The end points of a certain border in the border, but not the end points of other areas (e.g., end points on the diagonal).
Step S223, determining two endpoints with the minimum distance among all endpoints of the rectangular side as the first endpoint and the second endpoint.
Here, based on the coordinates of each end point, two 5 end points having the smallest distance are obtained from all the end points of the sides of the rectangle, and the two end points are determined as a first end point and a second end point.
In the embodiment of the disclosure, the image mask processing is performed on the rectangular frame region, so that diagonal lines in a rectangle can be simply and quickly filtered, and then the first endpoint and the second endpoint can be quickly and accurately determined.
The embodiment of the present disclosure provides a defect detection method, as shown in fig. 3, the method includes the following steps 0S301 to S304:
steps S301 to S302 correspond to steps S101 to S102, respectively, and specific embodiments of steps S101 to S102 may be referred to in the implementation.
Step S303, performing connected domain statistics on the current display image to obtain the pixel number of pixel points on the display frame, and determining the pixel number as the display area of the display frame.
Here, if the current display image is a binary image, a connected domain statistical method in an 8-neighborhood mode can be adopted
The method determines all connected domains in the current display image, determines the region with the largest connected domain as a display frame, and can determine the number of pixel points in the connected domain as the area of the display frame.
Step S304, determining that the display device to be tested has defects under the condition that the display area of the display frame does not belong to the preset area range.
Here, if the display area of the display frame does not belong to the preset area range, that is, the display area is too large or too small, it can be easily determined that the device to be displayed has a broken display, or has a defect such as a mask.
In the embodiment of the disclosure, the display frame can be accurately identified in a connected domain statistical manner, the display area of the display frame is determined, and then whether the device to be displayed is determined quickly and simply based on the display area.
The embodiment of the present disclosure provides a defect detection method, where the current display image is a grayscale image; as shown in fig. 4, the method includes steps S401 to S405 as follows:
step S401 corresponds to step S101, and reference may be made to the specific implementation of step S101; step S405 corresponds to step S103, and reference may be made to a specific implementation of step S103.
And step S402, carrying out binarization processing on the current display image to obtain a binarized image.
Here, if the acquired current display image is a color image, the color image may be converted into a grayscale image, and then the grayscale image is binarized to obtain a binarized image, for example, the pixel value of the pixel point with the grayscale value greater than 10 is adjusted to 255, and the pixel value of the pixel point with the grayscale value less than or equal to 10 is adjusted to 0.
And step S403, acquiring a connected domain of a preset gray value in the binarized image.
Here, if the display frame displayed by the device to be displayed is white and other areas display black, the connected domain of the pixel point with the pixel value of 255 in the binarized image may be obtained by using an 8-field method.
And S404, determining the connected domain with the largest area as the display frame of the standard graph.
Here, since the device to be displayed may acquire a plurality of connected domains due to noise and other factors during displaying the standard graph, here, the connected domain with the largest area may be determined as the display frame of the standard graph, and other connected domains with smaller areas may be determined as noise.
In the embodiment of the disclosure, through the connected domain statistical mode, the display frame can be quickly and simply screened out from the current display image, and the defect detection efficiency of the device to be displayed is improved.
The application of the defect detection method provided by the embodiment of the present disclosure in an actual scene is described below, taking a device to be displayed as a computer display screen and a scene in which a standard graph is a rectangle with diagonal lines as an example. As shown in fig. 5A, it represents a current display image displayed when the display screen is normal and there is no defect in the diagonal line portion; as shown in fig. 5B, the current display image displayed when the display screen is normal indicates that the diagonal portion has a defect; in the defect detection process of the display screen, as long as four sides of the rectangular frame are not missing and are continuous, the fact that the outer frame of the display screen is not missing is represented, and whether the x line segment (the diagonal line of the rectangle) is missing or not is interference information in the detection process. As shown in fig. 5C, it indicates that there is no defect in the diagonal portion, the current display image displayed when there is a defect in the display screen, and there is a defect in the left side of the rectangle, which may indicate that there is a defect in the left portion of the display screen; as shown in fig. 5D, the fact that the diagonal portion is defective, the current display image displayed when the display screen is defective, and the fact that the lower side of the rectangle is defective may indicate that the lower side portion of the display screen is defective.
An embodiment of the present disclosure provides a defect detection method, as shown in fig. 6, the method may include the following steps S601 to S612:
step S601, acquiring a current display image of the display screen.
Here, the currently displayed image of the display screen in the specific photographing mode may be acquired by the camera, and the currently displayed image may be a grayscale image.
Step S602, a display frame is obtained from the current display image.
Here, the binarization processing may be performed on the current display image to obtain a binarized display image, the connected domain screening may be performed on the binarized display image, the connected domain with the largest area is determined as the display frame, and it is only necessary to determine whether four edges of the display frame have defects in the following process. As shown in fig. 7, connected component statistics can be performed by using connected components corresponding to 8 fields, and it can be seen that the connected components are all 1 components of 3 × 3, which means that as long as the pixel values of two pixels in the currently displayed image are the same and the two pixels are adjacent, the two pixels are considered to be in the same connected component region, where the adjacent positions include upper, lower, left, right, upper left, lower left, upper right, and lower right.
Step S603, determining whether the display area of the display frame belongs to a preset area range.
Here, if it is determined that the number of pixels corresponding to the rectangle with diagonal lines is T, the area may be in a range of 0.5T to 2T. Determining the number of the pixel points of the display frame as the display area of the display frame, and then determining whether the pixel area belongs to a preset area range, if so, entering step S604; if not, the process proceeds to step S612.
Step S604, obtaining corner points of the display frame, and determining included angles of the display frame based on the corner points.
Here, the corner points of the display frame may be determined based on the characteristics of the coordinates of the corner points in the rectangle, and then the included angle of the display frame may be determined based on all the corner points. As shown in fig. 8A, the upper left and lower right corner points of the rectangle may be located by 45 degree tangents.
In step S605, it is determined whether the included angle is less than or equal to the angle threshold.
Here, if the standard graph is a rectangle, the angle threshold may be 92 degrees, and if the included angle is smaller than or equal to the angle threshold, the process proceeds to step S606; if the included angle is greater than the angle threshold, the process proceeds to step S610. As shown in fig. 8B, the missing display frame in the upper right corner is represented.
Step S606, acquiring a rectangular frame region of the display frame based on the corner points of the display frame.
Here, the rectangular side region of each rectangular side of the display frame may be determined based on the coordinates of each corner point. As shown in fig. 9, the upper edge region may be acquired based on the first corner point and the second corner point of the display bezel. After the rectangular frame region is obtained, it is necessary to determine whether the edge of the display frame is complete, as shown in fig. 10, which indicates that the upper edge is broken.
Step S607, a mask process is performed on the rectangular frame region to obtain an end point of the rectangular frame region.
Here, as shown in fig. 11A, two end points that may be acquired do not belong to the end points on the rectangular side. As shown in fig. 11B, the acquired end points are located on the rectangular side, and it is determined whether the two end points belong to the same connected region. The end point of the rectangular frame area can be quickly and accurately acquired by performing mask processing on the rectangular frame area. As shown in fig. 12A, a rectangular frame region after mask processing is shown; as shown in fig. 12B, the end points of the acquired rectangular bounding box region are indicated. In the process of obtaining the end point, fast traversal can be performed according to the position of the rectangular edge to obtain the end point of the rectangular frame area, for example, according to whether the edge is the upper edge, the lower edge, the left edge, the right edge or the left edge, right edge traversal and upper edge, the end point is located, if the fracture occurs on the upper edge of the rectangle, the left point of the fracture can be obtained firstly, and then the right point is obtained through a traversal mode from left to right in a column form.
In step S608, it is determined whether the endpoints of the rectangular bounding box region belong to the same connected domain.
Here, the connected domain statistics is performed again on the rectangular frame region, and if the endpoints of the rectangular frame region belong to the same connected domain, the step S609 is performed; if the end points of the rectangular frame region do not belong to the same connected domain, the process proceeds to step S611.
And step S609, determining that the frame is complete.
If the display area of the display frame is determined to belong to the preset area range, the included angle of the display frame meets the angle threshold value, and the end points of the display frame belong to the same connected region, the frame of the display screen is determined to be complete.
Step S610 determines the position of the corner defect.
Here, the coordinates of the corner points may be determined as the locations of the corner point defects.
In step S611, the position of the frame defect is determined.
Here, the coordinates of the end point may be determined as the location of the bezel defect.
Step S612, determining that the frame has a defect.
Here, if the display area of the display frame does not satisfy the preset area range, it is determined that the frame of the display screen has a defect.
In the related technology, for the frame defects caused by poor assembly and offset of the display screen, the defects are difficult to find out by adopting a manual detection mode, in the embodiment of the disclosure, the missing rate can be effectively reduced and the labor cost is saved by acquiring the current display image of the display screen and then carrying out defect detection on the display frame in the current display image; meanwhile, most of production workshops of the display screen adopt a pipeline operation mode, and an automatic processing method is used, so that the overall production efficiency of a production line can be effectively improved.
Based on the foregoing embodiments, the present disclosure provides a defect detection apparatus, which includes units and modules included in the units, and can be implemented by a processor in a computer device; of course, the implementation can also be realized through a specific logic circuit; in the implementation process, the processor may be a Central Processing Unit (CPU), a microprocessor unit (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 13 is a schematic structural diagram of a defect detection apparatus according to an embodiment of the present disclosure, and as shown in fig. 13, a defect detection apparatus 1300 includes: an acquisition module 1310, a determination module 1320, and a detection module 1330, wherein:
an obtaining module 1310, configured to obtain a current display image of a display device to be tested; the current display image is obtained by the display device to be tested through displaying a preset standard graph; a determining module 1320, configured to determine a display frame of the standard graph from the currently displayed image; a detection module 1330, configured to perform defect detection on the display device to be detected based on the geometric features of the display frame, so as to obtain a detection result of the display device to be detected; the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of the endpoints in the display frame.
In some embodiments, the detection module is further configured to: performing first detection on the display device to be detected based on the display area of the display frame to obtain a detection result of whether the display device to be detected has defects; and under the condition that the display area of the display frame belongs to a preset area range, carrying out secondary detection on the display device to be detected based on the included angle of the display frame and the position relation of the end points in the display frame so as to obtain the position information of the defect under the condition that the defect exists.
In some embodiments, the detection module is further configured to: performing connected domain statistics on the current display image to obtain the pixel number of pixel points on the display frame, and determining the pixel number as the display area of the display frame; and determining that the display device to be tested has defects under the condition that the display area of the display frame does not belong to the preset area range.
In some embodiments, the detection module is further configured to: determining the corner points of the display frame based on the coordinates of the pixel points in the display frame; determining an included angle between adjacent frames in the display frames based on the angular points; and under the condition that the included angle is larger than the angle threshold value, determining that the display device to be tested has corner defects, wherein the position information of the corner defects can be obtained by the corner coordinates with the corner defects.
In some embodiments, the standard pattern is a rectangle with diagonal lines; the detection module is further configured to: under the condition that the included angle is smaller than or equal to the angle threshold, acquiring a rectangular frame area of the rectangle from the current display image based on the coordinates of the corner points; determining a first endpoint and a second endpoint from the rectangular border region; the first end point and the second end point are positioned on the same rectangular side of the rectangle, and the distance between the first end point and the second end point is the minimum distance between all the end points on the same rectangular side of the rectangle; and under the condition that the first end point and the second end point belong to different connected domains in the rectangular frame region, determining that the display device to be tested has frame defects, wherein the position information of the frame defects can be obtained by the coordinates of the first end point and the coordinates of the second end point.
In some embodiments, the detection module is further configured to: performing image masking processing on the rectangular frame region to obtain a masked rectangular frame region; acquiring all endpoints of the rectangular side in the masked rectangular frame region; and determining two end points with the minimum distance in all end points of the rectangular side as the first end point and the second end point.
In some embodiments, the currently displayed image is a grayscale image; the determining module is further configured to: carrying out binarization processing on the current display image to obtain a binarization image; acquiring a connected domain of a preset gray value in the binary image; and determining the connected domain with the largest area as the display frame of the standard graph.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to perform the methods described in the above method embodiments, and for technical details not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.
It should be noted that, in the embodiment of the present disclosure, if the defect detection method is implemented in the form of a software functional module and is sold or used as a standalone product, the defect detection method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the present disclosure are not limited to any specific hardware, software, or firmware, or any combination thereof.
The embodiment of the present disclosure provides a computer device, which includes a memory and a processor, where the memory stores a computer program that can be run on the processor, and the processor implements some or all of the steps of the above method when executing the program.
The disclosed embodiments provide a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, performs some or all of the steps of the above-described method. The computer readable storage medium may be transitory or non-transitory.
The disclosed embodiments provide a computer program comprising computer readable code, where the computer readable code runs in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
The disclosed embodiments provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program that when read and executed by a computer performs some or all of the steps of the above method. The computer program product may be embodied in hardware, software or a combination thereof. In some embodiments, the computer program product is embodied in a computer storage medium, and in other embodiments, the computer program product is embodied in a software product, such as a Software Development Kit (SDK), or the like.
Here, it should be noted that: the foregoing description of the various embodiments is intended to highlight various differences between the embodiments, which are the same or similar and all of which are referenced. The above description of the apparatus, storage medium, computer program and computer program product embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the disclosed apparatus, storage medium, computer program and computer program product, reference is made to the description of the embodiments of the method of the present disclosure for understanding.
It should be noted that fig. 14 is a schematic hardware entity diagram of a computer device in an embodiment of the present disclosure, and as shown in fig. 14, the hardware entity of the computer device 1400 includes: a processor 1401, a communications interface 1402, and a memory 1403, wherein:
the processor 1401 generally controls the overall operation of the computer apparatus 1400.
The communication interface 1402 may enable the computer device to communicate with other terminals or servers via a network.
The memory 1403 is configured to store instructions and applications executable by the processor 1401, and may also buffer data to be processed or already processed by the processor 1401 and modules in the computer device 1400 (e.g., image data, audio data, voice communication data, and video communication data), and may be implemented by a FLASH memory (FLASH) or a Random Access Memory (RAM). Data transfer between the processor 1401, the communication interface 1402, and the memory 1403 can be performed via a bus 1404.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present disclosure. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present disclosure, the sequence numbers of the above steps/processes do not mean the execution sequence, and the execution sequence of each step/process should be determined by the function and the inherent logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure. The above-mentioned serial numbers of the embodiments of the present disclosure are merely for description and do not represent the merits of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one of 8230, and" comprising 8230does not exclude the presence of additional like elements in a process, method, article, or apparatus comprising the element.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit of the present disclosure may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present disclosure. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The methods disclosed in the several method embodiments provided in this disclosure may be combined arbitrarily without conflict to arrive at new method embodiments.
If the disclosed embodiment relates to personal information, a product applying the disclosed embodiment has been explicitly informed of personal information processing rules before processing the personal information, and obtains personal autonomous consent. If the disclosed embodiment relates to sensitive personal information, the product applying the disclosed embodiment obtains individual consent before processing the sensitive personal information, and simultaneously meets the requirement of 'express consent'.
The above description is only an embodiment of the present disclosure, but the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present disclosure, and all the changes or substitutions should be covered by the scope of the present disclosure.
Claims (10)
1. A method of defect detection, comprising:
acquiring a current display image of a display device to be tested; the current display image is obtained by the display device to be tested through displaying a standard graph;
determining a display frame of the standard graph from the current display image;
based on the geometric characteristics of the display frame, performing defect detection on the display device to be detected to obtain a detection result of the display device to be detected;
the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of the endpoints in the display frame.
2. The method according to claim 1, wherein the performing defect detection on the display device to be detected based on the geometric features of the display frame to obtain a detection result of the display device to be detected comprises:
performing first detection on the display device to be detected based on the display area of the display frame to obtain a detection result of whether the display device to be detected has defects;
and under the condition that the display area of the display frame belongs to a preset area range, carrying out secondary detection on the display device to be detected based on the included angle of the display frame and the position relation of the end points in the display frame so as to obtain the position information of the defect under the condition that the defect exists.
3. The method according to claim 2, wherein the detecting the defect of the display device to be detected based on the geometric features of the display frame to obtain a detection result of the display device to be detected, further comprises:
performing connected domain statistics on the current display image to obtain the number of pixels of pixel points on the display frame, and determining the number of pixels as the display area of the display frame;
and determining that the display device to be tested has defects under the condition that the display area of the display frame does not belong to the preset area range.
4. The method according to claim 2, wherein the second detecting the display device to be detected based on the included angle of the display frame and the position relationship between the end points in the display frame to obtain the position information of the defect when the defect exists comprises:
determining the corner points of the display frame based on the coordinates of the pixel points in the display frame;
determining an included angle between adjacent frames in the display frames based on the angular points;
and under the condition that the included angle is larger than the angle threshold value, determining that the display device to be tested has the corner defect, wherein the position information of the corner defect can be obtained by the corner coordinate with the corner defect.
5. The method of claim 4, wherein the standard pattern is a rectangle having diagonal lines; based on the included angle of the display frame and the position relation of the end points in the display frame, the display device to be detected is subjected to secondary detection to obtain the position information of the defect under the condition that the defect exists, and the method comprises the following steps:
under the condition that the included angle is smaller than or equal to the angle threshold, acquiring a rectangular frame area of the rectangle from the current display image based on the coordinates of the corner points;
determining a first endpoint and a second endpoint from the rectangular border region; the first end point and the second end point are located on the same rectangular side of the rectangle, and the distance between the first end point and the second end point is the minimum distance between all the end points on the same rectangular side of the rectangle;
and under the condition that the first end point and the second end point belong to different connected domains in the rectangular frame region, determining that the display device to be tested has frame defects, wherein the position information of the frame defects can be obtained by the coordinates of the first end point and the coordinates of the second end point.
6. The method of claim 5, wherein determining the first endpoint and the second endpoint from the rectangular bounding box region comprises:
carrying out image masking processing on the rectangular frame region to obtain a masked rectangular frame region;
acquiring all endpoints of the rectangular side in the masked rectangular frame region;
and determining two end points with the minimum distance in all end points of the rectangular side as the first end point and the second end point.
7. The method according to any one of claims 1 to 6, wherein the currently displayed image is a grayscale image; the determining a display frame of the standard graph from the current display image includes:
carrying out binarization processing on the current display image to obtain a binarization image;
acquiring a connected domain of a preset gray value in the binary image;
and determining the connected domain with the largest area as the display frame of the standard graph.
8. A defect detection apparatus, comprising:
the acquisition module is used for acquiring a current display image of the display device to be detected; the current display image is obtained by the display device to be tested through displaying a preset standard graph;
the determining module is used for determining a display frame of the standard graph from the current display image;
the detection module is used for detecting the defects of the display device to be detected based on the geometric characteristics of the display frame to obtain the detection result of the display device to be detected;
the detection result comprises whether the display device to be detected has defects or not and position information of the defects under the condition that the defects are detected; the geometric features include at least one of: the display area of the display frame, the included angle of the display frame and the position relation of the endpoints in the display frame.
9. A computer device comprising a memory and a processor, the memory storing a computer program operable on the processor, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211741907.4A CN115965608A (en) | 2022-12-30 | 2022-12-30 | Defect detection method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211741907.4A CN115965608A (en) | 2022-12-30 | 2022-12-30 | Defect detection method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115965608A true CN115965608A (en) | 2023-04-14 |
Family
ID=87361196
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211741907.4A Pending CN115965608A (en) | 2022-12-30 | 2022-12-30 | Defect detection method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115965608A (en) |
-
2022
- 2022-12-30 CN CN202211741907.4A patent/CN115965608A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190197735A1 (en) | Method and apparatus for image processing, and robot using the same | |
CN111340752A (en) | Screen detection method and device, electronic equipment and computer readable storage medium | |
CN110766679B (en) | Lens contamination detection method and device and terminal equipment | |
CN111598091A (en) | Image recognition method and device, electronic equipment and computer readable storage medium | |
US11403819B2 (en) | Three-dimensional model processing method, electronic device, and readable storage medium | |
CN115908269B (en) | Visual defect detection method, visual defect detection device, storage medium and computer equipment | |
CN110827244A (en) | Method and equipment for detecting appearance flaws of electronic equipment | |
CN110827288B (en) | Method and device for extracting target image in projector definition test | |
CN113781406B (en) | Scratch detection method and device for electronic component and computer equipment | |
CN115631117A (en) | Image enhancement method, device, detection system and storage medium for defect detection | |
CN111415300A (en) | Splicing method and system for panoramic image | |
CN112634235A (en) | Product image boundary detection method and electronic equipment | |
CN113487478A (en) | Image processing method, image processing device, storage medium and electronic equipment | |
US11127141B2 (en) | Image processing apparatus, image processing method, and a non-transitory computer readable storage medium | |
CN114298985B (en) | Defect detection method, device, equipment and storage medium | |
CN116503414A (en) | Screen defect detection method, device, computer equipment and storage medium | |
CN114937003A (en) | Multi-type defect detection system and method for glass panel | |
CN114359161A (en) | Defect detection method, device, equipment and storage medium | |
CN112149745B (en) | Method, device, equipment and storage medium for determining difficult example sample | |
CN113658196A (en) | Method and device for detecting ship in infrared image, electronic equipment and medium | |
CN110310341B (en) | Method, device, equipment and storage medium for generating default parameters in color algorithm | |
WO2024016715A1 (en) | Method and apparatus for testing imaging consistency of system, and computer storage medium | |
JP2016197377A (en) | Computer program for image correction, image correction device, and image correction method | |
CN116993654B (en) | Camera module defect detection method, device, equipment, storage medium and product | |
CN115965608A (en) | Defect detection method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |