Glass edge positioning method and device

By finding lines in the horizontal direction in the search area at the upper and lower boundaries of the photovoltaic glass image, the problem of misjudgment and low accuracy of the photovoltaic glass edge positioning is solved, and more accurate glass edge positioning is achieved.

CN119863511APending Publication Date: 2025-04-22BEIJING LUSTER LIGHTTECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411940530.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

During the production process of photovoltaic glass, defect problems such as edge glass collapse and angle caused poor image quality. The existing technology lacks effective processing methods, which affects the positioning results, resulting in misjudgment or low accuracy.

Method used

A method and device for positioning glass edges are proposed. By finding lines in a horizontal direction in the search area at the upper and lower boundaries of the image to be tested, the interference lines are eliminated, and the accuracy of the positioning results is improved.

Benefits of technology

The distinction between the interference line and the initial vertical contour line is achieved, the accuracy of the vertical edge positioning results is improved, positioning misjudgment is reduced, and the positioning accuracy of the glass edge is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119863511A_ABST
    Figure CN119863511A_ABST
Patent Text Reader

Abstract

The invention discloses a glass edge positioning method and device, and belongs to the field of industrial detection. The glass edge positioning method comprises the following steps: performing line finding on a to-be-detected image corresponding to glass in a search area to obtain a line finding result; and determining a vertical edge positioning result corresponding to the glass based on the line finding result and the obtained initial vertical contour line. According to the glass edge positioning method, the interference line and the initial vertical contour line can be distinguished, and the existence condition of the interference line is considered while the vertical edge positioning result corresponding to the glass is determined based on the initial vertical contour line, so that the interference line can be eliminated conveniently, and the positioning accuracy of the glass edge is improved. And the accuracy of determining the vertical edge positioning result based on the initial vertical contour line is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of industrial detection, and in particular, relates to a method and device for locating a glass edge. Background Art

[0002] In the production process of photovoltaic glass, defects such as edge chipping and corner chipping may occur. In order to detect such defects early and eliminate the corresponding defective products to ensure the product qualification rate, the edge area of ​​photovoltaic glass needs to be accurately located for easy detection. However, in the actual process of locating photovoltaic glass products, the quality of the collected photovoltaic glass product images is poor, and the relevant technology lacks an effective way to process these poor quality images, which affects the positioning results of photovoltaic glass products based on photovoltaic glass product images, resulting in positioning misjudgment or low accuracy. Summary of the invention

[0003] The present application aims to solve at least one of the technical problems existing in the related art. To this end, the present application proposes a method and device for locating the edge of glass, which can distinguish the interference line from the initial vertical contour line, thereby facilitating the elimination of the interference line and improving the accuracy of the vertical edge positioning result determined based on the initial vertical contour line.

[0004] In a first aspect, the present application provides a method for locating a glass edge, the method comprising:

[0005] Line finding is performed on the image to be tested corresponding to the glass in the search area to obtain the line finding result; the search area is located at the upper and lower boundaries of the image to be tested and outside the target area of ​​the image to be tested, and the search area is configured to be selectively translated along a first direction; the first direction is a horizontal direction from the edge of the image to be tested toward the center of the image to be tested; the target area is an area including the contour edge of the glass;

[0006] Based on the line finding result and the acquired initial vertical contour line, the vertical edge positioning result corresponding to the glass is determined; based on the acquired initial horizontal contour line, the horizontal edge positioning result corresponding to the glass is determined.

[0007] According to the glass edge positioning method of the present application, by performing line finding in the horizontal direction toward the center point of the image corresponding to the glass in a search area located at the upper and lower boundaries of the image to be tested and outside the area of ​​the image to be tested including the contour edge of the glass, the line finding result of the interference line is obtained, and then the vertical edge positioning result corresponding to the glass is determined based on the line finding result and the obtained initial vertical contour line, and the horizontal edge positioning result corresponding to the glass is determined based on the obtained initial horizontal contour line. The interference line and the initial vertical contour line can be distinguished. When the vertical edge positioning result corresponding to the glass is determined based on the initial vertical contour line, the existence of the interference line is taken into consideration, thereby facilitating the elimination of the interference line and improving the accuracy of the vertical edge positioning result determined based on the initial vertical contour line.

[0008] According to an embodiment of the present application, determining the vertical edge positioning result corresponding to the glass based on the line finding result and the acquired initial vertical contour line includes:

[0009] In the case where it is determined based on the line finding result that there is at least one interference line, determining the vertical edge positioning result based on the mutual positional relationship between each of the interference lines and the initial vertical contour line;

[0010] In the case where it is determined based on the line finding result that the interference line does not exist, the vertical edge positioning result is determined based on the initial vertical contour line.

[0011] According to an embodiment of the present application, determining the vertical edge positioning result based on the relative position relationship between each of the interference lines and the initial vertical contour line includes:

[0012] In a case where each of the interference lines does not overlap or intersect with the initial vertical contour line, determining the vertical edge positioning result based on the initial vertical contour line;

[0013] In a case where the interference line overlaps with the initial vertical contour line, moving the target area along the first direction to obtain a new initial vertical contour line;

[0014] When at least one of the interference lines intersects the initial vertical contour line, it is determined that a defect exists at the vertical edge of the glass.

[0015] According to an embodiment of the present application, performing line finding on the image to be tested corresponding to the glass in the search area to obtain the line finding result includes:

[0016] When a candidate line is obtained by searching in the search area and the contrast of the candidate line is not less than a contrast threshold, it is determined that an interference line exists.

[0017] According to an embodiment of the present application, when a candidate line is obtained by searching in the search area and a contrast of the candidate line is not less than a contrast threshold, determining that an interference line exists includes:

[0018] A first sub-candidate line is searched in the search area located at the upper boundary, and a second sub-candidate line is searched in the search area located at the lower boundary. When the contrast of the first sub-candidate line and the second sub-candidate line is not less than the contrast threshold, and the horizontal distance between the first sub-candidate line and the second sub-candidate line is less than the distance threshold, the first sub-candidate line and the second sub-candidate line are determined to be the same interference line.

[0019] According to an embodiment of the present application, before determining the vertical edge positioning result corresponding to the glass based on the line finding result and the acquired initial vertical contour line, the method further includes:

