A misalignment correction algorithm for ultrasonic C-scan images
Through the ultrasonic C scan image dislocation correction algorithm, the problem of image dislocation in ultrasonic C scan imaging is solved by using grayscale, region correlation coefficient calculation and weighted correction technology, and the image resolution is retained and the imaging effect is optimized.
Patent Information
- Application Number
- CN202310390198.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-04-13
AI Technical Summary
During ultrasonic C scanning imaging, due to mechanical motion and signal processing errors, the image has misaligned fringes, and the prior art cannot be effectively corrected, affecting the image resolution and imaging effect.
The ultrasonic C-scan image misalignment correction algorithm is used to correct image misalignment patterns through grayscale and downsampling, region correlation coefficient calculation and weighted correction, image dislocation patterns are corrected, image resolution is preserved, and imaging effects are optimized.
Without sacrificing image resolution, effectively correct image misalignment, improve image smoothness and defect detection capabilities, and optimize imaging effects.
Smart Images

Figure CN116580117B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ultrasonic processing technology, and specifically relates to an ultrasonic C-scan image misalignment correction algorithm. Background Art
[0002] During ultrasonic C-scan imaging, errors in mechanical motion and signal processing can cause misaligned streaks to appear in the image. Mechanical motion can cause mutual displacement or deflection between the end ultrasonic transducer and the workpiece due to overall system stiffness issues, as well as inherent errors in the mechanical system structure and installation. This can lead to discrepancies between the actual detected position and the position data recorded by the grating scale. During signal processing, the acquisition card controls signal triggering and acquisition. Since the signal transmission process has a certain time delay, the motion position information recorded by the acquisition card cannot accurately represent the actual position when the ultrasonic wave penetrates the workpiece and generates an echo. This error cannot be completely eliminated due to hardware reasons, and subsequent image processing algorithms are required to correct the C-scan image misalignment. Summary of the Invention
[0003] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide an ultrasonic C-scan image misalignment correction algorithm, which can repair the misalignment errors in the C-scan image without sacrificing image resolution, make the image smooth, optimize the imaging effect, improve the effect of subsequent image morphology and image enhancement processing, and is also beneficial to the related work of defect detection and quantitative evaluation.
[0004] To achieve the above object, the present invention provides the following technical solution: an ultrasonic C-scan image misalignment correction algorithm, the steps of which are as follows:
[0005] (1) First, grayscale and downsample the image to be processed according to the resolution set when drawing the C-scan image, so that the width of a single row of the dislocation pattern is a single pixel;
[0006] (2) Starting from the fifth column of the image, taking the first pixel of the column as the reference, calculate the sum of all odd-numbered rows and the corresponding even-numbered rows in a column and divide it by the total number of rows for comparison;
[0007] (3) Calculate the regional correlation coefficients of the offset pixel points n from -5 to 5, a total of eleven columns, and compare them. The offset n corresponding to the maximum correlation coefficient is taken as the corrected offset;
[0008] (4) Perform weighted correction on pixels in even rows according to the offset n;
[0009] (5) Since the error accumulation changes uniformly, in order to avoid sudden changes in the correction results, the regional correlation value is calculated starting from the sixth column, with a total of three horizontal pixel ranges of n±1 in the previous column, and the correction is also performed based on the maximum offset n of the correlation value;
[0010] (6) After the misalignment correction is completed, the image can be denoised and defect detected.
[0011] In some embodiments, according to step (2), the calculation function is:
[0012]
[0013] Where P (x,y) Represents the pixel value of the point with coordinates (x, y), then P (x+n,y+1) Indicates the value of the next row, offset by n pixels, and rows indicates the total number of rows in the image.
[0014] In some embodiments, according to step (4), the specific modification is as follows:
[0015]
[0016] Where P (x,y) Represents the pixel value of the point with coordinates (x, y), R n-1 and R n+1 Indicates the correlation coefficient between the two columns to the left and right of the x+n column with the largest correlation coefficient.
[0017] In some embodiments, the values of i and j should satisfy i+j=1.
[0018] In some embodiments, i=0.8 and j=0.2 are taken through experiments.
[0019] Compared with existing technologies, the present invention offers the following advantages: This algorithm calculates regional correlation coefficients for uneven misalignment patterns in images, obtains optimized offset compensation values, and corrects the image. The algorithm offers superior processing performance, correcting misalignment errors in C-scan images without sacrificing image resolution, resulting in smoother images and optimized imaging.
[0020] Details of one or more embodiments of the present application are presented in the following drawings and descriptions to make other features, purposes and advantages of the present application more concise and easy to understand, and the present application is fully described and understood through the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a process flow chart of the present invention;
[0022] Figure 2 This is a diagram of the image processing structure of the present invention.
[0023] Figure 3 This is an image processing effect diagram of the present invention. DETAILED DESCRIPTION
[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0025] See also Figures 1 to 3 The present invention provides a technical solution: an ultrasonic C-scan image misalignment correction algorithm using an ultrasonic scanning microscope (USM). This technique integrates ultrasonic C-scan technology with high-frequency ultrasonic technology and a high-speed, high-precision electromechanical system to form a high-precision imaging and analysis instrument. Due to its high resolution, it can be used in biomedical and microelectronic applications. Ultrasonic microscopy technology involves high-frequency transducer manufacturing, electromechanical control, ultrasonic signal acquisition, digital signal processing, and image processing.
[0026] Ultrasonic C-scan technology combines ultrasonic testing with microcomputer control and data acquisition, storage, processing, and image display. C-scan imaging uses the principle of ultrasonic reflection to extract echo information perpendicular to a specified cross-section of the sound beam (i.e., a transverse cross-sectional image) to form a two-dimensional image. The principle is simple and can obtain information from different cross-sections. It is widely used in industries such as semiconductors, life sciences, materials science, and nanotechnology.
[0027] The principle of ultrasonic C-scan technology is to process the ultrasonic echo signal perpendicular to the cross section to be measured and draw a complete plane scan image in combination with the position information. In the technical field of ultrasonic C-scan alignment, the existing technology will cause information loss when processing image misalignment errors, resulting in blurred edges and reduced resolution. Therefore, this application implements an ultrasonic C-scan image misalignment correction algorithm.
[0028] The steps are:
[0029] (1) First, grayscale and downsample the image to be processed according to the resolution set when drawing the C-scan image, so that the width of a single row of the dislocation pattern is a single pixel;
[0030] (2) Starting from the fifth column of the image, taking the first pixel of the column as the reference, calculate the sum of all odd-numbered rows and the corresponding even-numbered rows in a column and divide it by the total number of rows for comparison;
[0031] (3) Calculate the regional correlation coefficients of the offset pixel points n from -5 to 5, a total of eleven columns, and compare them. The offset n corresponding to the maximum correlation coefficient is taken as the corrected offset;
[0032] (4) Perform weighted correction on pixels in even rows according to the offset n;
[0033] (5) Since the error accumulation changes uniformly, in order to avoid sudden changes in the correction results, the regional correlation value is calculated starting from the sixth column, with a total of three horizontal pixel ranges of n±1 in the previous column, and the correction is also performed based on the maximum offset n of the correlation value;
[0034] (6) Figure 3 After the misalignment correction is completed for the whole image, the image can be filtered and edge detected. Figure 3 .c and Figure 3 .dComparison shows that this algorithm is beneficial to defect detection in ultrasonic scanning images.
[0035] According to step (2), the calculation function is:
[0036]
[0037] Where P (x,y) Represents the pixel value of the point with coordinates (x, y), then P (x+n,y+1) Indicates the value of the next row, offset by n pixels, and rows indicates the total number of rows in the image.
[0038] According to step (4), the specific revised announcement is:
[0039]
[0040] Where P (x,y) Represents the pixel value of the point with coordinates (x, y), R n-1 and R n+1 Indicates the correlation coefficient between the two columns to the left and right of the x+n column with the largest correlation coefficient.
[0041] i and j are weighting coefficients, and their values should satisfy i+j=1.
[0042] After experiments, we took i=0.8 and j=0.2.
[0043] Through this technical solution, the regional cross-correlation algorithm is used in ultrasonic C-scan images to repair and correct the dislocation lines;
[0044] 1) Use the C-scan image correction algorithm based on regional correlation to correct the misalignment error in a targeted manner.
[0045] 2) Compared with common image filtering and denoising, this algorithm does not cause image information loss and excessive smoothing, nor does it reduce the overall image resolution.
[0046] 3) The algorithm can preserve edge information as much as possible to facilitate the identification of defects in ultrasonic scanning images.
[0047] The above embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
[0048] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. An ultrasonic C-scan image misalignment correction algorithm, characterized by: The steps are: (1) First, grayscale and downsample the image to be processed according to the resolution set when drawing the C-scan image, so that the width of a single row of dislocation patterns is a single pixel; (2) Starting from the fifth column of the image, taking the first pixel of the column as the reference, calculate the sum of all odd rows and corresponding even rows in a column and divide it by the total number of rows for comparison; (3) Calculate the regional correlation coefficients of the offset pixel points n from -5 to 5, a total of eleven columns, and compare them. Take the offset n corresponding to the maximum correlation coefficient as the corrected offset; (4) Perform weighted correction on pixels in even rows according to the offset n; (5) Since the error accumulation changes uniformly, in order to avoid sudden changes in the correction results, the regional correlation value is calculated starting from the sixth column, with a total of three horizontal pixel ranges of n±1 in the previous column, and the correction is also performed based on the maximum offset n of the correlation value; (6) After the misalignment correction is completed, the image can be denoised and defect detected; According to step (2), the calculation function is: , In the formula The coordinates are The pixel value of the point is Indicates the value of the point in the next row, offset by n pixels, Indicates the total number of rows in the image; According to step (4), the specific correction formula is: , In the formula The coordinates are The pixel value of the point, and The largest correlation coefficient The correlation coefficients corresponding to the two columns on the left and right.
2. The ultrasonic C-scan image misalignment correction algorithm according to claim 1, characterized in that: The value should satisfy .
3. The ultrasonic C-scan image misalignment correction algorithm according to claim 2, characterized in that: After testing .
Citation Information
Patent Citations
Methods, systems and devices relating to distortion correction in imaging devices
CN107533017A
Method for correcting misplaced partial image splicing
CN107945113A