Positioning method and device, and storage medium
View Patent ↗A positioning method including: acquiring a gray-scale image of an object to be measured to determine a gray-scale value of each pixel on the gray-scale image; determining a target area to be measured and a first gray-scale change area adjacent to the target area to be measured based on the gray-scale value of each pixel; determining a target gray-scale value based on a gray-scale value of the target area to be measured and a gray-scale value of each pixel in the first gray-scale change area; determining target pixels that conform to the target gray-scale value in the first gray-scale change area, to use the target pixels as actual edge pixels of the target area to be measured; and determining a relative distance between a center position of the target area to be measured and a reference position, to obtain position information of the target area.
1. A positioning method comprising:
acquiring a gray-scale image of an object to be measured to determine a gray-scale value of each pixel on the gray-scale image;
determining a target area to be measured in the gray-scale image and a first gray-scale change area located between a Frit area and a glass plate area;
determining a target gray-scale value based on a gray-scale value of the target area to be measured and a gray-scale value of each pixel in the first gray-scale change area;
determining target pixels that conform to the target gray-scale value in the first gray-scale change area, to use the target pixels as actual edge pixels of the target area to be measured; and
determining a relative distance between a center position of the target area to be measured and a reference position based on the actual edge pixels of the target area to be measured, to obtain position information of the target area to be measured.
2. The method of claim 1 , further comprising:
determining a first gray-scale value and a second gray-scale value based on the gray-scale value of each pixel on the gray-scale image;
identifying a first pixel in the gray-scale image with a gray-scale value equal to the first gray-scale value, to determine an area where the first pixel is located as the target area to be measured;
identifying a second pixel in the gray-scale image with a gray-scale value between the first gray-scale value and the second gray-scale value; and
determining an area where the second pixel is located as the first gray-scale change area.
3. The method of claim 1 , further comprising:
determining multiple groups of candidate pixels in the first gray-scale change area based on the gray-scale value of each pixel in the first gray-scale change area, wherein for each of the multiple groups of candidate pixels, a difference between gray-scale values of the candidate pixels is greater than a first preset threshold and the candidate pixels are adjacent to each other; and
determining, an average value of gray-scale values of the multiple groups of candidate pixels as the target gray-scale value.
4. The method of claim 1 , further comprising:
determining M pixels in the first gray-scale change area based on the gray-scale value of each pixel in the first gray-scale change area and the target gray-scale value, wherein each of the M pixels has a gray-scale value equal to the target gray-scale value; and
determining N pixels from the M pixels to use the N pixels as the target pixels, wherein a ratio of N to M is greater than a second preset threshold, where M≥N, and M and N are both positive integers greater than 1.
5. The method of claim 1 , wherein the actual edge pixels of the target area to be measured comprise actual edge pixels of a first edge of the target area to be measured and actual edge pixels of a second edge of the target area to be measured, the center position of the target area to be measured is a center line of the target area to be measured, the reference position is a reference straight line, the first edge, the second edge, the center line and the reference straight line are parallel to each other, and the method further comprises:
acquiring a number and size of pixels between the first edge and the reference straight line and between the second edge and the reference straight line respectively in a direction perpendicular to the first edge;
calculating a relative distance between the first edge and the reference straight line and a relative distance between the second edge and the reference straight line respectively based on the number and size of pixels; and
determining a relative distance between the center line of the target area to be measured and the reference straight line based on the relative distance between the first edge and the reference straight line and the relative distance between the second edge and the reference straight line.
6. The method of claim 5 , further comprising:
determining a width dimension of the target area to be measured in the direction perpendicular to the first edge, based on the relative distance between the first edge and the reference straight line and the relative distance between the second edge and the reference straight line.
7. The method of claim 5 , further comprising:
determining a reference area in the gray-scale image and a second gray-scale change area located between a display area and a molybdenum line area; and
determining actual edge pixels of the reference area in the second gray-scale change area to use a straight line where the actual edge pixels of the reference area are located as the reference straight line.
8. The method of claim 1 , wherein the center position of the target area to be measured is a measurement center point position of the target area to be measured, the reference position is a preset center point position corresponding to the target area to be measured, and the method further comprises:
determining a shape of the target area to be measured based on the actual edge pixels of the target area to be measured;
comparing the shape of the target area to be measured with a preset shape to obtain a similarity between the shape of the target area to be measured and the preset shape; and
calculating a relative distance between the measurement center point position of the target area to be measured and the preset center point position when the similarity is greater than a third preset threshold.
9. A positioning device comprising a processor having a program that implements a method, wherein the processor is configured to:
acquire a gray-scale image of an object to be measured to determine a gray-scale value of each pixel on the gray-scale image;
determine a target area to be measured in the gray-scale image and a first gray-scale change area located between a Frit area and a glass plate area;
determine a target gray-scale value based on a gray-scale value of the target area to be measured and a gray-scale value of each pixel in the first gray-scale change area;
determine target pixels that conform to the target gray-scale value in the first gray-scale change area, to use the target pixels as actual edge pixels of the target area to be measured; and
determine a relative distance between a center position of the target area to be measured and a reference position based on the actual edge pixels of the target area to be measured, to obtain position information of the target area to be measured.
10. The positioning device of claim 9 , wherein the processor is further configured to:
determine a first gray-scale value and a second gray-scale value based on the gray-scale value of each pixel on the gray-scale image;
identify a first pixel in the gray-scale image with a gray-scale value equal to the first gray-scale value, to determine an area where the first pixel is located as the target area to be measured;
identify a second pixel in the gray-scale image with a gray-scale value between the first gray-scale value and the second gray-scale value; and
determine an area where the second pixel is located as the first gray-scale change area.
11. The positioning device of claim 9 , wherein the processor is further configured to:
determine multiple groups of candidate pixels in the first gray-scale change area based on the gray-scale value of each pixel in the first gray-scale change area, wherein for each of the multiple groups of candidate pixels, a difference between gray-scale values of the candidate pixels is greater than a first preset threshold and the candidate pixels are adjacent to each other; and
determine, an average value of gray-scale values of the multiple groups of candidate pixels as the target gray-scale value.
12. The positioning device of claim 9 , wherein the processor is further configured to:
determine M pixels in the first gray-scale change area based on the gray-scale value of each pixel in the first gray-scale change area and the target gray-scale value, wherein each of the M pixels has a gray-scale value equal to the target gray-scale value; and
determine N pixels from the M pixels to use the N pixels as the target pixels, wherein a ratio of N to M is greater than a second preset threshold, where M≥N, and M and N are both positive integers greater than 1.
13. The positioning device of claim 9 , wherein the actual edge pixels of the target area to be measured comprise actual edge pixels of a first edge of the target area to be measured and actual edge pixels of a second edge of the target area to be measured, the center position of the target area to be measured is a center line of the target area to be measured, the reference position is a reference straight line, the first edge, the second edge, the center line and the reference straight line are parallel to each other, and the processor is further configured to:
acquire a number and size of pixels between the first edge and the reference straight line and between the second edge and the reference straight line respectively in a direction perpendicular to the first edge;
calculate a relative distance between the first edge and the reference straight line and a relative distance between the second edge and the reference straight line respectively based on the number and size of pixels; and
determine a relative distance between the center line of the target area to be measured and the reference straight line based on the relative distance between the first edge and the reference straight line and the relative distance between the second edge and the reference straight line.
14. The positioning device of claim 13 , wherein the processor is further configured to:
determine a width dimension of the target area to be measured in the direction perpendicular to the first edge, based on the relative distance between the first edge and the reference straight line and the relative distance between the second edge and the reference straight line.
15. The positioning device of claim 13 , wherein the processor is further configured to:
determine a reference area in the gray-scale image and a second gray-scale change area located between a display area and a molybdenum line area, and
determine actual edge pixels of the reference area in the second gray-scale change area to use a straight line where the actual edge pixels of the reference area are located as the reference straight line.
16. The positioning device of claim 9 , wherein the center position of the target area to be measured is a measurement center point position of the target area to be measured, the reference position is a preset center point position corresponding to the target area to be measured, and the processor is further configured to:
determine a shape of the target area to be measured based on the actual edge pixels of the target area to be measured;
compare the shape of the target area to be measured with a preset shape to obtain a similarity between the shape of the target area to be measured and the preset shape; and
calculate a relative distance between the measurement center point position of the target area to be measured and the preset center point position when the similarity is greater than a third preset threshold.
17. A non-transitory computer readable storage medium storing a program thereon, wherein the program, when executed by a processor, implements a positioning method by executing:
instructions for acquiring a gray-scale image of an object to be measured to determine a gray-scale value of each pixel on the gray-scale image;
instructions for determining a target area to be measured in the gray-scale image and a first gray-scale change area located between a Frit area and a glass plate area;
instructions for determining a target gray-scale value based on a gray-scale value of the target area to be measured and a gray-scale value of each pixel in the first gray-scale change area;
instructions for determining target pixels that conform to the target gray-scale value in the first gray-scale change area, to use the target pixels as actual edge pixels of the target area to be measured; and
instructions for determining a relative distance between a center position of the target area to be measured and a reference position based on the actual edge pixels of the target area to be measured, to obtain position information of the target area to be measured.