[0020] Dividing the target area to obtain a plurality of sub-areas, wherein the plurality of sub-areas correspond one-to-one to a plurality of edges of the glass;

[0021] Dividing the target sub-region along the direction of the edge corresponding to the target sub-region among the multiple sub-regions to obtain multiple edge detection regions;

[0022] Perform edge detection on each edge detection area to obtain an initial contour line corresponding to each edge detection area; the initial contour line includes the initial vertical contour line or the initial horizontal contour line.

[0023] According to an embodiment of the present application, performing edge detection on each edge detection area to obtain an initial contour line corresponding to each edge detection area includes:

[0024] When edge detection is performed on the edge detection area and an edge line segment is detected, a line connecting the intersection of the edge line segment and the edge detection area is determined as the initial contour line;

[0025] When edge detection is performed on the edge detection area and no edge line segment is detected, a center line along the edge direction in the edge detection area is determined as the initial contour line.

[0026] In a second aspect, the present application provides a glass edge positioning device, the device comprising:

[0027] A first processing module is used to perform line finding on the image to be tested corresponding to the glass in a search area to obtain a line finding result; the search area is located at the upper and lower boundaries of the image to be tested and outside the target area of ​​the image to be tested, and the search area is configured to be selectively translated along a first direction; the first direction is a horizontal direction from the edge of the image to be tested toward the center of the image to be tested; the target area is an area including the contour edge of the glass;

[0028] The second processing module is used to determine the vertical edge positioning result corresponding to the glass based on the line finding result and the acquired initial vertical contour line; and to determine the horizontal edge positioning result corresponding to the glass based on the acquired initial horizontal contour line.

[0029] According to the glass edge positioning device of the present application, by finding the line of the image to be tested corresponding to the glass in the horizontal direction toward the center point of the image in a search area located at the upper and lower boundaries of the image to be tested and outside the area of ​​the image to be tested including the contour edge of the glass, the line finding result of the interference line is obtained, and then the vertical edge positioning result corresponding to the glass is determined based on the line finding result and the obtained initial vertical contour line, and the horizontal edge positioning result corresponding to the glass is determined based on the obtained initial horizontal contour line. The interference line and the initial vertical contour line can be distinguished. When the vertical edge positioning result corresponding to the glass is determined based on the initial vertical contour line, the existence of the interference line is taken into consideration, thereby facilitating the elimination of the interference line and improving the accuracy of the vertical edge positioning result determined based on the initial vertical contour line.

[0030] In a third aspect, the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for locating the glass edge as described in the first aspect above is implemented.

[0031] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for locating a glass edge as described in the first aspect above is implemented.

[0032] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for locating a glass edge as described in the first aspect above.

[0033] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:

[0034] By performing line finding in the horizontal direction toward the center point of the image to be tested corresponding to the glass in a search area located at the upper and lower boundaries of the image to be tested and outside the area of ​​the image to be tested including the contour edge of the glass, the line finding result of the interference line is obtained, and then the vertical edge positioning result corresponding to the glass is determined based on the line finding result and the obtained initial vertical contour line, and the horizontal edge positioning result corresponding to the glass is determined based on the obtained initial horizontal contour line. It is possible to distinguish between the interference line and the initial vertical contour line. While determining the vertical edge positioning result corresponding to the glass based on the initial vertical contour line, the existence of the interference line is taken into consideration, thereby facilitating the elimination of the interference line and improving the accuracy of the vertical edge positioning result determined based on the initial vertical contour line.

[0035] Furthermore, by comparing the horizontal distances of the interference lines respectively searched in the search areas at the upper boundary and the lower boundary, when the horizontal distance is less than the distance threshold, it can be considered that the two interference lines respectively searched in the search areas at the upper boundary and the lower boundary are the same interference line, so that further refined judgment of the interference lines can be achieved, further reducing the comparison of the relative position relationship between subsequent unnecessary lines and the initial vertical contour lines, thereby improving the edge positioning efficiency of the glass.

[0036] Furthermore, by dividing the target area to obtain multiple sub-areas, the multiple sub-areas correspond one-to-one to the multiple edges of the glass, and then dividing the target sub-area along the direction of the edge corresponding to the target sub-area in the multiple sub-areas to obtain multiple edge detection areas, so as to perform edge detection on each edge detection area, and obtain the initial vertical contour line or initial horizontal contour line corresponding to each edge detection area, so as to achieve regionalized and fine detection of the glass edge, improve the detection accuracy of the initial vertical contour line or initial horizontal contour line corresponding to each edge detection area, reduce the influence of the imaging curvature that cannot be colinear due to the shaking of the edge glass on the positioning of the left and right vertical edge areas of the glass, thereby improving the positioning accuracy of the glass edge.

[0037] Furthermore, by performing edge detection in the edge detection area and detecting edge line segments, the line between the intersection of the edge line segments and the edge detection area is determined as the initial contour line. When edge detection is performed in the edge detection area and no edge line segments are detected, the center line along the edge direction in the edge detection area is determined as the initial contour line. This allows the confirmation of the initial contour lines of multiple glasses to be implemented, thereby improving the flexibility of the method for locating the glass edge.

[0038] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0040] Figure 1 is a schematic flow chart of a method for locating a glass edge provided in an embodiment of the present application;

[0041] Figure 2 This is one of the structural schematic diagrams of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0042] Figure 3 This is the second structural schematic diagram of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0043] Figure 4 This is the third structural schematic diagram of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0044] Figure 5 This is the fourth structural schematic diagram of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0045] Figure 6 This is the fifth structural schematic diagram of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0046] Figure 7 This is the sixth structural schematic diagram of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0047] Figure 8 This is the seventh structural schematic diagram of the image to be tested at the edge of the glass provided in the embodiment of the present application;

[0048] Fig. 9 This is the eighth structural schematic diagram of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0049] Fig.10 This is the ninth structural schematic diagram of the image to be tested where the glass edge is provided in the embodiment of the present application;

[0050] Fig.11 This is the tenth structural schematic diagram of the image to be tested where the glass edge is located provided in the embodiment of the present application;

[0051] Fig.12 This is the eleventh structural schematic diagram of the image to be tested at the edge of the glass provided in the embodiment of the present application;

