Glass piece clearance surface difference measuring method
By screening and segmenting glass and non-glass surface light strips in laser bar images, combining spatial coordinate system and digital-analog profile information, the problem of poor image quality in glass gap difference measurement is solved, achieving high precision and high efficiency Gap surface difference measurement.
Patent Information
- Application Number
- CN202411324802.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-31
AI Technical Summary
When detecting glass parts, the existing gap surface difference visual measurement equipment causes poor image quality due to the special optical characteristics of the glass, making it difficult to accurately extract feature points. The use of shorter wavelength lasers will increase costs and reduce equipment stability, resulting in glass parts. The gap surface difference measurement efficiency is low and the accuracy is low.
By recording the light bars reflected by the inner and outer layer of the glass surface in the laser bar image, the light bars with better imaging quality are filtered based on the orientation information, and converted into a spatial coordinate system, combining the filtering of light bar segments that do not meet the conditions and segmentation Extract the light strip segments corresponding to the glass surface and non-glass, calculate the gap value and surface difference value, and use digital-analog profile information to compensate if necessary.
It realizes high-precision and rapid measurement of the gap difference between glass parts, and is suitable for measuring the gap difference between automotive sunroof glass, front and rear windshield glass, car window glass and sheet metal parts, improving detection efficiency and accuracy.
Smart Images

