| CPC G06T 7/62 (2017.01) [G06T 5/30 (2013.01); G06T 7/13 (2017.01); G06T 7/187 (2017.01); G06T 2207/20036 (2013.01)] | 18 Claims |

|
1. A linewidth measurement method, for measuring a width of a line, comprising:
obtaining a target image of the line, wherein the line comprises a first line segment;
performing region connecting on an edge image or binary image of the target image to obtain a region connected image, wherein the edge image is an image obtained by edge detection of the target image, the binary image is an image obtained by image binarization of the target image, and the region connected image comprises a target connected region corresponding to a pattern of the line, and a pixel value of each pixel in the target connected region is different from that of each pixel outside the target connected region;
determining a first edge point and a second edge point of the first line segment based on the region connected image, wherein the first edge point is located on a first edge line of the first line segment, the second edge point is located on a second edge line of the second line segment, and the first edge line and the second edge line are oppositely arranged in a first direction; and
determining a width of the first line segment according to the first edge point and the second edge point, and determining the width of the line according to the width of the first line segment,
wherein the target connected region comprises a first connected region corresponding to the first line segment, and determining the first edge point and the second edge point of the first line segment based on the region connected image comprises:
extracting pixels on two opposite sides of the first connected region in the first direction to obtain the first edge point and the second edge point; and
wherein the line further comprises a second line segment which intersects with the first line segment, and the first line segment comprises a first branch line located at one side of an intersection of the first line segment and the second line segment, and the second line segment comprises a second branch line located at one side of the intersection, and a plurality of pixels of the region connected image are arrayed in array in a row direction and in a column direction, extracting pixels on two opposite sides of the first connected region in the first direction to obtain the first edge point and the second edge point comprises:
determining a sampling region in the region connected image, wherein the sampling region comprises a first sampling region, the first sampling region comprises a first boundary and a second boundary which are oppositely arranged in the column direction, and a third boundary and a fourth boundary which connect the first boundary with the second boundary, a target connected region in the first sampling region comprises a first sub-connected region corresponding to the first branch line and a second sub-connected region corresponding to the second branch line, two oppositely arranged sides of the first sub-connected region in the first direction and two oppositely arranged sides of the second sub-connected region in the second direction are connected with both the first boundary and the second boundary, and the first sub-connected region is located at a side of the second sub-connected region close to the third boundary; and
performing a first scanning treatment on pixels in the first sampling region, wherein the first scanning treatment comprises: scanning from the third boundary to the fourth boundary in a same row of pixels, and determining a first pixel whose pixel value is the first pixel value as the first edge point; scanning from the fourth boundary to the third boundary, and determining a first pixel whose pixel value is the first pixel value as a fourth edge point of the second line segment; determining a first center point of the first edge point and the fourth edge point in the same row of pixels; scanning from the first center point to the third boundary, and determining a first pixel whose pixel value is the first pixel value as the second edge point; scanning from the first center point to the fourth boundary, and determining a first pixel whose pixel value is the first pixel value as the third edge point of the second line segment;
wherein the third edge point is located on a third edge line of the second line segment, the fourth edge point is located on a fourth edge line of the second line segment, and the third edge line and the fourth edge line are oppositely arranged in the second direction.
|