[0052] Fig.13 This is a twelfth structural schematic diagram of the image to be tested at the edge of the glass provided in the embodiment of the present application;

[0053] Fig.14This is the thirteenth structural schematic diagram of the image to be tested at the edge of the glass provided in the embodiment of the present application;

[0054] Fig.15 This is one of the flow charts of the method for locating the edge of glass provided in the embodiment of the present application;

[0055] Fig.16 This is the second flow chart of the method for locating the glass edge provided in the embodiment of the present application;

[0056] Fig.17 is a schematic structural diagram of a glass edge positioning device provided in an embodiment of the present application;

[0057] Fig.18 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0059] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0060] In conjunction with the accompanying drawings, the glass edge positioning method, glass edge positioning device, electronic device and readable storage medium provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0061] The glass edge positioning method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.

[0062] The terminal includes but is not limited to portable communication devices such as mobile phones or tablet computers. It should also be understood that in some embodiments, the terminal may not be a portable communication device, but a desktop computer.

[0063] The glass edge positioning method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the glass edge positioning method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, cameras, and wearable devices. The glass edge positioning method provided in the embodiment of the present application is described below using an electronic device as an example of the execution subject.

[0064] like Figure 1 As shown, the method for positioning the glass edge includes: step 110 and step 120.

[0065] Step 110, performing line search on the image to be tested corresponding to the glass in the search area to obtain a line search result;

[0066] In this step, the glass can be photovoltaic glass, terminal product screen glass or other glass.

[0067] like Figure 2 As shown, the image to be tested includes images of glass and background, which can be rectangular or square.

[0068] like Fig. 9 and Fig.10 As shown, the search area (such as Fig. 9 and Fig.10 The area shown by the blue box in the figure) can be located at the upper and lower boundaries of the image to be tested and outside the target area of ​​the image to be tested, and the search area is set to be selectively shifted along the first direction.

[0069] The target region (ROI) is a region including the edge of the glass contour.

[0070] The contour edges of the glass include left and right vertical contour edges and upper and lower horizontal contour edges.

[0071] It can be understood that the edge of the glass contour is within the image to be measured and is at a certain distance from the boundary of the image to be measured.

[0072] The first direction is a horizontal direction from the edge of the image to be tested toward the center of the image to be tested.

[0073] It can be understood that the first direction is a horizontal direction from the outside of the left and right vertical contour edges of the glass to the inside of the left and right vertical contour edges.