Figure CN119223184A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of gap and flushness detection, and in particular to a method for measuring the gap and flushness of a glass piece. Background Art
[0002] Gap and flushness is one of the important factors that determine the appearance of a product. It directly affects the product's water-proof performance and noise suppression performance, etc. It is also an important factor that affects consumers' purchasing decisions. Therefore, the measurement of gap and flushness is one of the important steps in product quality testing.
[0003] The shortcomings of traditional measurement methods such as three-dimensional coordinate measuring instruments, inspection fixtures, and test racks, such as lag and low efficiency, have made it difficult to adapt to the pace of today's product production. Instead, an online measurement system with non-contact, high speed and high precision is used. Generally, a visual measurement mode combining line structured light and camera is adopted. The laser generator emits a line laser to the surface of the object to be measured. The camera measures the reflection of the line laser on the surface of the object according to a fixed angle. The surface information of the object to be measured is determined by the principle of triangulation to calculate the gap face difference. In this measurement scheme, how to extract the center line of the line laser and how to identify the key feature points are the key to calculating the gap face difference. When the image quality is good, the collected light strips are clear and continuous, such as Figure 1 As shown in , in an ideal state, the collected laser bar image contains the left laser bar (continuous and uninterrupted) and the right laser bar (continuous and uninterrupted), and each laser bar contains straight line segments and arc segments. At this time, the calculation of key feature points is relatively easy, such as Figure 1 The circular mark point in the circle is the point closest to the gap in the arc segment. The intersection measurement result of the arc segment and the straight line segment can meet the accuracy requirements. However, in the gap and flushness detection process of glass parts (such as: sunroof glass, front and rear windshields, window glass, and triangular window glass on cars), the gap and flushness visual measurement equipment on the market often uses blue-violet lasers. Among them, the short-wavelength violet laser has a good imaging effect on non-glass parts, but for glass parts (sunroof glass, front and rear windshields, window glass, and triangular window glass), the imaging effect is not ideal due to the special optical properties of glass parts; as shown in the attached figure, Figure 2This is the imaging effect of laser projection on the surface of the glass part. The light strip on the left corresponds to the glass part, and the light strip on the right corresponds to the non-glass part. It can be seen that the light strip on the left is not only unclear and intermittent, but also layered; because the direction of the gap from outside to inside in the real physical space corresponds to the direction from bottom to top in the image, the light strip near the bottom of the image is the light strip projected by the outer layer (outer surface) of the glass, and the light strip near the top of the image is the light strip projected by the inner layer (inner surface) of the glass. The double-layer laser strip (inner layer + outer layer) reflected by the glass part brings new challenges to the analysis of the light strips, and it is difficult for the existing detection methods to obtain effective feature points. In addition, if a shorter wavelength laser is used, not only will the cost be greatly increased, but the stability of the laser equipment will also be reduced. For this reason, the visual measurement of the gap between glass parts is a major pain point in the current field of gap and flushness measurement. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a method for measuring the gap and flushness of glass parts. The method targets the imaging characteristics of glass parts, effectively filters out the glass surface light strip segments with poor image quality, and then accurately calculates the gap and flushness values of the glass parts. The method has the characteristics of high precision and high speed, and is suitable for measuring the gap and flushness between automobile sunroof glass, front and rear windshields, window glass, triangular window glass and sheet metal parts.
[0005] To this end, the technical solution of the present invention is as follows: A method for measuring the gap flushness of glass parts, wherein the gap flushness of glass parts refers to the gap flushness at the connection between a glass product and a non-glass product; during measurement, a single-line laser projects laser light to a position to be measured, and a camera collects a laser bar image, in which the laser bars are distributed horizontally; For a certain type of glass parts, the following process is carried out first: In the laser stripe image, the light stripe reflected from the inner layer of the glass surface is recorded as the upper light stripe, and the light stripe reflected from the outer layer of the glass surface is recorded as the lower light stripe. The light stripe with better imaging quality is selected from the upper light stripe and the lower light stripe and recorded as the dominant light stripe. Recording the position information A of the dominant light strip in the image and the position information B of the light strip reflected by the non-glass surface in the image; When the dominant light bar is an upper light bar, the position information A is upper, and when the dominant light bar is a lower light bar, the position information A is lower; When the light strip reflected by the non-glass surface is located in the left area of the image, the orientation information B is left; when the light strip reflected by the non-glass surface is located in the right area of the image, the orientation information B is right; During actual measurement, the same type of glass pieces to be tested are placed in the detection area in turn to collect laser bar images, and the following processing is performed on each collected laser bar image: Step 1), in the laser stripe image, extract each pixel point on the center line of the light stripe; divide the light stripe into multiple line segments according to the continuity between the pixel points; Step 2), among the multiple light strip segments, a filtering condition is set based on the orientation information A, and among the light strips reflected from the glass surface, light strip segments that do not meet the orientation information A are filtered out; Then, the light strip line segments corresponding to the non-glass surface and the light strip line segments corresponding to the glass surface are divided from the retained light strip line segments, which are respectively recorded as light strip line segments I and light strip line segments II; Step 3), convert each pixel point in light strip line segment I and light strip line segment II into the spatial coordinate system, and obtain spatial light strip line segment I and spatial light strip line segment II correspondingly, and use the spatial light strip line segment I and spatial light strip line segment II to solve the gap value and / or surface difference value.
[0006] Furthermore, in step 2), the light strip segments that do not satisfy the orientation information A are filtered out from the light strips reflected from the glass surface in the following manner: ① In the laser stripe image, the pixels other than the light stripe segments are recorded as background points, and the grayscale values of the background points are uniformly assigned as grayscale value S; ② Set the grayscale values of each pixel in the same light strip segment to be the same value, and the grayscale values of the pixels in different light strip segments to be different and not equal to the grayscale value S; ③ When the orientation information A is up, traverse each column in the laser stripe image from top to bottom; when the orientation information A is down, traverse each column in the laser stripe image from bottom to top; During the traversal process, if the first pixel whose grayscale value is not equal to the grayscale value S is found in a certain column, the pixel is marked; Identify the light line segment to which the marked pixel belongs according to its grayscale value; ④ Count the marking rate of each light strip segment separately = ; If the marking rate is less than the threshold, the light strip segment is filtered out, otherwise, the light strip segment is retained; The threshold value ranges from 50% to 95%.
[0007] Furthermore, in step 2), the method of segmenting the light strip line segments corresponding to the non-glass surface from the retained light strip line segments is as follows: When the orientation information B is right, the right edge line of the image is recorded as the reference line; when the orientation information B is left, the left edge line of the image is recorded as the reference line; From the retained light strip segments, the light strip segments closest to the reference line are split out and marked as light strip segments corresponding to the non-glass surface.
[0008] Furthermore, in step 2), the method of segmenting the light strip line segments corresponding to the glass surface from the retained light strip line segments is as follows: When the orientation information B is right, the lower right corner of the image is recorded as the reference point; when the orientation information B is left, the lower left corner of the image is recorded as the reference point; From the retained light line segments, remove the light line segments corresponding to the non-glass surface, and then from the other light line segments, split the light line segments closest to the reference point and mark them as the light line segments corresponding to the glass surface.
[0009] When the laser stripe image includes a light stripe projected at the bottom of the gap, in order to prevent interference from the light stripe, preferably, in step 2), the light stripe line segments corresponding to the glass surface are segmented from the retained light stripe line segments as follows: When the orientation information B is right, the lower right corner of the image is recorded as the reference point; when the orientation information B is left, the lower left corner of the image is recorded as the reference point; Draw a vertical line C at the pixel point closest to the gap to be measured in the light line segment corresponding to the non-glass surface; The vertical line C is translated in the direction of the gap to be measured by a preset value; the preset value ranges from 1 / 3 of the gap value theoretical pixel width to 2 / 3 of the gap value theoretical pixel width; The light strip line segments intersecting with the translated straight line C are deleted, and with the translated straight line C as the central axis, the light strip line segments closest to the reference point on the opposite side of the orientation information B are segmented out and marked as the light strip line segments corresponding to the glass surface.
[0010] Furthermore, in step 3), the gap value and / or face difference value are calculated as follows: One of the spatial light strip line segment I and the spatial light strip line segment II is recorded as the first reference line segment, and the other is recorded as the first auxiliary line segment; Use the straight line segment of the first reference line segment to fit the straight line A, and draw a straight line L perpendicular to the straight line A at any point on the straight line segment, find the point farthest from the straight line L in the first reference line segment and store it as feature point I, find the point closest to the straight line L in the first auxiliary line segment and store it as feature point II; Draw straight lines parallel to the straight line L at the feature points I and II, respectively, and calculate the distance between the two straight lines, which is recorded as the gap value; On the straight line segment of the first auxiliary line segment, a single pixel point close to the arc segment is selected as a feature point A; The distance value between the feature point A and the straight line A is recorded as the surface difference value.
[0011] When the arc segment area in the center line of the laser stripe image is incomplete, in order to obtain a more accurate gap and face difference value, preferably, in step 3), the calculated gap value and / or face difference value is compensated, wherein the compensation value is obtained by the following process: For the first N glass pieces to be tested, the gap value and / or the face difference value are measured manually and compared with the gap value and / or the face difference value calculated in step 3) to obtain the deviation value, and the average of the N deviation values is taken as the compensation value.
[0012] Furthermore, the present invention also provides another method for calculating the gap value and / or the face difference value: In step 3), the gap value and / or face difference value are calculated as follows: Obtaining section line I on the theoretical numerical model of the non-glass surface, and obtaining section line II on the theoretical numerical model of the glass surface; The points in the spatial light strip line segment I are registered with the points on the profile line I, and the profile line I is rotated and translated using the rotation and translation matrix obtained by the registration to obtain the profile line I'; The points in the spatial light strip line segment II are registered with the points on the profile line II, and the profile line II is rotated and translated using the rotation and translation matrix obtained by the registration to obtain the profile line II'; One of the section line I' and the section line II' is recorded as the second reference line segment, and the other is recorded as the second auxiliary line segment; Use the straight line segment of the second reference line segment to fit the straight line A', and draw a straight line L' perpendicular to the straight line A' at any point on the straight line segment, find the point farthest from the straight line L' in the reference line segment and store it as a feature point I', find the point closest to the straight line L in the second auxiliary line segment and store it as a feature point II'; Draw straight lines parallel to the straight line L' at the feature point I' and feature point II', and calculate the distance between the two straight lines, which is recorded as the gap value; On the straight line segment of the auxiliary line segment, select a point close to the arc segment as the feature point A'; The distance value between the feature point A' and the straight line A' is recorded as the surface difference value.
[0013] This method has the following characteristics: According to the imaging characteristics of glass parts, the light strips with poor image quality on the glass surface are effectively filtered out; Use the orientation information to effectively distinguish the glass surface light strip line segments and the non-glass surface light strip line segments; For the invalid light line segments projected from the bottom of the gap, use the central axis to remove them to reduce interference; Compensate for the calculated gap and surface difference of the glass parts or use the profile information on the digital model to calculate the gap and surface difference, so that the calculation result is more accurate; It is suitable for the gap and flushness measurement of glass parts with high precision requirements, such as the gap and flushness measurement between automobile sunroof glass, front and rear windshield glass, window glass, triangular window glass and sheet metal parts. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is a schematic diagram of the light strip profile under ideal conditions; Figure 2 This is the imaging effect diagram of laser projection on the surface of the glass piece; Figure 3 Schematic diagram of the calculation principle of the flushness of the gap between glass parts in a specific implementation manner. DETAILED DESCRIPTION
[0015] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0016] In the actual detection of gap flushness, the components that construct the gap flushness vary greatly, and the reflective properties of components of different materials vary greatly. Therefore, for different types of gap flushness, the quality of the collected structured light images varies. For example, when the laser bar is projected on the gap flushness formed by the non-glass surfaces on both sides (such as the gap between two sheet metal parts), the collected light bar profile is as follows: Figure 1 , the light strips on both sides of the gap have clear, complete and continuous contours. At this time, we only need to accurately extract the center of the light strip and then use the center of the light strip to solve the gap flushness. However, when the laser strip is projected on the gap flushness at the connection between glass products and non-glass products (such as the gap between the glass of the car sunroof and the sheet metal parts, in this article, this type of gap flushness is called the glass part gap flushness), the collected light strip contour is as follows Figure 2 , the left light bar corresponds to the glass surface, and the right light bar corresponds to the non-glass surface. Figure 2 In the figure, it can be seen that the light strip on the left is unclear, discontinuous, and stratified; at this time, the gap surface difference value cannot be directly obtained.
[0017] In view of the above situation, this embodiment provides a method for measuring the flushness of a glass gap: In this method, the gap surface difference of glass parts refers to the gap surface difference at the connection between glass products and non-glass products. During measurement, a single-line laser projects laser light to the position to be measured (the projected laser line is roughly perpendicular to the gap to be measured), and a camera collects a laser bar image, and the laser bar is distributed horizontally. For a certain type of glass part, first carry out the teaching process: In the laser stripe image, the light stripe reflected from the inner layer of the glass surface is recorded as the upper light stripe, and the light stripe reflected from the outer layer of the glass surface is recorded as the lower light stripe. The light stripe with better imaging quality is selected from the upper light stripe and the lower light stripe and recorded as the dominant light stripe. Recording the position information A of the dominant light strip in the image and the position information B of the light strip reflected from the non-glass surface in the image; When the dominant light bar is the upper light bar, the azimuth information A is upper, and when the dominant light bar is the lower light bar, the azimuth information A is lower; When the light strip reflected by the non-glass surface is located in the left area of the image, the orientation information B is left, and when the light strip reflected by the non-glass surface is located in the right area of the image, the orientation information B is right; wherein, in order to obtain a more accurate gap surface difference value, when the image quality of the lower light strip can meet the detection accuracy requirements, the lower light strip is preferentially selected as the dominant light strip; For example, Figure 3 As shown, although the lower light strip contains four light strip line segments and is discontinuous, its arc segments are complete and the straight line segments connected to the arc segments are also clear. Therefore, the lower light strip is selected as the dominant light strip, and the orientation information A is down; in this image, the light strip reflected by the non-glass surface is on the right side of the image, and the orientation information B is right.
[0018] In the batch workpiece inspection scenario, the above process is a teaching process and only needs to be performed once. After recording the teaching information (orientation information), the teaching information can be directly called up in the subsequent actual measurement process.
[0019] During actual measurement, the same type of glass pieces to be tested are placed in the test area in turn, and laser stripe images are collected. The following processing is performed on each collected laser stripe image: Step 1) In the laser stripe image, extract each pixel point on the center line of the light stripe (Steger algorithm / center of gravity method); divide the light stripe into multiple segments according to the continuity between the pixel points; Exemplarily, the method for determining the continuous situation is: Determine the distance between two adjacent points. If the distance value is less than the threshold, the two points belong to the same light strip segment, otherwise, they belong to different light strip segments.
[0020] A more preferred implementation is to first filter out light line segments (noise points) whose size is smaller than a size threshold; Step 2), among the multiple light strip segments, a filtering condition is set based on the orientation information A, and among the light strips reflected from the glass surface, light strip segments that do not meet the orientation information A are filtered out; Then, the light strip line segments corresponding to the non-glass surface and the light strip line segments corresponding to the glass surface are divided from the retained light strip line segments, which are respectively recorded as light strip line segments I and light strip line segments II; Step 3) Each pixel point in light strip line segment I and light strip line segment II is converted into a spatial coordinate system, and spatial light strip line segment I and spatial light strip line segment II are obtained correspondingly. The gap value and / or surface difference value are solved by using spatial light strip line segment I and spatial light strip line segment II.
[0021] In specific implementation, in step 2), in the light strips reflected from the glass surface, light strip line segments that do not satisfy the orientation information A are filtered out in the following manner: ① In the laser stripe image, the pixels other than the light stripe segments are recorded as background points, and the grayscale values of the background points are uniformly assigned as grayscale value S; ② Set the grayscale values of each pixel in the same light strip segment to be the same value, and the grayscale values of the pixels in different light strip segments to be different from each other and not equal to the grayscale value S (preferably, S=0 or 255); ③ When the orientation information A is up, traverse each column in the laser bar image from top to bottom; when the orientation information A is down, traverse each column in the laser bar image from bottom to top; During the traversal process, if the first pixel whose grayscale value is not equal to the grayscale value S is found in a certain column, the pixel is marked; Identify the light line segment to which the marked pixel belongs according to its grayscale value; ④ Count the marking rate of each light strip segment separately = ; If the marking rate is less than the threshold, the light strip segment is filtered out, otherwise, the light strip segment is retained; The threshold value range is 50%~95%.
[0022] For example, Figure 3 As shown, ① in the laser bar image, the pixel points except the light bar segments are recorded as background points, and the grayscale value of each background point is uniformly assigned to 0; ② Use the following method to assign grayscale values to the pixels in each light strip segment: The grayscale values of the pixels in the same light strip segment are the same, while the grayscale values of the pixels in different light strip segments are different from each other and are not equal to the grayscale value of the background point 0; For example, the grayscale values of the pixels in the first light strip segment are all 10, the grayscale values of the pixels in the second light strip segment are all 20, and the grayscale values of the pixels in the third light strip segment are all 30. ③ The orientation information A is down, and each column in the laser strip image is traversed from bottom to top; during the traversal process, if the first pixel whose gray value is not equal to the gray value S is found in a certain column, the pixel is marked; Identify the light line segment to which the marked pixel belongs according to its grayscale value; For example, in a certain column, when the first pixel with a grayscale value equal to grayscale value 10 is identified, the pixel is marked; and according to the grayscale value 10 of the marked pixel, the light stripe segment to which it belongs is identified as the first segment; in a certain column, when the first pixel with a grayscale value equal to grayscale value 20 is identified, the pixel is marked; and according to the grayscale value 20 of the marked pixel, the light stripe segment to which it belongs is identified as the second segment; ④ Count the marking rate of each light strip segment separately = ; If the marking rate is less than the threshold = 90%, the light bar segment is filtered out, otherwise, the light bar segment is retained.
[0023] When traversing each column in the laser stripe image from bottom to top, the pixels in the four light stripe segments corresponding to the lower light stripe (the light stripe reflected by the outer layer of the glass surface) will theoretically be marked, and the marking rate is close to 100%; the upper light stripe (the light stripe reflected by the inner layer of the glass surface) is blocked by the lower light stripe, and only a small number of pixels in the corresponding one light stripe segment will be marked, and the marking rate is far less than 50%; for this reason, in this embodiment, the threshold is set to 50% to filter out the upper light stripe (non-dominant light stripe). Furthermore, since the middle light stripe segment (the light stripe projected at the bottom of the gap) and the right light stripe segment (the light stripe reflected by the outer layer of the glass surface) are not blocked, their marking rates will also be close to 100% and will not be filtered out.
[0024] Next, split the light strip segments corresponding to the non-glass surface and the light strip segments corresponding to the glass surface from the retained light strip segments: S1. The method of segmenting the light strip line segments corresponding to the non-glass surface is as follows: When the orientation information B is right, the right edge line of the image is recorded as the reference line; when the orientation information B is left, the left edge line of the image is recorded as the reference line; From the retained light strip segments, the light strip segment closest to the reference line is split out and marked as the light strip segment corresponding to the non-glass surface (light strip segment I).
[0025] S2. The method of distinguishing the light strip line segments corresponding to the glass surface is as follows: In the actual detection process, there are two typical situations: The first situation is: the collected laser bar image only contains the light bar contours on the left and right sides, and does not contain the middle light bar contour reflected by the bottom of the gap of the object to be measured. For example, there is no bottom at the gap. In this case, the method of distinguishing the light bar line segment corresponding to the glass surface is: When the orientation information B is right, the lower right corner of the image is recorded as the reference point; when the orientation information B is left, the lower left corner of the image is recorded as the reference point; From the retained light strip segments, remove the light strip segments corresponding to the non-glass surface, and then from the other light strip segments, split the light strip segments closest to the reference point and mark them as the light strip segments corresponding to the glass surface (light strip segment II).
[0026] The second situation is that the collected laser bar image contains not only the left and right light bar contours, but also the middle light bar contour reflected by the bottom of the gap of the object to be measured, such as Figure 3In the exemplary image of , a light strip projected on the bottom of the gap is included. At this time, in order to prevent the interference of the light strip, the method of segmenting the light strip line segment corresponding to the glass surface from the retained light strip line segment is as follows: When the orientation information B is right, the lower right corner of the image is recorded as the reference point; when the orientation information B is left, the lower left corner of the image is recorded as the reference point; Draw a vertical line C at the pixel point closest to the gap to be measured in the light line segment corresponding to the non-glass surface; The vertical line C is translated by a preset value in the direction of the gap to be measured; the preset value ranges from 1 / 3 of the gap value theoretical pixel width to 2 / 3 of the gap value theoretical pixel width; The light strip line segment intersecting with the translated straight line C is deleted, and with the translated straight line C as the central axis, the light strip line segment closest to the reference point is split out from the light strip line segments on the opposite side of the orientation information B, and marked as the light strip line segment corresponding to the glass surface (light strip line segment II).
[0027] For example: Figure 3 In the figure, the vertical line C is translated to the left by 1 / 2 of the theoretical pixel width of the gap value and recorded as the central axis. The light strip segment passing through the central axis is deleted. Among the light strip segments on the left side of the central axis, the light strip segment closest to the reference point is split out and marked as light strip segment II (the light strip segment corresponding to the glass surface).
[0028] More specifically, in this embodiment, two methods for calculating the gap value and / or the face difference value are provided: Method 1: In step 3), the gap value and / or face difference value are calculated as follows: One of the spatial light strip line segment I and the spatial light strip line segment II is recorded as the first reference line segment, and the other is recorded as the first auxiliary line segment; Use the straight line segment of the first reference line segment to fit the straight line A, and draw a straight line L perpendicular to the straight line A at any point on the straight line segment, find the point farthest from the straight line L in the first reference line segment and store it as feature point I, find the point closest to the straight line L in the first auxiliary line segment and store it as feature point II; Draw straight lines parallel to the straight line L at the feature points I and II, respectively, and calculate the distance between the two straight lines, which is recorded as the gap value; On the straight line segment of the first auxiliary line segment, a single pixel point close to the arc segment is selected as a feature point A; The distance value between the feature point A and the straight line A is recorded as the surface difference value.
[0029] To facilitate the solution, it is preferably implemented that the XOY plane of the spatial coordinate system coincides with the light plane projected by the laser, and the Z axis is perpendicular to the light plane; at this time, the coordinate component in the Z-axis direction of the converted three-dimensional coordinates is 0, and one dimension of coordinate solution is reduced when calculating the gap surface difference value.
[0030] When the arc segment area in the center line of the laser bar image is incomplete, in order to obtain a more accurate gap and face difference value, it is preferably implemented as follows: in step 3), the calculated gap value and / or face difference value is compensated, and the compensation value is obtained by the following process: For the first N glass pieces to be tested, the gap value and / or the face difference value are measured manually and compared with the gap value and / or the face difference value calculated in step 3) to obtain the deviation value, and the average of the N deviation values is taken as the compensation value.
[0031] Method 2: In step 3), the gap value and / or face difference value are calculated as follows: Obtaining section line I on the theoretical numerical model of the non-glass surface, and obtaining section line II on the theoretical numerical model of the glass surface; The points in the spatial light strip line segment I are registered with the points on the profile line I, and the profile line I is rotated and translated using the rotation and translation matrix obtained by the registration to obtain the profile line I'; The points in the spatial light strip line segment II are registered with the points on the profile line II, and the profile line II is rotated and translated using the rotation and translation matrix obtained by the registration to obtain the profile line II'; One of the section line I' and the section line II' is recorded as the second reference line segment, and the other is recorded as the second auxiliary line segment; Use the straight line segment of the second reference line segment to fit the straight line A', and draw a straight line L' perpendicular to the straight line A' at any point on the straight line segment, find the point farthest from the straight line L' in the reference line segment and store it as a feature point I', find the point closest to the straight line L in the second auxiliary line segment and store it as a feature point II'; Draw straight lines parallel to the straight line L' at the feature point I' and feature point II', and calculate the distance between the two straight lines, which is recorded as the gap value; On the straight line segment of the auxiliary line segment, select a point close to the arc segment as the feature point A'; The distance value between the feature point A' and the straight line A' is recorded as the surface difference value.
[0032] The present invention aims at the imaging characteristics of glass parts, effectively filters out light strips and line segments with poor image quality on the glass surface, and the calculation result has higher accuracy; and is suitable for the gap and flushness measurement of glass parts with high-precision requirements.
[0033] The foregoing description of the specific exemplary embodiments of the present invention is presented for the purpose of illustration and description. The foregoing description is not intended to be exhaustive, nor is it intended to limit the present invention to the precise form disclosed, and it is apparent that many changes and variations are possible in light of the above teachings. The exemplary embodiments are selected and described to explain the specific principles of the present invention and its practical application, so that other technicians in the field can realize and utilize the various exemplary embodiments of the present invention and its different selected forms and modified forms. The scope of the present invention is intended to be limited by the appended claims and their equivalents.
Claims
1. A method for measuring the gap flushness of glass parts, wherein the gap flushness of glass parts refers to the gap flushness at the connection between a glass product and a non-glass product; during measurement, a single-line laser projects laser light to a position to be measured, and a camera collects a laser bar image, in which the laser bar is distributed horizontally; Features: For a certain type of glass parts, the following process is carried out first: In the laser stripe image, the light stripe reflected from the inner layer of the glass surface is recorded as the upper light stripe, and the light stripe reflected from the outer layer of the glass surface is recorded as the lower light stripe. The light stripe with better imaging quality is selected from the upper light stripe and the lower light stripe and recorded as the dominant light stripe. Recording the position information A of the dominant light strip in the image and the position information B of the light strip reflected by the non-glass surface in the image; When the dominant light bar is an upper light bar, the position information A is upper, and when the dominant light bar is a lower light bar, the position information A is lower; When the light strip reflected by the non-glass surface is located in the left area of the image, the orientation information B is left; when the light strip reflected by the non-glass surface is located in the right area of the image, the orientation information B is right; During actual measurement, the same type of glass pieces to be tested are placed in the detection area in turn to collect laser bar images, and the following processing is performed on each collected laser bar image: Step 1), in the laser stripe image, extract each pixel point on the center line of the light stripe; divide the light stripe into multiple line segments according to the continuity between the pixel points; Step 2), among the multiple light strip segments, a filtering condition is set based on the orientation information A, and among the light strips reflected from the glass surface, light strip segments that do not meet the orientation information A are filtered out; Then, the light strip line segments corresponding to the non-glass surface and the light strip line segments corresponding to the glass surface are divided from the retained light strip line segments, which are respectively recorded as light strip line segments I and light strip line segments II; Step 3), convert each pixel point in light strip line segment I and light strip line segment II into the spatial coordinate system, and obtain spatial light strip line segment I and spatial light strip line segment II correspondingly, and use the spatial light strip line segment I and spatial light strip line segment II to solve the gap value and / or surface difference value.
2. The method for measuring the flushness of a glass part gap according to claim 1, characterized in that: In step 2), the light strips that do not satisfy the orientation information A are filtered out from the light strips reflected from the glass surface in the following manner: ① In the laser stripe image, the pixels other than the light stripe segments are recorded as background points, and the grayscale values of the background points are uniformly assigned as grayscale value S; ② Set the grayscale values of each pixel in the same light strip segment to be the same value, and the grayscale values of the pixels in different light strip segments to be different and not equal to the grayscale value S; ③ When the orientation information A is up, traverse each column in the laser stripe image from top to bottom; when the orientation information A is down, traverse each column in the laser stripe image from bottom to top; During the traversal process, if the first pixel whose grayscale value is not equal to the grayscale value S is found in a certain column, the pixel is marked; Identify the light line segment to which the marked pixel belongs according to its grayscale value; ④ Count the marking rate of each light strip segment separately = ; If the marking rate is less than the threshold, the light strip segment is filtered out, otherwise, the light strip segment is retained; The threshold value ranges from 50% to 95%.
3. The method for measuring the flushness of a glass gap as claimed in claim 1 or 2, characterized in that: In step 2), the method of segmenting the light strip line segments corresponding to the non-glass surface from the retained light strip line segments is as follows: When the orientation information B is right, the right edge line of the image is recorded as the reference line; when the orientation information B is left, the left edge line of the image is recorded as the reference line; From the retained light strip segments, the light strip segments closest to the reference line are split out and marked as light strip segments corresponding to the non-glass surface.
4. The method for measuring flushness of a glass part gap as claimed in claim 3, characterized in that: In step 2), the method of segmenting the light strip line segments corresponding to the glass surface from the retained light strip line segments is as follows: When the orientation information B is right, the lower right corner of the image is recorded as the reference point; when the orientation information B is left, the lower left corner of the image is recorded as the reference point; From the retained light line segments, remove the light line segments corresponding to the non-glass surface, and then from the other light line segments, split the light line segments closest to the reference point and mark them as the light line segments corresponding to the glass surface.
5. The method for measuring the flushness of a glass gap as claimed in claim 3, characterized in that: When the laser stripe image includes a light stripe projected at the bottom of the gap, in step 2), the method of segmenting the light stripe line segment corresponding to the glass surface from the retained light stripe line segment is as follows: When the orientation information B is right, the lower right corner of the image is recorded as the reference point; when the orientation information B is left, the lower left corner of the image is recorded as the reference point; Draw a vertical line C at the pixel point closest to the gap to be measured in the light line segment corresponding to the non-glass surface; The vertical line C is translated in the direction of the gap to be measured by a preset value; the preset value ranges from 1 / 3 of the gap value theoretical pixel width to 2 / 3 of the gap value theoretical pixel width; The light strip line segments intersecting with the translated straight line C are deleted, and with the translated straight line C as the central axis, the light strip line segments closest to the reference point on the opposite side of the orientation information B are segmented out and marked as the light strip line segments corresponding to the glass surface.
6. The method for measuring the flushness of a glass gap as claimed in claim 1 or 2, characterized in that: In step 3), the gap value and / or face difference value are calculated as follows: One of the spatial light strip line segment I and the spatial light strip line segment II is recorded as the first reference line segment, and the other is recorded as the first auxiliary line segment; Use the straight line segment of the first reference line segment to fit the straight line A, and draw a straight line L perpendicular to the straight line A at any point on the straight line segment, find the point farthest from the straight line L in the first reference line segment and store it as feature point I, find the point closest to the straight line L in the first auxiliary line segment and store it as feature point II; Draw straight lines parallel to the straight line L at the feature points I and II, respectively, and calculate the distance between the two straight lines, which is recorded as the gap value; On the straight line segment of the first auxiliary line segment, a single pixel point close to the arc segment is selected as a feature point A; The distance value between the feature point A and the straight line A is recorded as the surface difference value.
7. The method for measuring the flushness of a glass member gap according to claim 6, wherein: In step 3), the calculated gap value and / or face difference value is compensated, wherein the compensation value is obtained by the following process: For the first N glass pieces to be tested, the gap value and / or the face difference value are measured manually and compared with the gap value and / or the face difference value calculated in step 3) to obtain the deviation value, and the average of the N deviation values is taken as the compensation value.
8. The method for measuring the flushness of a gap between glass parts according to claim 1 or 2, characterized in that: In step 3), the gap value and / or face difference value are calculated as follows: Obtaining section line I on the theoretical numerical model of the non-glass surface, and obtaining section line II on the theoretical numerical model of the glass surface; The points in the spatial light strip line segment I are registered with the points on the profile line I, and the profile line I is rotated and translated using the rotation and translation matrix obtained by the registration to obtain the profile line I'; The points in the spatial light strip line segment II are registered with the points on the profile line II, and the profile line II is rotated and translated using the rotation and translation matrix obtained by the registration to obtain the profile line II'; One of the section line I' and the section line II' is recorded as the second reference line segment, and the other is recorded as the second auxiliary line segment; Use the straight line segment of the second reference line segment to fit the straight line A', and draw a straight line L' perpendicular to the straight line A' at any point on the straight line segment, find the point farthest from the straight line L' in the reference line segment and store it as a feature point I', find the point closest to the straight line L in the second auxiliary line segment and store it as a feature point II'; Draw straight lines parallel to the straight line L' at the feature point I' and feature point II', and calculate the distance between the two straight lines, which is recorded as the gap value; On the straight line segment of the auxiliary line segment, select a point close to the arc segment as the feature point A'; The distance value between the feature point A' and the straight line A' is recorded as the surface difference value.
