US 12,340,499 B1
Method and system for statistics of thickness of corrosion product film based on image processing
Cailin Wang, Qingdao (CN); Yuxing Li, Qingdao (CN); Cuiwei Liu, Qingdao (CN); Qu'er Chen, Qingdao (CN); Xiusai Xu, Qingdao (CN); Rui Zhang, Qingdao (CN); Jun Zhang, Qingdao (CN); and Zaiyu Xia, Qingdao (CN)
Assigned to CHINA UNIVERSITY OF PETROLEUM (EAST CHINA), Qingdao (CN)
Filed by CHINA UNIVERSITY OF PETROLEUM (EAST CHINA), Shandong (CN)
Filed on Nov. 15, 2024, as Appl. No. 18/949,614.
Claims priority of application No. 202311773693.3 (CN), filed on Dec. 22, 2023.
Int. Cl. G06T 7/00 (2017.01); G06T 7/11 (2017.01); G06T 7/136 (2017.01); G06T 7/194 (2017.01)
CPC G06T 7/0004 (2013.01) [G06T 7/11 (2017.01); G06T 7/136 (2017.01); G06T 7/194 (2017.01); G06T 2207/10061 (2013.01); G06T 2207/20021 (2013.01); G06T 2207/20221 (2013.01)] 8 Claims
OG exemplary drawing
 
1. A method for statistics of thickness of a corrosion product film based on image processing, comprising:
acquiring a plurality of images of a corrosion product film on a surface of a pipeline;
stitching the plurality of the images to obtain an overall image, specifically by: dividing each of the plurality of the images into a plurality of grid cells, estimating a homography matrix for each of the plurality of the grid cells; removing error matching points and calculating a global homography matrix according to the estimated homography matrices; calculating weight matrices in moving linear transformation in blocks according to the calculated global homography matrix and mapping to obtain the stitched overall image;
segmenting the overall image to obtain a feature area of the corrosion product film, specifically by: segmenting a gray histogram into two sets of data: target data and background data, by using thresholds, taking one of the thresholds that maximizes an inter class variance between the segmented target data and background data as an optimal segmentation threshold, and then segmenting the overall image by using the optimal segmentation threshold; and
performing division of thickness layers on the feature area of the corrosion product film according to a number of pixel points in a vertical direction of thickness, counting the number of the pixel points of each of the thickness layers, and obtaining a thickness of each of the thickness layers according to the counted number of the pixel points, specifically comprising:
performing the division of the thickness layers of the corrosion product film according to the pixel points, counting the number of the pixel points layer by layer and converting into thickness; specifically, the statistics of the thickness of the corrosion product film, comprising:
dividing the corrosion product film into n layers according to the number of pixel points n in the thickness vertical direction;
scanning layer by layer and counting the number of pixel points between two interfaces of each of the thickness layers, multiply the number of the pixel points by the size of the pixel points, and convert to thickness; wherein,
specifically, pixel values of the pixel points are retrieved one by one along the thickness direction in a certain layer i; when the pixel value is changed from 0 to 1, it indicates that the background is changed into the corrosion product film, which is the first boundary of the corrosion product film of this layer, and the position of this point is recorded as j1; keeping retrieving, when the pixel value is changed from 1 to 0 again, it indicates that the corrosion product film is changed into the background, which is the second boundary of the corrosion product film of this layer, and the position of this point is recorded as j2; the thickness hi of the ith layer of the corrosion product film is:
hi=N|j2−j1|
where, N is the pixel size; and
completing the statistics of the thickness of the corrosion product film in the panoramic image, wherein hi is the thickness of the corrosion product film at a certain position obtained statistically.