[0074] like Figure 6 and Figure 7 As shown, in some embodiments, the target area is a first region of interest (eg Figure 6 and Figure 7 The red box shown) and the second region of interest (as Figure 6 and Figure 7The contour edge of the glass is located between the first region of interest and the second region of interest, that is, within the target area.

[0075] During the actual implementation process, the boundary of the first region of interest is set between the boundary of the image to be measured and the contour edge of the glass, and the boundary of the second region of interest is set between the contour edge of the glass and the center of the image to be measured close to the contour edge of the glass. In some embodiments, the distance between the first region of interest boundary and the second region of interest boundary and the contour edge of the glass can be equal, and the specific distance can be based on user-defined settings.

[0076] like Figure 6 and Figure 7 As shown, it can be understood that the target area includes an outer contour line (such as Figure 6 and Figure 7 The red box shown) and the inner contour (as Figure 6 and Figure 7 The outer contour line is the boundary of the first region of interest, and the inner contour line is the boundary of the second region of interest.

[0077] It can be understood that the search area is located between the outer contour line of the target area and the upper and lower boundaries of the image to be tested.

[0078] The length of the vertical boundary of the search area is less than the distance between the horizontal outer contour line of the target area and the horizontal boundary of the image to be tested. The specific lengths of the vertical and horizontal boundaries of the search area can be customized by the user and are not limited in this application.

[0079] For example, the length of the vertical boundary of the search area is set to 100 pixels, the length of the horizontal boundary is set to 300 pixels, and so on.

[0080] Searching for lines in the search area can be performed to search for interference lines in the search area.

[0081] When a line is found in the search area, the line is determined as an interference line.

[0082] like Figure 3 and Figure 4 As shown, the interference lines are interference lines generated by the glass production process and affect the detection of the left and right vertical contour edges of the glass.

[0083] There may be no interference line in the image area to be tested, or there may be one or more interference lines, and the interference line may be a line in the vertical direction or a line inclined to the left or right horizontal direction relative to the vertical direction.

[0084] In actual implementation, the search area is configured to be selectively movable along the first direction.

[0085] It is understandable that the search area can traverse the upper and lower boundaries of the image to be tested based on a certain step size, and search for interference lines in an area range consisting of a vertical boundary with the same length as the vertical boundary of the search area and a horizontal boundary of the image to be tested.

[0086] The interference lines searched in the search areas at the upper and lower boundaries may be the same or different.

[0087] In some embodiments, line finding may be performed starting from a vertical boundary on one side of the image to be tested, or line finding may be performed starting from vertical boundaries on both sides of the image to be tested at the same time, which is not limited in the present application.

[0088] It is understandable that the line finding result may include all interference lines existing in the search area, or the line finding result may be empty, that is, no interference line is found.

[0089] In the actual implementation process, based on any achievable line finding method, line finding can be performed on the image to be tested corresponding to the glass in the search area to obtain the line finding result.

[0090] In some embodiments, line finding may be performed within the search area based on a line finding tool.

[0091] In this embodiment, the line finding tool is a tool for detecting and identifying lines in an image.

[0092] In the actual implementation process, the user can determine the two endpoints of the line through interactive methods (such as mouse clicks) or automatic detection methods, and set a region of interest based on the location of the endpoints (limiting the search range of the line finding tool), and apply an edge detection algorithm in the region of interest, such as Canny edge detection, to identify edge points in the image. Starting from the endpoint, the line is traced along the edge point until the other endpoint is found or the boundary of the search range is reached. The edge points and endpoints collected in the process are used as sample points, and a straight line is fitted based on the least squares method or other mathematical methods.

[0093] The parameters of the line finding tool may be preset, including search direction, color polarity, contrast threshold, etc. The line finding tool may search for lines within a search range based on the preset parameters.

[0094] Color polarity can include: from black to white or from white to black.

[0095] The contrast threshold is the minimum color difference value used to distinguish lines from the background.

[0096] In the actual implementation process, the line finding tool determines that the line finding is successful by detecting whether the color difference between the line edge and the background is greater than or equal to the contrast threshold.

[0097] It can be understood that, in this embodiment, the search direction of the line finding tool is the first direction, that is, the direction from the outside of the contour edge of the glass to the inside of the glass, the color polarity can be from white to black (the background is white, the lines are black), and the color contrast threshold can be customized (for example, 20DN), so that the edge lines in the search area with a large color difference from the surrounding area can be detected; based on this parameter setting, the line finding tool is placed in the search area, so that the interference lines in the search area can be searched based on the line finding tool.

[0098] In some embodiments, a length pixel value of the line finding tool may also be set. The length pixel value may be understood as the length of the longest straight line segment finally searched by the line finding tool, and the length may be consistent with the length of the vertical boundary of the search area.

[0099] In some embodiments, when the search area searches for interference lines based on a certain step length, when an interference line is found in the search area, the search area can be moved to an area that has not been searched after the interference line, and then the search for interference lines can continue based on a certain step length to improve the search efficiency.

[0100] It can be understood that the search moving step lengths of the search areas located at the upper and lower boundaries of the image to be tested may be asynchronous.

[0101] Step 120: Based on the line finding result and the acquired initial vertical contour line, determine the vertical edge positioning result corresponding to the glass; based on the acquired initial horizontal contour line, determine the horizontal edge positioning result corresponding to the glass.

[0102] In this step, the initial vertical contour line is the initial vertical edge positioning result of the glass.

[0103] The initial horizontal contour line is the initial horizontal edge positioning result of the glass.

[0104] In the actual implementation process, the initial vertical contour line and the initial horizontal contour line corresponding to the glass can be detected by conventional contour edge detection methods, for example, by modeling or projection methods.

[0105] In some embodiments, the target area can be divided into multiple areas to be detected, and the initial vertical or horizontal contour lines can be determined in segments based on the line-finding tool, so as to improve the accuracy of the determined initial vertical or horizontal contour lines, thereby determining the positioning results of the vertical edges of the glass corresponding to higher accuracy. The method will be specifically explained in the embodiments below and will not be elaborated in this application.

[0106] In the actual implementation process, the obtained initial horizontal contour line can be directly determined as the horizontal edge positioning result. For vertical edge positioning, the line finding result is different. Based on the line finding result and the obtained initial vertical contour line, the process of determining the vertical edge positioning result corresponding to the glass is different.

[0107] During the research and development process, the inventors discovered that the factors affecting the positioning of the edge areas of photovoltaic glass in the photovoltaic glass product image are mainly interference lines, wherein the interference lines are black lines that are parallel or approximately parallel to the contour edges of the photovoltaic glass in the left and right vertical directions. Similar to the vertical contour edges of the photovoltaic glass, when the left and right vertical contour lines of the photovoltaic glass are detected based on the photovoltaic glass product image with the interference lines, the interference lines may be misjudged as the vertical edges of the photovoltaic glass. However, in the related art, there is a lack of effective processing of the interference lines, which affects the effectiveness and accuracy of positioning the edges of the photovoltaic glass based on the photovoltaic glass product image.

[0108] In the present application, before locating the vertical edge of the glass, the initial horizontal contour line can be compared with the interference line, for example, by comparing the grayscale value contrast or position information, and then based on the comparison result, corresponding processing is performed on the misjudgment of the initial vertical contour line. For example, when the initial vertical contour line is judged to be a misjudged interference line, the initial vertical contour line is reacquired until the initial vertical contour line is judged to be a non-interference line, and then the vertical edge positioning result corresponding to the glass is determined based on the initial vertical contour line.

[0109] In some embodiments, step 120 may include:

[0110] In the case where it is determined based on the line finding result that there is at least one interference line, a vertical edge positioning result is determined based on the mutual positional relationship between each interference line and the initial vertical contour line;

[0111] When it is determined based on the line finding result that there is no interference line, a vertical edge positioning result is determined based on the initial vertical contour line.

[0112] In this embodiment, the mutual position relationship may include overlapping, intersecting, non-overlapping and non-intersecting, etc.

[0113] It is understandable that if Fig.16 As shown, when the line finding result is not empty, that is, when there are interference lines in the search area, it is necessary to determine the vertical edge positioning result according to the relative position relationship between each interference line and the initial vertical contour line; Fig.15 As shown, when the line finding result is empty, the initial vertical contour line can be determined as the vertical edge positioning result of the glass.

[0114] In the actual implementation process, the mutual position relationship between the interference line and the initial vertical contour line is different, and the determined vertical edge positioning results are different.

[0115] According to the glass edge positioning method provided in the embodiment of the present application, when it is determined based on the line-finding result that there is at least one interference line, the vertical edge positioning result is determined based on the relative position relationship between each interference line and the initial vertical contour line; and when it is determined based on the line-finding result that there is no interference line, the vertical edge positioning result is determined based on the initial vertical contour line. This can achieve the acquisition of multiple vertical edge positioning results when the image to be measured where the glass is located is affected or not affected by interference lines, thereby improving the flexibility of vertical edge positioning of the glass.

[0116] like Fig.16 As shown, in some embodiments, determining the vertical edge positioning result based on the relative position relationship between each interference line and the initial vertical contour line may include:

[0117] In the case that each interference line does not overlap or intersect with the initial vertical contour line, a vertical edge positioning result is determined based on the initial vertical contour line;

[0118] In the case where the interference line overlaps with the initial vertical contour line, moving the target area along a first direction to obtain a new initial vertical contour line;

[0119] In the case where at least one interference line intersects the initial vertical contour line, it is determined that a defect exists at the vertical edge of the glass.

[0120] In this embodiment, the initial vertical contour line can be a complete edge of the glass in the left and right vertical directions, or, in some embodiments, it can also be an edge segment detected in each edge detection area in the vertical direction of the glass obtained by dividing the target area into multiple edge detection areas.

[0121] It can be understood that, when at least one interference line is obtained based on the search area search, and when it is determined that the initial vertical contour line does not overlap and intersect with all the interference lines obtained based on the search area search, the initial vertical contour line can be determined as the vertical edge positioning result; when it is determined that the initial vertical contour line intersects with any interference line obtained based on the search area search, it is considered that there is a defect in the vertical edge of the glass and the edge positioning is stopped; and when the interference line overlaps with the initial vertical contour line, further operation is required.

[0122] The overlap of the interference line and the initial vertical contour line can be understood as the initial vertical contour line being positioned incorrectly, and the initial vertical contour line is the interference line.

[0123] It can be understood that the target area can be moved along the first direction to obtain a new initial vertical contour line.

[0124] The moving target area may be an outer contour line of the moving target area.

[0125] like Fig.11 As shown, in some embodiments, when the initial vertical contour line and the first interference line are compared in relative position and it is determined that the initial vertical contour line overlaps with the first interference line, the outer contour line of the target area can be moved along the first direction to a position excluding the first interference line (e.g., Fig.11 The yellow box in the figure is moved to the position where the first interference line is excluded (the blue box), and then a new initial vertical contour line is obtained in the target area again, and this cycle is repeated until it is determined that the initial vertical contour line does not overlap and intersect with a certain interference line or intersects with a certain interference line.

[0126] According to the glass edge positioning method provided in the embodiment of the present application, the vertical edge positioning result is determined based on the initial vertical contour line when each interference line does not overlap or intersect with the initial vertical contour line, and when the interference line overlaps with the initial vertical contour line, the target area is moved along the first direction to obtain a new initial vertical contour line, and when at least one interference line intersects with the initial vertical contour line, it is determined that there is a defect in the vertical edge of the glass. Different control logics can be implemented under a variety of different relative positional relationships between the interference lines and the initial vertical contour lines, thereby improving the accuracy and reliability of the determined initial vertical contour edge.

[0127] During the research and development process, the inventor discovered that when positioning the edge areas of the glass in the left and right vertical directions, the edge areas of the glass would be inaccurately positioned due to problems such as black interference lines from the light source. Traditional methods of positioning photovoltaic glass based on modeling or projection have low accuracy and cannot meet user requirements.

[0128] In the present application, by finding the line of the image to be tested corresponding to the glass in the horizontal direction toward the center point of the image in a search area located at the upper and lower boundaries of the image to be tested and outside the area of ​​the image to be tested including the contour edge of the glass, the line finding result of the interference line is obtained, and then the vertical edge positioning result corresponding to the glass is determined based on the line finding result and the obtained initial vertical contour line, and the horizontal edge positioning result corresponding to the glass is determined based on the obtained initial horizontal contour line. The interference line and the initial vertical contour line can be distinguished. While determining the vertical edge positioning result corresponding to the glass based on the initial vertical contour line, the existence of the interference line is taken into consideration, thereby facilitating the elimination of the interference line and improving the accuracy of the vertical edge positioning result determined based on the initial vertical contour line.

[0129] In some embodiments, the mutual position relationship may be determined by the following steps, which may include:

[0130] Determine the pixel distance between the interference line and the initial vertical contour line along the horizontal direction based on the pixel position of the interference line and the pixel position of the initial vertical contour line;

[0131] When the pixel distance is not less than the first threshold, determining the mutual position relationship as non-overlapping and non-intersecting;

[0132] When the pixel distance is less than the first threshold and not less than the second threshold, determining the mutual position relationship as overlapping;

[0133] When the pixel distance is less than the second threshold, the mutual position relationship is determined to be an intersection.

[0134] In this embodiment, the pixel position of the interference line is the position coordinate value of each pixel constituting the interference line.

[0135] In actual implementation, the pixel position of the interference line can be recorded as a function expression, or the endpoint coordinates can be recorded to facilitate subsequent comparison with the initial vertical contour line.

[0136] For example, interference line 1 is y=x, interference line 2 is y=x+1, and interference line 3 is [(0,0), (n,m)], where n and m are both positive integers.

[0137] The pixel positions of the initial vertical contour line are position coordinate values ​​of the pixels constituting the initial vertical contour line.

[0138] The pixel distance is the pixel difference in the horizontal direction between each pixel position of the interference line and each pixel position of the initial vertical contour line.

[0139] The pixel distance can be positive or negative, or even zero.

[0140] The first threshold and the second threshold are both pixel distance thresholds, and the first threshold is greater than the second threshold.

[0141] In some embodiments, the second threshold value may be set to 0, and the first threshold value is a value greater than 0. The first threshold value may be specifically set by a user, for example, may be set to 5 pixels.

[0142] In the actual implementation process, the pixel coordinate values ​​of the interference line and the initial vertical contour line in the horizontal direction can be subtracted. Assuming that the initial vertical contour line and the interference line do not overlap and do not intersect, the interference line is a line close to the center of the image to be measured in the horizontal direction, and the pixel coordinate value obtained by subtracting the pixel coordinate value of the interference line from the pixel coordinate value of the initial vertical contour line is a positive value, then based on the subtraction result and the first threshold and the second threshold, it can be determined whether the interference line and the initial vertical contour line intersect and overlap.

[0143] Among them, when the second threshold is set to 0, when the pixel distances are all positive values, but the pixel distances are not less than the first threshold, the relative position relationship between the initial vertical contour line and the interference line is determined to be non-overlapping and non-intersecting; when the pixel distance is a negative value, that is, it is less than the second threshold, the relative position relationship between the initial vertical contour line and the interference line is determined to be intersecting; when the pixel distances are all positive values, that is, not less than the second threshold but less than the first threshold, the relative position relationship between the initial vertical contour line and the interference line is determined to be overlapping.

[0144] According to the glass edge positioning method provided in the embodiment of the present application, the pixel distance between the interference line and the initial vertical contour line along the horizontal direction is determined based on the pixel position of the interference line and the pixel position of the initial vertical contour line, and the relative position relationship between the initial vertical contour line and the interference line is determined based on the threshold range of the pixel distance. This can realize the judgment of the situation where the interference line is misjudged as the initial vertical contour line and reduce the misjudgment, and can realize the judgment of whether there is a defect in the vertical edge of the glass. If so, the edge positioning of the glass is stopped, thereby improving the efficiency of the glass positioning processing.

[0145] In some embodiments, step 110 may include:

[0146] When a candidate line is obtained by searching in the search area and the contrast of the candidate line is not less than the contrast threshold, it is determined that an interference line exists.

[0147] In this embodiment, the candidate lines are all lines searched in the search area.

[0148] It is understandable that not all candidate lines are interference lines.

[0149] In the actual implementation process, when the contrast of a candidate line is not less than the contrast threshold, the candidate line can be considered as an interference line.

[0150] The contrast threshold can be set by the user, for example, it can be set to 20DN, so as to distinguish the interference lines from other candidate lines.

[0151] According to the glass edge positioning method provided in the embodiment of the present application, by searching in the search area to obtain candidate lines, and when the contrast of the candidate lines is not less than the contrast threshold, it is determined that there are interference lines, so that a refined judgment of the interference lines can be achieved, and the comparison of the relative position relationship between subsequent unnecessary lines and the initial vertical contour lines can be reduced, thereby improving the edge positioning efficiency of the glass.

[0152] In some embodiments, when a candidate line is obtained by searching in the search area and the contrast of the candidate line is not less than a contrast threshold, determining that an interference line exists may include:

[0153] A first sub-candidate line is obtained by searching in a search area located at an upper boundary, and a second sub-candidate line is obtained by searching in a search area located at a lower boundary. When a contrast between the first sub-candidate line and the second sub-candidate line is not less than a contrast threshold, and a horizontal distance between the first sub-candidate line and the second sub-candidate line is less than a distance threshold, the first sub-candidate line and the second sub-candidate line are determined to be the same interference line.

[0154] In this embodiment, the distance threshold is a threshold used to measure the horizontal distance between interference lines.

[0155] It can be understood that the horizontal distances of the interference lines searched in the search areas at the upper boundary and the lower boundary can be compared. When the horizontal distance is less than the distance threshold, the two interference lines searched in the search areas at the upper boundary and the lower boundary can be considered to be the same interference line.

[0156] According to the glass edge positioning method provided by the embodiment of the present application, by comparing the horizontal distances of the interference lines respectively searched in the search area at the upper boundary and the lower boundary, when the horizontal distance is less than the distance threshold, it can be considered that the two interference lines respectively searched in the search area at the upper boundary and the lower boundary are the same interference line, which can achieve further refined judgment of the interference lines, further reduce the comparison of the relative position relationship between subsequent unnecessary lines and the initial vertical contour lines, and improve the edge positioning efficiency of the glass.

[0157] like Fig.16 As shown, in some embodiments, before step 120, the method may further include:

[0158] Dividing the target area to obtain multiple sub-areas, where the multiple sub-areas correspond to multiple edges of the glass one by one;

[0159] Dividing the target sub-region along the direction of the edge corresponding to the target sub-region among the multiple sub-regions to obtain multiple edge detection regions;

[0160] Perform edge detection on each edge detection area to obtain an initial contour line corresponding to each edge detection area; the initial contour line includes an initial vertical contour line or an initial horizontal contour line.

[0161] In this embodiment, the sub-regions are regions corresponding one-to-one to the glass edges.

[0162] In some embodiments, four sub-areas may be divided based on the target area, including two sub-areas in the upper and lower horizontal directions and two sub-areas in the left and right vertical directions, and each edge of the glass is located in the four sub-areas respectively.

[0163] In the actual implementation process, the length of each sub-area is consistent with the edge length of the glass in each sub-area, that is, the endpoints of the vertical edge of the glass are on the upper and lower horizontal boundaries of the sub-area corresponding to the vertical edge; the endpoints of the horizontal edge of the glass are on the left and right vertical boundaries of the sub-area corresponding to the horizontal edge.

[0164] like Fig.12 As shown, the edge detection area is an area obtained by dividing each sub-area again along the direction of the edge corresponding to the target sub-area in multiple sub-areas (such as Fig.12 red box).

[0165] Among them, along the direction of the edge corresponding to the target sub-region among the multiple sub-regions, it can be understood that, when four sub-regions are divided based on the target region, including two sub-regions in the upper and lower horizontal directions and two sub-regions in the left and right vertical directions, the two sub-regions in the upper and lower horizontal directions are divided along the horizontal direction, and the two sub-regions in the left and right vertical directions are divided along the vertical direction.

[0166] In the actual execution process, the step length for dividing the target sub-region along the direction of the edge corresponding to the target sub-region in the multiple sub-regions may be preset, and the step length may be set based on the camera parameters.

[0167] like Figure 8 As shown, in the actual implementation process, since the image to be tested can be formed by stitching images taken by multiple cameras, in some cases, the edges of the glass are not collinear due to stitching errors (as shown in the yellow box). The step size for dividing the target sub-areas can be set according to the camera width, so that the step size is smaller than the width of each camera of the multiple cameras, so as to perform refined detection of the edges of the glass in each edge detection area, thereby reducing the influence of the stitching error on the edge positioning result of the glass.

[0168] For example, Fig.16 As shown, when the number of cameras is 2 and the camera width is 8129 pixels, the step size can be set to 1500 pixels.

[0169] For each divided edge detection area, edge detection is performed on the edge of the glass to obtain an initial contour line.

[0170] The initial contour line may include an initial vertical contour line or an initial horizontal contour line.

[0171] In some embodiments, edge detection of the glass edge may be performed on each edge detection area based on a line finding tool.

[0172] In the actual implementation process, the length pixel value of the line finding tool can be set to the same as the step size of the target sub-area divided according to the camera width, so that the edge line segments of the glass in each complete edge detection area, that is, the initial contour line, can be detected.

[0173] In some embodiments, the initial contour lines of the glass in each edge detection area in each sub-area can be spliced ​​to obtain the complete initial contour line of the glass in each sub-area, that is, the positioning results of the horizontal edge and the vertical edge of the glass can be obtained.

[0174] According to the glass edge positioning method provided by the embodiment of the present application, by dividing the target area to obtain multiple sub-areas, the multiple sub-areas correspond to the multiple edges of the glass one by one, and then dividing the target sub-area along the direction of the edge corresponding to the target sub-area in the multiple sub-areas to obtain multiple edge detection areas, so as to perform edge detection on each edge detection area, obtain the initial vertical contour line or initial horizontal contour line corresponding to each edge detection area, so as to achieve regionalized fine detection of the glass edge, improve the detection accuracy of the initial vertical contour line or initial horizontal contour line corresponding to each edge detection area, and reduce the following problems: Figure 5 As shown, the imaging curvature cannot be collinear due to the shaking of the edge glass, which affects the positioning of the left and right vertical edge areas of the glass, thereby improving the positioning accuracy of the glass edge.

[0175] like Fig.16 As shown, in some embodiments, performing edge detection on each edge detection area and obtaining an initial contour line corresponding to each edge detection area may include:

[0176] When edge detection is performed in the edge detection area and edge line segments are detected, a line connecting the intersection of the edge line segments and the edge detection area is determined as an initial contour line;

[0177] When edge detection is performed in the edge detection area and no edge line segment is detected, a center line along the edge direction in the edge detection area is determined as an initial contour line.

[0178] In this embodiment, whether an edge segment is detected can be understood as whether the detection is successful.

[0179] In some embodiments, when edge detection is performed within an edge detection area based on a line finding tool, whether an edge line segment is detected can be used to determine whether the line finding is successful, that is, to determine whether the initial contour line detected within the edge detection area based on the line finding tool meets the requirements of a pre-set contrast threshold. If so, it is determined that the line finding is successful, that is, the edge line segment is detected; if not, it is determined that the line finding has failed, that is, no edge line segment is detected.

[0180] like Fig.13 As shown, in the actual implementation process, when an edge line segment is detected, the intersection point of the edge line segment and the outer contour line of the edge detection area can be calculated first (such as Fig.13 The intersection points are then connected, and the line between the intersection points can be determined as the initial contour line in the edge detection area.

[0181] like Fig.14 As shown, when no edge line segment is detected, the center line along the edge direction in the edge detection area (such as Fig.14 The red line in the red box shown and the red line in the horizontal direction perpendicular to the left and right vertical boundaries of the red box), that is, the horizontal center line of the horizontal edge detection area, or the vertical center line of the vertical edge detection area, is determined as the initial contour line in the edge detection area.

[0182] It can be understood that when no edge line segment is detected, the two center points of the boundary of the edge detection area that are perpendicular to the direction of the edge of the corresponding glass can be obtained first, and then the two center points can be connected to obtain the center line, so that the center line can be determined as the initial contour line within the edge detection area.

[0183] According to the glass edge positioning method provided in the embodiment of the present application, by performing edge detection in the edge detection area and detecting edge line segments, the line between the intersection of the edge line segments and the edge detection area is determined as the initial contour line; and when edge detection is performed in the edge detection area and no edge line segments are detected, the center line along the edge direction in the edge detection area is determined as the initial contour line. This method can realize the confirmation method of the initial contour lines of multiple glasses, thereby improving the flexibility of the method for positioning the glass edge.

[0184] The glass edge positioning method provided in the embodiment of the present application can be executed by a glass edge positioning device. In the embodiment of the present application, the glass edge positioning method performed by the glass edge positioning device is taken as an example to illustrate the glass edge positioning device provided in the embodiment of the present application.

[0185] The embodiment of the present application also provides a positioning device for a glass edge.

[0186] like Fig.17 As shown, the glass edge positioning device includes: a first processing module 1710 and a second processing module 1720 .

[0187] The first processing module 1710 is used to perform line finding on the image to be tested corresponding to the glass in the search area and obtain the line finding result; the search area is located at the upper and lower boundaries of the image to be tested and outside the target area of ​​the image to be tested, and the search area is set to be selectively translated along a first direction; the first direction is a horizontal direction from the edge of the image to be tested to the center of the image to be tested; the target area is an area including the contour edge of the glass;

[0188] The second processing module 1720 is used to determine the vertical edge positioning result corresponding to the glass based on the line finding result and the acquired initial vertical contour line; and to determine the horizontal edge positioning result corresponding to the glass based on the acquired initial horizontal contour line.

[0189] According to the glass edge positioning device provided in the embodiment of the present application, by performing line finding in the horizontal direction toward the center point of the image to be tested corresponding to the glass in a search area located at the upper and lower boundaries of the image to be tested and outside the area of ​​the image to be tested including the contour edge of the glass, a line finding result of the interference line is obtained, and then based on the line finding result and the obtained initial vertical contour line, the vertical edge positioning result corresponding to the glass is determined, and based on the obtained initial horizontal contour line, the horizontal edge positioning result corresponding to the glass is determined. The interference line and the initial vertical contour line can be distinguished. When the vertical edge positioning result corresponding to the glass is determined based on the initial vertical contour line, the existence of the interference line is taken into consideration, thereby facilitating the elimination of the interference line and improving the accuracy of the vertical edge positioning result determined based on the initial vertical contour line.

[0190] In some embodiments, the second processing module 1720 may also be used to:

[0191] In the case where it is determined based on the line finding result that there is at least one interference line, a vertical edge positioning result is determined based on the mutual positional relationship between each interference line and the initial vertical contour line;

[0192] When it is determined based on the line finding result that there is no interference line, a vertical edge positioning result is determined based on the initial vertical contour line.

[0193] In some embodiments, the second processing module 1720 may also be used to:

[0194] In the case that each interference line does not overlap or intersect with the initial vertical contour line, a vertical edge positioning result is determined based on the initial vertical contour line;

[0195] In the case where the interference line overlaps with the initial vertical contour line, moving the target area along a first direction to obtain a new initial vertical contour line;

[0196] In the case where at least one interference line intersects the initial vertical contour line, it is determined that a defect exists at the vertical edge of the glass.

[0197] In some embodiments, the first processing module 1710 may also be used to:

[0198] When a candidate line is obtained by searching in the search area and the contrast of the candidate line is not less than the contrast threshold, it is determined that an interference line exists.

[0199] In some embodiments, the first processing module 1710 may also be used to:

[0200] A first sub-candidate line is obtained by searching in a search area located at an upper boundary, and a second sub-candidate line is obtained by searching in a search area located at a lower boundary. When a contrast between the first sub-candidate line and the second sub-candidate line is not less than a contrast threshold, and a horizontal distance between the first sub-candidate line and the second sub-candidate line is less than a distance threshold, the first sub-candidate line and the second sub-candidate line are determined to be the same interference line.

[0201] In some embodiments, the apparatus may further include a third processing module, configured to:

[0202] Before determining the vertical edge positioning result corresponding to the glass based on the line finding result and the obtained initial vertical contour line, the target area is divided to obtain a plurality of sub-areas, and the plurality of sub-areas correspond to the plurality of edges of the glass one by one;

[0203] Divide the target sub-region along the direction of the edge corresponding to the target sub-region in the multiple sub-regions to obtain multiple edge detection regions;

[0204] Perform edge detection on each edge detection area to obtain an initial contour line corresponding to each edge detection area; the initial contour line includes an initial vertical contour line or an initial horizontal contour line.

[0205] In some embodiments, the third processing module may also be used to:

[0206] When edge detection is performed in the edge detection area and edge line segments are detected, a line connecting the intersection of the edge line segments and the edge detection area is determined as an initial contour line;

[0207] When edge detection is performed in the edge detection area and no edge line segment is detected, a center line along the edge direction in the edge detection area is determined as an initial contour line.

[0208] The glass edge positioning device in the embodiment of the present application may be a device having an operating system, which may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0209] The glass edge positioning device provided in the embodiment of the present application can achieve Figures 1 to 16 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0210] like Fig.18 As shown, the embodiment of the present application also provides an electronic device 1800, including a processor 1801, a memory 1802, and a computer program stored in the memory 1802 and executable on the processor 1801. When the program is executed by the processor 1801, each process of the above-mentioned glass edge positioning method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0211] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0212] The embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned glass edge positioning method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0213] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0214] The embodiment of the present application further provides a computer program product, including a computer program, which implements the above-mentioned glass edge positioning method when executed by a processor.

