Disclosure of Invention
The application provides a liquid crystal display edge broken line detection method based on gradient transformation, which aims to solve the problem that the broken line defect at the edge position of the liquid crystal display is easy to cause missed detection or false detection in the prior art.
The application provides a liquid crystal display edge broken line detection method based on gradient transformation, which specifically comprises the following steps:
carrying out unidirectional gray scale gradient transformation on the edge position image of the liquid crystal screen;
carrying out background construction on the edge position image after gray level gradient transformation;
carrying out background difference on the edge position image after the background construction;
extracting end points in the edge position image after background difference;
calculating a neighborhood gray difference value of the end point;
determining an endpoint type of the endpoint according to the neighborhood gray scale difference, wherein the neighborhood gray scale difference comprises a gray scale difference between an upper neighborhood and a lower neighborhood of the endpoint or a gray scale difference between a left neighborhood and a right neighborhood of the endpoint, and the endpoint type comprises a bright broken line starting point, a bright broken line terminal point, a dark broken line starting point and a dark broken line terminal point;
and matching the end points on the same straight line according to the end point types, and determining the edge broken line position of the liquid crystal display, wherein the edge broken line position comprises a broken line starting point, a broken line terminal point and a broken line coordinate.
In a preferred embodiment of the present application, determining the endpoint type of the endpoint according to the neighborhood gray scale difference value includes:
if the gray level of the upper neighborhood of the endpoint in the Y direction is smaller than the gray level of the lower neighborhood, calculating the gray level difference value between the gray level of the lower neighborhood of the endpoint and the gray level of the right neighborhood of the lower neighborhood;
comparing the gray difference value between the gray level of the lower neighborhood of the endpoint and the gray level of the right neighborhood of the lower neighborhood with a preset gray level difference threshold value of a bright broken line;
and if the gray difference value between the gray level of the lower neighborhood of the endpoint and the gray level of the right neighborhood of the lower neighborhood meets the preset gray level difference threshold value of the broken line, judging that the endpoint is the starting point of the broken line and recording.
In a preferred embodiment of the present application, comparing a gray difference between the gray levels of the lower neighborhood of the endpoint and the gray level of the right neighborhood of the lower neighborhood with a preset gray difference threshold of the bright break line, further includes:
if the gray difference value between the gray level of the lower neighborhood of the endpoint and the gray level of the right neighborhood of the lower neighborhood does not meet the preset gray difference threshold value of the broken line, calculating the gray difference value between the gray level of the upper neighborhood of the endpoint and the gray level of the lower neighborhood of the endpoint;
comparing the gray difference value between the upper neighborhood gray scale and the lower neighborhood gray scale of the endpoint with a preset gray difference threshold value of the dark broken line;
and if the gray difference value between the upper neighborhood gray scale and the lower neighborhood gray scale of the endpoint meets the preset gray difference threshold value of the dark broken line, judging the endpoint to be the end point of the dark broken line and recording.
In a preferred embodiment of the present application, determining the endpoint type of the endpoint according to the neighborhood grayscale difference further includes:
if the gray scale of the upper neighborhood of the endpoint in the Y direction is larger than the gray scale of the lower neighborhood, calculating the gray scale difference value between the gray scale of the upper neighborhood of the endpoint and the gray scale of the right neighborhood of the upper neighborhood;
comparing the gray difference value between the gray levels of the adjacent domains on the end point and the gray level of the right adjacent domain of the upper adjacent domain with a preset gray difference threshold value of a bright broken line;
and if the gray difference value between the gray level of the neighborhood on the endpoint and the gray level of the right neighborhood on the upper neighborhood meets the preset gray level difference threshold value of the broken line, judging the endpoint to be the broken line endpoint and recording.
In a preferred embodiment of the present application, comparing a gray difference between the gray levels of the neighboring regions at the end point and the gray level of the right neighboring region of the neighboring region with a preset gray difference threshold of the bright break line, further includes:
if the gray difference value between the gray scale of the upper neighborhood of the endpoint and the gray scale of the right neighborhood of the upper neighborhood does not meet the preset gray difference threshold value of the bright break line, calculating the gray difference value between the gray scale of the upper neighborhood of the endpoint and the gray scale of the lower neighborhood of the endpoint;
comparing the gray difference value between the upper neighborhood gray scale and the lower neighborhood gray scale of the endpoint with a preset gray difference threshold value of the dark broken line;
and if the gray difference value between the upper neighborhood gray scale and the lower neighborhood gray scale of the endpoint meets the preset gray difference threshold value of the dark broken line, judging the endpoint to be the starting point of the dark broken line and recording.
In a preferred embodiment of the present application, matching the endpoints on the same straight line according to the endpoint types to determine an edge disconnection position of the liquid crystal display specifically includes:
traversing the starting point of the bright break line and judging whether the end point of the bright break line exists or not;
if the bright broken line end point exists, whether the bright broken line end point which is the same as the abscissa of the bright broken line starting point exists is searched;
if the same bright break line end point as the abscissa of the bright break line starting point exists, deleting the same bright break line end point as the abscissa of the bright break line starting point;
and connecting the bright broken line starting point and the bright broken line end point with the same abscissa as the bright broken line starting point, and outputting the bright broken line end point as a bright broken line detection result to finish the matching of the bright broken line starting point.
In a preferred embodiment of the present application, traversing the starting point of the broken line and determining whether there is an ending point of the broken line, further includes:
if the bright broken line end point does not exist, connecting the bright broken line starting point and the edge position image end point as a bright broken line detection result to output, and completing the matching of the bright broken line starting point;
and if the bright broken line end point with the same horizontal coordinate as the bright broken line starting point does not exist, connecting the bright broken line starting point and the edge position image end point to output as a bright broken line detection result, and completing the matching of the bright broken line starting point.
In a preferred embodiment of the present application, matching the endpoints on the same straight line according to the endpoint types to determine an edge disconnection position of the liquid crystal display, specifically further includes:
traversing the residual bright break line end points after the matching of the bright break line starting points is finished;
and connecting the starting point of the edge position image and the end point of the bright broken line, outputting the detection result of the bright broken line, and completing the matching of the end point of the bright broken line.
In the preferred embodiment of the present application, the principle that the gray scale transformation of the edge disconnection position of the liquid crystal screen is large is utilized to perform the gradient gray scale transformation in the X direction or the Y direction on the edge position image, and the edge disconnection position of the liquid crystal screen is detected and converted into the edge disconnection end position of the liquid crystal screen.
Compared with the prior art, the liquid crystal display edge broken line detection method based on gradient transformation has the following beneficial effects:
this application has certain grey scale change through the edge broken string handing-over position that utilizes the LCD screen, it changes to the unilateral grey scale gradient to do the marginal position of LCD screen, do Y direction's upper and lower neighborhood grey scale gradient to the left and right sides edge of the marginal broken string position of LCD screen promptly, do X direction's left and right neighborhood grey scale gradient to the upper and lower edge of the marginal broken string position of LCD screen and change the marginal broken string detection of LCD screen into the detection of marginal broken string endpoint, and acquire the endpoint position, confirm the endpoint type, thereby the position and the light and dark of accurate positioning marginal broken string, it is higher to the marginal broken string detection efficiency of LCD screen, the condition of undetected or false retrieval can not appear.
Detailed Description
To make the objects, embodiments and advantages of the present application clearer, the following description of exemplary embodiments of the present application will clearly and completely describe the exemplary embodiments of the present application with reference to the accompanying drawings in the exemplary embodiments of the present application, and it is to be understood that the described exemplary embodiments are only a part of the embodiments of the present application, and not all of the embodiments.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments that can be obtained by a person of ordinary skill in the art without any creative effort based on the embodiments in the present application belong to the protection scope of the present application.
In the description of the embodiments of the present application, it should be noted that the terms "upper", "lower", "left", "right", and the like indicate orientations or positional relationships based on orientations or positional relationships shown in the drawings or orientations or positional relationships conventionally laid out when the products of the present invention are used, and are only used for convenience in describing the present application and simplifying the description, but do not indicate or imply that the devices or elements referred to must have a specific orientation, be constructed in a specific orientation, and be operated, and thus, should not be construed as limiting the present application.
All other embodiments that can be derived by a person skilled in the art from the exemplary embodiments described herein without making any inventive step are intended to be covered by the claims appended hereto. In addition, while the disclosure herein has been presented in terms of one or more exemplary examples, it should be appreciated that aspects of the disclosure may be implemented solely as a complete embodiment.
It should be noted that the brief descriptions of the terms in the present application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of the present application. These terms should be understood in their ordinary and customary meaning unless otherwise indicated.
As shown in fig. 2, the schematic diagram of the edge transition pixels of the liquid crystal panel in the prior art is shown, where the schematic diagram includes a schematic diagram of the left edge transition pixels of the liquid crystal panel and a schematic diagram of the right edge transition pixels of the liquid crystal panel, and the widths of the transition pixels are about 5 pixels, and although the transition pixels have a small influence on the detection of the bulk or dot defects such as dots, color spots, and the like, the influence on the detection of the line defects at the edge of the liquid crystal panel is large, especially the detection of the line defects at the 0 pixel position of the liquid crystal panel is large, and the phenomena of missing detection and false detection are more likely to occur in the detection of the broken line defects at the edge of the liquid crystal panel.
The following describes in detail the precise detection process of the edge position disconnection defect of the liquid crystal display panel by combining the technical scheme of the present application.
Examples
As shown in fig. 1, the present application provides a method for detecting edge disconnection of a liquid crystal display based on gradient transformation, which specifically includes the following steps:
s101, performing unidirectional gray scale gradient transformation on an edge position image of the liquid crystal screen;
s102, carrying out background construction on the edge position image after gray gradient transformation;
s103, carrying out background difference on the edge position image after the background construction;
s104, extracting end points in the edge position image after background difference;
s105, calculating a neighborhood gray difference value of the end point;
s106, determining the endpoint type of the endpoint according to the neighborhood gray scale difference, wherein the neighborhood gray scale difference comprises the gray scale difference between the upper neighborhood and the lower neighborhood of the endpoint or the gray scale difference between the left neighborhood and the right neighborhood of the endpoint, and the endpoint type comprises a bright broken line starting point, a bright broken line end point, a dark broken line starting point and a dark broken line end point;
and S107, matching the end points on the same straight line according to the end point types, and determining the edge broken line position of the liquid crystal display, wherein the edge broken line position comprises a broken line starting point, a broken line terminal point and a broken line coordinate.
Before the liquid crystal display edge broken line detection method based on gradient transformation is adopted to carry out broken line detection on the liquid crystal display edge position image, the liquid crystal display to be detected needs to be placed on a jig for lighting, the liquid crystal display image is switched to a bright image, an industrial camera in an AOI liquid crystal display defect detection system is used for carrying out image acquisition on the bright image, and the bright image is positioned to a display area.
It should be particularly noted that, in this embodiment, a detailed description is made of the detection process of the present application by using the left edge image display area of the liquid crystal display as shown in fig. 3, and the specific detection steps are as follows:
by utilizing the principle that the gray scale transformation of the edge disconnection position of the liquid crystal screen is large, namely the neighborhood gray scale of the connection position of the edge disconnection end point fluctuates, the gradient gray scale transformation in the Y direction is carried out on the left edge image display area of the liquid crystal screen shown in the figure 3, the gradient transformation of which the scale is one tenth of the length of the preset disconnection is carried out, the disconnection position in the left edge image display area of the liquid crystal screen is detected, the disconnection end point position in the left edge image display area of the liquid crystal screen is detected, the left edge image of the liquid crystal screen after the gray scale gradient transformation shown in the figure 4 is obtained, and two points in the figure 4 are the disconnection end point positions;
performing background construction on the left edge image of the liquid crystal screen after gray gradient transformation, wherein the left edge image of the liquid crystal screen after the background construction is shown in fig. 5, extracting a suspected endpoint in the left edge image of the liquid crystal screen after the background construction by using a background difference algorithm, wherein the left edge image of the liquid crystal screen after the background difference is shown in fig. 6, and two points encircled by a gray circle in fig. 6 are suspected endpoints;
as shown in fig. 7, the end point determination is performed on the suspected end point in fig. 6, and includes determination of a bright end point and a dark end point, where a determination analysis process that the left image in fig. 7 is a bright end point, that is, a rectangular frame position of the left image in fig. 7, and a determination analysis process that the right image in fig. 7 is a dark end point, that is, a rectangular frame position of the right image in fig. 7, specifically includes the following steps:
if the gray scale of the upper neighborhood of the end point in the Y direction is smaller than the gray scale of the lower neighborhood, the end point is indicated to be a bright end point, namely the gray scale of the upper neighborhood and the gray scale of the lower neighborhood of the end point are dark at the top and bright at the bottom and can be the starting point of a bright broken line or the end point of a dark broken line, and due to the imaging characteristics of the liquid crystal screen AOI detection system, the gray scale of the liquid crystal screen is sequentially increased from the edge position to the middle, so that whether the gray scale difference value between the gray scale of the lower neighborhood of the bright end point and the gray scale of the right neighborhood of the;
if the gray difference value between the gray level of the lower neighborhood of the bright endpoint and the gray level of the right neighborhood of the lower neighborhood meets the preset gray difference threshold value of the bright broken line, judging the bright endpoint to be the starting point of the bright broken line and recording;
if the gray difference value between the gray scale of the neighborhood below the bright endpoint and the gray scale of the right neighborhood below the bright endpoint does not meet the preset gray difference threshold of the bright broken line, calculating whether the gray difference value between the gray scale of the neighborhood above the bright endpoint and the gray scale of the neighborhood below the bright endpoint meets the preset gray difference threshold of the dark broken line;
and if the gray difference value between the upper neighborhood gray scale and the lower neighborhood gray scale of the bright endpoint meets the preset gray difference threshold value of the dark broken line, judging the bright endpoint to be the end point of the dark broken line and recording.
Further, if the upper neighborhood gray scale of the end point in the Y direction is greater than the lower neighborhood gray scale, the end point is a dark end point, that is, the upper and lower neighborhood gray scales of the end point are bright at the top and dark at the bottom, and may be a bright broken line end point or a dark broken line start point, and due to the imaging characteristics of the liquid crystal screen AOI detection system, the image gray scale of the liquid crystal screen sequentially increases from the edge position to the middle, so that it is preferentially calculated whether the gray scale difference value between the upper neighborhood gray scale of the dark end point and the right neighborhood gray scale of the upper neighborhood meets the preset gray scale difference threshold of the bright broken line;
if the gray difference value between the gray level of the neighborhood on the dark endpoint and the gray level of the right neighborhood on the upper neighborhood meets the preset gray level difference threshold value of the bright broken line, judging that the dark endpoint is the bright broken line end point and recording;
if the gray difference value between the neighborhood gray scale on the dark endpoint and the right neighborhood gray scale of the upper neighborhood does not meet the preset gray difference threshold of the bright broken line, calculating whether the gray difference value between the neighborhood gray scale on the dark endpoint and the lower neighborhood gray scale meets the preset gray difference threshold of the dark broken line;
and if the gray difference value between the upper neighborhood gray scale and the lower neighborhood gray scale of the dark endpoint meets the preset gray difference threshold value of the dark broken line, judging the dark endpoint to be the starting point of the dark broken line and recording.
It should be noted that, in this embodiment, a graph of the result of the endpoint type obtained by the above analysis and determination process of the endpoint type is shown in fig. 8, that is, two positions D in fig. 8.
It should be particularly noted that when detecting the disconnection defect at the right edge of the liquid crystal display, gradient gray scale conversion in the Y direction is also required, and a specific detection process is similar to that of the left edge of the liquid crystal display, which is not described herein again. When the line breakage defect of the upper edge and the lower edge of the liquid crystal screen is detected, gradient gray scale conversion in the X direction needs to be performed on the upper edge and the lower edge of the liquid crystal screen, and other detection steps are similar to the detection process of the left edge of the liquid crystal screen, and are not described herein again.
In this embodiment, the detailed implementation process in step S107 is described in detail by using an endpoint matching process of a broken line, which specifically includes:
traversing the starting point of the bright break line and judging whether the end point of the bright break line exists or not;
if the bright broken line end point exists, whether the bright broken line end point which is the same as the abscissa of the bright broken line starting point exists is searched;
if the same bright break line end point as the abscissa of the bright break line starting point exists, deleting the same bright break line end point as the abscissa of the bright break line starting point;
connecting the bright broken line starting point and the bright broken line end point with the same abscissa as the bright broken line starting point, outputting the bright broken line end point as a bright broken line detection result, and completing the matching of the bright broken line starting point;
traversing the remaining bright broken line end points after the matching of the bright broken line starting points under the condition that the bright broken line end points exist;
connecting the edge position image starting point and the bright broken line end point to serve as a bright broken line detection result to be output, and completing matching of the bright broken line end point;
if the bright broken line end point does not exist, connecting the bright broken line starting point and the edge position image end point as a bright broken line detection result to output, and completing the matching of the bright broken line starting point;
and if the bright broken line end point with the same horizontal coordinate as the bright broken line starting point does not exist, connecting the bright broken line starting point and the edge position image end point to output as a bright broken line detection result, and completing the matching of the bright broken line starting point.
The end point matching result of the broken line obtained by the end point matching process of the broken line is shown in fig. 9, and the coordinates and the specific position of the starting point of the broken line, that is, the part framed by the rectangular frame in fig. 9, can be accurately obtained from fig. 9, that is, the broken line defect part.
It should be particularly noted that, in the present application, the end point matching process of the dark broken line is similar to the end point matching process of the bright broken line, and details are not repeated here, and a person skilled in the art can obtain the end point matching process of the dark broken line through the end point matching process of the bright broken line in the present application, and complete the accurate detection of the position of the dark broken line.
The embodiments provided in the present application are only a few examples of the general concept of the present application, and do not limit the scope of the present application. Any other embodiments extended according to the scheme of the present application without inventive efforts will be within the scope of the present application for a person skilled in the art.