[0215] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0216] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned glass edge positioning method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0217] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0218] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0219] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0220] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0221] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0222] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

Claims

1. A method for positioning a glass edge, characterized in that: include: Find the line of the image to be tested corresponding to the glass in the search area and obtain the line finding result; The search area is located at the upper and lower boundaries of the image to be tested and outside the target area of ​​the image to be tested. The search area is configured to be selectively translated along a first direction; the first direction is a horizontal direction from the edge of the image to be tested toward the center of the image to be tested; the target area is an area including the contour edge of the glass; Based on the line finding result and the acquired initial vertical contour line, the vertical edge positioning result corresponding to the glass is determined; based on the acquired initial horizontal contour line, the horizontal edge positioning result corresponding to the glass is determined.

2. The method for locating the glass edge according to claim 1, characterized in that: The determining the vertical edge positioning result corresponding to the glass based on the line finding result and the acquired initial vertical contour line includes: In the case where it is determined based on the line finding result that there is at least one interference line, determining the vertical edge positioning result based on the mutual positional relationship between each of the interference lines and the initial vertical contour line; In the case where it is determined based on the line finding result that the interference line does not exist, the vertical edge positioning result is determined based on the initial vertical contour line.

3. The method for locating the glass edge according to claim 2, characterized in that: The determining the vertical edge positioning result based on the mutual positional relationship between each interference line and the initial vertical contour line includes: In a case where each of the interference lines does not overlap or intersect with the initial vertical contour line, determining the vertical edge positioning result based on the initial vertical contour line; In a case where the interference line overlaps with the initial vertical contour line, moving the target area along the first direction to obtain a new initial vertical contour line; When at least one of the interference lines intersects the initial vertical contour line, it is determined that a defect exists at the vertical edge of the glass.

4. The method for locating a glass edge according to any one of claims 1 to 3, characterized in that: The step of performing line finding on the image to be tested corresponding to the glass in the search area to obtain the line finding result includes: When a candidate line is obtained by searching in the search area and the contrast of the candidate line is not less than a contrast threshold, it is determined that an interference line exists.

5. The method for locating the glass edge according to claim 4, characterized in that: The step of searching for candidate lines in the search area and obtaining the candidate lines, and determining that there are interference lines when the contrast of the candidate lines is not less than a contrast threshold, includes: A first sub-candidate line is searched in the search area located at the upper boundary, and a second sub-candidate line is searched in the search area located at the lower boundary. When the contrast of the first sub-candidate line and the second sub-candidate line is not less than the contrast threshold, and the horizontal distance between the first sub-candidate line and the second sub-candidate line is less than the distance threshold, the first sub-candidate line and the second sub-candidate line are determined to be the same interference line.

6. The method for locating a glass edge according to any one of claims 1 to 3, characterized in that: Before determining the vertical edge positioning result corresponding to the glass based on the line finding result and the acquired initial vertical contour line, the method further includes: Dividing the target area to obtain a plurality of sub-areas, wherein the plurality of sub-areas correspond one-to-one to a plurality of edges of the glass; Dividing the target sub-region along the direction of the edge corresponding to the target sub-region among the multiple sub-regions to obtain multiple edge detection regions; Perform edge detection on each edge detection area to obtain an initial contour line corresponding to each edge detection area; the initial contour line includes the initial vertical contour line or the initial horizontal contour line.

7. The method for locating the glass edge according to claim 6, characterized in that: The performing edge detection on each edge detection area to obtain an initial contour line corresponding to each edge detection area includes: When edge detection is performed on the edge detection area and an edge line segment is detected, a line connecting the intersection of the edge line segment and the edge detection area is determined as the initial contour line; When edge detection is performed on the edge detection area and no edge line segment is detected, a center line along the edge direction in the edge detection area is determined as the initial contour line.

8. A glass edge positioning device, characterized in that: include: The first processing module is used to find the line of the image to be tested corresponding to the glass in the search area and obtain the line finding result; The search area is located at the upper and lower boundaries of the image to be tested and outside the target area of ​​the image to be tested. The search area is configured to be selectively translated along a first direction; the first direction is a horizontal direction from the edge of the image to be tested toward the center of the image to be tested; the target area is an area including the contour edge of the glass; The second processing module is used to determine the vertical edge positioning result corresponding to the glass based on the line finding result and the acquired initial vertical contour line; and to determine the horizontal edge positioning result corresponding to the glass based on the acquired initial horizontal contour line.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the glass edge positioning method according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for locating the glass edge as claimed in any one of claims 1 to 7 is implemented.