Nothing Special   »   [go: up one dir, main page]

CN115100100A - Phase-dependent displacement field acquisition method, electronic device and storage medium - Google Patents

Phase-dependent displacement field acquisition method, electronic device and storage medium Download PDF

Info

Publication number
CN115100100A
CN115100100A CN202210491022.7A CN202210491022A CN115100100A CN 115100100 A CN115100100 A CN 115100100A CN 202210491022 A CN202210491022 A CN 202210491022A CN 115100100 A CN115100100 A CN 115100100A
Authority
CN
China
Prior art keywords
image
area
variance
sliding window
window
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210491022.7A
Other languages
Chinese (zh)
Other versions
CN115100100B (en
Inventor
余志武
张云生
杨振
戴吾蛟
邢磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Central South University
National Engineering Laboratory for High Speed Railway Construction Technology
Original Assignee
Central South University
National Engineering Laboratory for High Speed Railway Construction Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Central South University, National Engineering Laboratory for High Speed Railway Construction Technology filed Critical Central South University
Priority to CN202210491022.7A priority Critical patent/CN115100100B/en
Publication of CN115100100A publication Critical patent/CN115100100A/en
Application granted granted Critical
Publication of CN115100100B publication Critical patent/CN115100100B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本发明公开了一种相位相关位移场获取方法、电子设备及存储介质,该获取方法包括读取变形前后的影像,确定初始滑动窗口尺寸的最大值和最小值;以最大值作为初始滑动窗口尺寸,并采用初始滑动窗口对变形前影像进行区域划分,得到第一区域窗口;计算第一区域窗口内像素点的方差,由方差构成方差场矩阵,对方差场矩阵进行归一化处理;根据处理后的方差场矩阵、最大值和最小值计算优化滑动窗口尺寸;采用优化滑动窗口分别对第一影像、第二影像进行区域划分,得到第二区域窗口、第三区域窗口;将对应的第二区域窗口与第三区域窗口进行相位相关,得到对应像素位置的位移,由位移构成位移场。本发明位移场的获取精度高、效率高。

Figure 202210491022

The invention discloses a phase correlation displacement field acquisition method, electronic equipment and storage medium. The acquisition method includes reading images before and after deformation, determining the maximum value and the minimum value of an initial sliding window size; taking the maximum value as the initial sliding window size , and use the initial sliding window to divide the image before deformation to obtain the first area window; calculate the variance of the pixels in the first area window, form the variance field matrix from the variance, and normalize the variance field matrix; The optimized sliding window size is calculated from the variance field matrix, the maximum value and the minimum value; the optimized sliding window is used to divide the first image and the second image respectively to obtain the second area window and the third area window; The area window is phase-correlated with the third area window to obtain the displacement of the corresponding pixel position, and the displacement field is formed by the displacement. The displacement field of the invention has high acquisition precision and high efficiency.

Figure 202210491022

Description

相位相关位移场获取方法、电子设备及存储介质Phase-dependent displacement field acquisition method, electronic device and storage medium

技术领域technical field

本发明属于基于摄影测量的结构形变监测技术,尤其涉及一种影像自适应区域划分的相位相关快速位移场获取方法。The invention belongs to the structural deformation monitoring technology based on photogrammetry, and in particular relates to a phase correlation fast displacement field acquisition method for image adaptive area division.

背景技术Background technique

使用相位相关方法获取目标位移场时,通常做法是:根据场景中可能的位移大小确定滑动窗口的尺寸,以固定尺寸的滑动窗口对影像(例如材料结构在受压拉扯情况下的变形场或位移场)进行划分,以固定尺寸的滑动窗口进行相位相关,最终得到位移场,例如ecompte D,Smits A,Bossuyt S,et al.Quality assessment of speckle patterns fordigital image correlation[J].Optics and lasers in Engineering,2006,44(11):1132-1145.以及Huang J,Pan X,Peng X,et al.Digital image correlation with self-adaptive Gaussian windows[J].Experimental Mechanics,2013,53(3):505-512.。当滑动窗口的尺寸太小时,会导致被划分的区域由于其内纹理信息不够,出现失相关情况,得不到准确的位移结果;当滑动窗口的尺寸太大时,会导致时间消耗大幅增加,降低位移场获取效率。When using the phase correlation method to obtain the target displacement field, the usual practice is to determine the size of the sliding window according to the possible displacement in the scene, and use a fixed-size sliding window to measure the image (such as the deformation field or displacement of the material structure under compression and tension). Field) is divided, phase correlation is carried out with a fixed-size sliding window, and finally the displacement field is obtained, such as ecompte D, Smits A, Bossuyt S, et al. Quality assessment of speckle patterns for digital image correlation[J].Optics and lasers in Engineering , 2006, 44(11): 1132-1145. and Huang J, Pan X, Peng X, et al. Digital image correlation with self-adaptive Gaussian windows[J]. Experimental Mechanics, 2013, 53(3): 505- 512. When the size of the sliding window is too small, the divided area will be de-correlated due to insufficient texture information, and accurate displacement results cannot be obtained; when the size of the sliding window is too large, the time consumption will be greatly increased. Reduce displacement field acquisition efficiency.

因此,采用动态尺寸的滑动窗口进行相位相关,并获取位移场是非常必要的。事实上,已有学者考虑使用动态尺寸的滑动窗口进行位移场的获取,可参见Liu,Xiao-Yong,etal."ASelf-Adaptive Selection of Subset Size Method in Digital ImageCorrelation Based on Shannon Entropy."IEEE Access 8(2020):184822-184833.,其中先确定滑动窗口的大小,对于某个影像进行区域划分时不断增大滑动窗口的大小,直到该滑动窗口内香农熵大于一个设定的阈值T。该方法在每个像素位置都会进行很多次循环,导致时间消耗很大,低效率。Therefore, it is very necessary to use a sliding window of dynamic size for phase correlation and obtain the displacement field. In fact, some scholars have considered using a sliding window of dynamic size to obtain the displacement field, see Liu, Xiao-Yong, et al. "ASelf-Adaptive Selection of Subset Size Method in Digital ImageCorrelation Based on Shannon Entropy." IEEE Access 8 (2020): 184822-184833., in which the size of the sliding window is first determined, and the size of the sliding window is continuously increased when dividing a certain image until the Shannon entropy in the sliding window is greater than a set threshold T. This method will loop many times at each pixel position, resulting in a lot of time consumption and low efficiency.

总的来说,目前已有的基于相位相关的位移场估计方法,存在影像区域划分大小不好确定的问题,区域划分太大导致效率不高,区域划分太小导致结果不准确。In general, the existing displacement field estimation methods based on phase correlation have the problem that the size of the image area is not easily determined. If the area is divided too large, the efficiency is not high, and the area is too small, resulting in inaccurate results.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种相位相关位移场获取方法、电子设备及存储介质,以解决影响区域划分太大导致效率不高问题,以及划分太小导致位移场获取结果不准确的问题。The purpose of the present invention is to provide a phase-dependent displacement field acquisition method, electronic device and storage medium, so as to solve the problem that the influence area is too large to cause low efficiency, and that the division is too small to cause inaccurate displacement field acquisition results.

本发明是通过如下的技术方案来解决上述技术问题的:一种相位相关位移场获取方法,包括以下步骤:The present invention solves the above-mentioned technical problems through the following technical solutions: a method for obtaining a phase-dependent displacement field, comprising the following steps:

读取变形前的第一影像和变形后的第二影像,确定初始滑动窗口尺寸的最大值wmax和最小值wminRead the first image before deformation and the second image after deformation, and determine the maximum value w max and the minimum value w min of the initial sliding window size;

以最大值wmax作为初始滑动窗口的尺寸,采用所述初始滑动窗口在所述第一影像的每个像素位置进行区域划分,得到N个第一区域窗口;Taking the maximum value w max as the size of the initial sliding window, and using the initial sliding window to perform region division at each pixel position of the first image, N first region windows are obtained;

计算每个所述第一区域窗口内所有像素点的方差,由所有方差构成方差场矩阵,并对所述方差场矩阵进行归一化处理;Calculate the variance of all pixels in each of the first area windows, form a variance field matrix from all the variances, and normalize the variance field matrix;

根据归一化处理后的方差场矩阵、最大值wmax和最小值wmin计算对应像素位置的优化滑动窗口尺寸;Calculate the optimal sliding window size corresponding to the pixel position according to the normalized variance field matrix, the maximum value w max and the minimum value w min ;

采用所述优化滑动窗口在所述第一影像的对应像素位置进行区域划分,得到N个第二区域窗口,采用所述优化滑动窗口在所述第二影像的对应像素位置进行区域划分,得到N个第三区域窗口;The optimized sliding window is used to perform area division at the corresponding pixel position of the first image to obtain N second area windows, and the optimized sliding window is used to perform area division at the corresponding pixel position of the second image to obtain N a third area window;

将对应的第二区域窗口与第三区域窗口进行相位相关,得到对应像素位置的位移,由所有位移构成位移场。Phase correlation is performed between the corresponding second area window and the third area window to obtain the displacement of the corresponding pixel position, and a displacement field is formed by all the displacements.

进一步地,采用所述初始滑动窗口在所述第一影像的每个像素位置进行区域划分的具体实现过程为:以当前像素位置为中心,按照初始滑动窗口尺寸在第一影像内截取的区域作为当前第一区域窗口。Further, the specific implementation process of using the initial sliding window to perform area division at each pixel position of the first image is as follows: taking the current pixel position as the center, and taking the area intercepted in the first image according to the size of the initial sliding window as The current first area window.

进一步地,每个所述第一区域窗口内所有像素点的方差的计算公式为:Further, the formula for calculating the variance of all pixels in each of the first area windows is:

Figure BDA0003631828490000021
Figure BDA0003631828490000021

Figure BDA0003631828490000022
Figure BDA0003631828490000022

其中,σ为当前第一区域窗口内所有像素点的方差,w为当前第一区域窗口的边长,w=wmax,g(i,j)为当前第一区域窗口内像素位置(i,j)处的像素值,(i,j)为像素点在当前第一区域窗口中的位置,

Figure BDA0003631828490000023
为当前第一区域窗口内所有像素点的像素值的均值。Among them, σ is the variance of all pixels in the current first area window, w is the side length of the current first area window, w=w max , g(i, j) is the pixel position (i, j) in the current first area window The pixel value at j), (i,j) is the position of the pixel in the current first area window,
Figure BDA0003631828490000023
is the average of the pixel values of all pixels in the current first region window.

进一步地,归一化处理后的方差场矩阵为:Further, the normalized variance field matrix is:

Figure BDA0003631828490000024
Figure BDA0003631828490000024

Figure BDA0003631828490000031
Figure BDA0003631828490000031

其中,M* σ为归一化处理后的方差场矩阵,σ* sr为方差场矩阵M* σ中第s行第r列元素,σsr为未归一化处理的方差场矩阵Mσ中第s行第r列元素,σmin为方差场矩阵Mσ中的最小元素,σmax为方差场矩阵Mσ中的最大元素,m为第一影像的高度,n为第一影像的宽度,m×n=N。Among them, M * σ is the normalized variance field matrix, σ * sr is the element of the sth row and rth column in the variance field matrix M * σ , and σ sr is the unnormalized variance field matrix M σ . The element in row s and column r, σ min is the smallest element in the variance field matrix M σ , σ max is the largest element in the variance field matrix M σ , m is the height of the first image, n is the width of the first image, m×n=N.

进一步地,每个像素位置的所述优化滑动窗口尺寸的计算公式为:Further, the calculation formula of the optimized sliding window size of each pixel position is:

wsr=wmin+(log2* sr+1])(wmax-wmin)w sr =w min +(log 2* sr +1])(w max -w min )

其中,wsr为像素位置(s,r)处的优化滑动窗口尺寸,(s,r)为像素点在第一影像或第二影像中的位置,s=1,2,…,m,r=1,2,…,n,m为第一影像或第二影像的高度,n为第一影像或第二影像的宽度,m×n=N,σ* sr为归一化处理后的方差场矩阵M* σ中第s行第r列元素。Among them, w sr is the optimal sliding window size at the pixel position (s, r), (s, r) is the position of the pixel in the first image or the second image, s=1,2,...,m,r =1,2,...,n, m is the height of the first image or the second image, n is the width of the first image or the second image, m×n=N, σ * sr is the variance after normalization processing The element in the sth row and rth column of the field matrix M * σ .

本发明还提供一种电子设备,包括存储器和处理器,所述存储器上存储有能够在所述处理器上运行的计算机程序,所述处理器运行所述计算机程序时执行如上所述相位相关位移场获取方法的步骤。The present invention also provides an electronic device, comprising a memory and a processor, the memory stores a computer program that can run on the processor, and the processor executes the above-mentioned phase-related displacement when the computer program runs. Field acquisition method steps.

本发明还提供一种计算机可读存储介质,所述计算机可读存储介质为非易失性存储介质或非瞬态存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时执行如上所述相位相关位移场获取方法的步骤。The present invention also provides a computer-readable storage medium, which is a non-volatile storage medium or a non-transitory storage medium, on which a computer program is stored, and the computer program is executed when a processor runs The steps of the phase-dependent displacement field acquisition method are described above.

有益效果beneficial effect

与现有技术相比,本发明的优点在于:Compared with the prior art, the advantages of the present invention are:

本发明所提供的一种相位相关位移场获取方法、电子设备及存储介质,根据初始滑动窗口内像素点的方差、初始滑动窗口尺寸的最大值和最小值确定优化滑动窗口的尺寸,然后再利用优化滑动窗口对变形前后的影像进行区域划分,能够有效地减少进行相位相关时失相关发生的可能性,提高了位移场的获取准确度;同时先确定好每个像素位置的优化滑动窗口尺寸,再进行区域划分,避免了在每个像素位置多次循环来确定滑动窗口尺寸所带来的大量时间消耗,提高了位移场的获取效率;In the method, electronic device and storage medium provided by the present invention, the size of the optimized sliding window is determined according to the variance of the pixel points in the initial sliding window, the maximum value and the minimum value of the initial sliding window size, and then using The optimized sliding window divides the images before and after deformation, which can effectively reduce the possibility of phase correlation loss and improve the accuracy of displacement field acquisition. Then, the area is divided to avoid a lot of time consumption caused by multiple cycles at each pixel position to determine the size of the sliding window, and to improve the acquisition efficiency of the displacement field;

与传统方法相比,本发明具有很好的适应性,能够适用于更多的场景。Compared with the traditional method, the present invention has good adaptability and can be applied to more scenarios.

附图说明Description of drawings

为了更清楚地说明本发明的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一个实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only an embodiment of the present invention, which is very important in the art. For those of ordinary skill, other drawings can also be obtained from these drawings without any creative effort.

图1是本发明实施例中相位相关位移场获取方法流程图;1 is a flowchart of a method for obtaining a phase-dependent displacement field in an embodiment of the present invention;

图2是本发明实施例中第一影像和第二影像,其中(a)为第一影像,(b)为第一影像;2 is a first image and a second image in an embodiment of the present invention, wherein (a) is the first image, and (b) is the first image;

图3是本发明实施例中采用初始滑动窗口(滑动窗口尺寸固定为wmax)进行区域划分的示意图;3 is a schematic diagram of an initial sliding window (the size of the sliding window is fixed as w max ) for region division in an embodiment of the present invention;

图4是本发明实施例中归一化处理后的方差场矩阵M* σFig. 4 is the variance field matrix M * σ after normalization processing in the embodiment of the present invention;

图5是本发明实施例中采用动态的优化滑动窗口进行区域划分的示意图;Fig. 5 is the schematic diagram that adopts dynamic optimized sliding window to carry out area division in the embodiment of the present invention;

图6是本发明实施例中采用不同区域窗口划分方式所得到的位移场,其中(a)为采用最小值wmin得到的位移场,(b)为采用本发明方法得到的位移场,(c)为采用最大值wmax得到的位移场。6 is the displacement field obtained by adopting different area window division methods in the embodiment of the present invention, wherein (a) is the displacement field obtained by adopting the minimum value w min , (b) is the displacement field obtained by adopting the method of the present invention, (c) ) is the displacement field obtained using the maximum value w max .

具体实施方式Detailed ways

下面结合本发明实施例中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a 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 those of ordinary skill in the art without creative work fall within the protection scope of the present invention.

下面以具体地实施例对本申请的技术方案进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例不再赘述。The technical solutions of the present application will be described in detail below with specific examples. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.

如图1所示,本实施例所提供的一种相位相关位移场获取方法,包括以下步骤:As shown in FIG. 1 , a method for obtaining a phase-dependent displacement field provided by this embodiment includes the following steps:

步骤1:读取变形前的第一影像和变形后的第二影像,确定初始滑动窗口尺寸的最大值wmax和最小值wminStep 1: Read the first image before deformation and the second image after deformation, and determine the maximum value w max and the minimum value w min of the initial sliding window size.

先拍摄材料结构在变形前的影像以获取第一影像,再使用液压机或其他设备对材料进行挤压或拉伸,然后使用相机拍摄挤压或拉伸过程,得到材料变形过程中的多张影像,根据需要从变形过程中的多张影像中选取一张作为第二影像。本实施例中,先拍摄目标变形前的影像作为第一影像,再使用电热炉加热使目标产生形变,从而模拟位移场,得到第二影像,如图2所示。图2中,第一影像和第二影像的宽度均为960pixels,即n=960pixels,高度均为424pixels,即m=424pixels,拍摄距离为10m左右,色彩模式为全色。First take the image of the material structure before deformation to obtain the first image, then use a hydraulic press or other equipment to squeeze or stretch the material, and then use a camera to shoot the extrusion or stretching process to obtain multiple images during the deformation process of the material , and select one image from the multiple images in the deformation process as the second image as needed. In this embodiment, an image of the target before deformation is captured as the first image, and then heated by an electric furnace to deform the target, thereby simulating a displacement field to obtain a second image, as shown in FIG. 2 . In Figure 2, the width of the first image and the second image are both 960 pixels, that is, n=960 pixels, the height is 424 pixels, that is, m= 424 pixels, the shooting distance is about 10m, and the color mode is full color.

根据经验确定初始滑动窗口尺寸的最大值wmax和最小值wmin,本实施例中,wmax设为95pixels,wmin设为45pixels。滑动窗口为正方形,滑动窗口尺寸的最大值wmax为95pixels是指滑动窗口的宽度和高度均为95pixels。The maximum value w max and the minimum value w min of the initial sliding window size are determined empirically. In this embodiment, w max is set to 95 pixels, and w min is set to 45 pixels. The sliding window is a square, and the maximum value w max of the sliding window size is 95 pixels, which means that the width and height of the sliding window are both 95 pixels.

步骤2:以最大值wmax作为初始滑动窗口的尺寸,采用该初始滑动窗口在第一影像的每个像素位置进行区域划分,得到N个第一区域窗口。Step 2: Taking the maximum value w max as the size of the initial sliding window, and using the initial sliding window to perform region division at each pixel position of the first image, N first region windows are obtained.

采用初始滑动窗口在第一影像的每个像素位置进行区域划分的具体实现过程为:以当前像素位置为中心,按照初始滑动窗口尺寸截取的区域作为当前第一区域窗口。以图3所示为例,图3表示第一影像的部分,每个格子□代表一个像素位置,即一个像素点,在像素位置进行区域划分时,以当前像素位置(图3中的黑框■)为中心,按照初始滑动窗口尺寸(为了便于作图,此处初始滑动窗口尺寸为11pixels)截取的区域作为该像素位置的第一区域窗口(即图3中粗黑线所框的区域)。因此,每个像素位置均对应一个第一区域窗口,由此得到N个第一区域窗口,N=m×n=424×960。The specific implementation process of using the initial sliding window to divide the area at each pixel position of the first image is as follows: taking the current pixel position as the center, and taking the area intercepted according to the size of the initial sliding window as the current first area window. Take Fig. 3 as an example, Fig. 3 shows a part of the first image, each grid □ represents a pixel position, that is, a pixel point. ) as the center, and the area intercepted according to the initial sliding window size (for the convenience of drawing, the initial sliding window size is 11 pixels) is used as the first area window of the pixel position (that is, the area framed by the thick black line in Figure 3) . Therefore, each pixel position corresponds to a first region window, thereby obtaining N first region windows, N=m×n=424×960.

步骤3:计算每个第一区域窗口内所有像素点的方差,由所有方差构成方差场矩阵,并对方差场矩阵进行归一化处理。Step 3: Calculate the variance of all pixel points in each first region window, form a variance field matrix by all variances, and normalize the variance field matrix.

每个第一区域窗口内所有像素点的方差的计算公式为:The formula for calculating the variance of all pixels in each first region window is:

Figure BDA0003631828490000051
Figure BDA0003631828490000051

Figure BDA0003631828490000052
Figure BDA0003631828490000052

其中,σ为当前第一区域窗口内所有像素点的方差,w为当前第一区域窗口的边长,w=wmax=95,g(i,j)为当前第一区域窗口内像素位置(i,j)处的像素值,像素位置(i,j)是指像素点在当前第一区域窗口中的位置,i=1,2,…,95,j=1,2,…,95,

Figure BDA0003631828490000053
为当前第一区域窗口内所有像素点的像素值的均值。由方差构成的方差场矩阵为:Among them, σ is the variance of all pixels in the current first area window, w is the side length of the current first area window, w=w max =95, g(i,j) is the pixel position in the current first area window ( The pixel value at i,j), the pixel position (i,j) refers to the position of the pixel in the current first area window, i=1,2,...,95, j=1,2,...,95,
Figure BDA0003631828490000053
is the average of the pixel values of all pixels in the current first region window. The variance field matrix composed of variance is:

Figure BDA0003631828490000054
Figure BDA0003631828490000054

方差场矩阵Mσ中的每个元素σsr与第一影像中的像素位置(s,r)一一对应。为了便于后续计算的优化滑动窗口尺寸映射到[wmin,wmax],将方差场矩阵Mσ进行归一化处理,具体公式为:Each element σ sr in the variance field matrix M σ has a one-to-one correspondence with the pixel position (s, r) in the first image. In order to facilitate the subsequent calculation of the optimal sliding window size to map to [w min , w max ], the variance field matrix M σ is normalized, and the specific formula is:

Figure BDA0003631828490000055
Figure BDA0003631828490000055

Figure BDA0003631828490000061
Figure BDA0003631828490000061

其中,M* σ为归一化处理后的方差场矩阵,σ* sr为方差场矩阵M* σ中第s行第r列元素,σsr为方差场矩阵Mσ中第s行第r列元素,σmin为方差场矩阵Mσ中的最小元素,σmax为方差场矩阵Mσ中的最大元素。方差场矩阵M* σ中的每个元素σ* sr与第一影像中的像素位置(s,r)一一对应。归一化处理后的方差场矩阵M* σ如图4所示。Among them, M * σ is the normalized variance field matrix, σ * sr is the element of the sth row and rth column in the variance field matrix M * σ , and σ sr is the sth row and rth column of the variance field matrix M σ . element, σ min is the smallest element in the variance field matrix M σ , and σ max is the largest element in the variance field matrix M σ . Each element σ * sr in the variance field matrix M * σ has a one-to-one correspondence with the pixel position (s, r) in the first image. The normalized variance field matrix M * σ is shown in Figure 4.

步骤4:根据归一化处理后的方差场矩阵、最大值wmax和最小值wmin计算对应像素位置的优化滑动窗口尺寸,具体计算公式为:Step 4: Calculate the optimized sliding window size corresponding to the pixel position according to the normalized variance field matrix, the maximum value w max and the minimum value w min . The specific calculation formula is:

wsr=wmin+(log2* sr+1])(wmax-wmin)w sr =w min +(log 2* sr +1])(w max -w min )

其中,wsr为像素位置(s,r)处的优化滑动窗口尺寸,(s,r)为像素点在第一影像或第二影像中的位置,s=1,2,…,m,r=1,2,…,n。由此得到优化滑动窗口矩阵为:Among them, w sr is the optimal sliding window size at the pixel position (s, r), (s, r) is the position of the pixel in the first image or the second image, s=1,2,...,m,r =1,2,...,n. The optimized sliding window matrix is thus obtained as:

Figure BDA0003631828490000062
Figure BDA0003631828490000062

优化滑动窗口矩阵Mw中的每个元素wsr与第一影像或第二影像中的像素位置(s,r)一一对应,即每个像素位置(s,r)均有与其对应的优化滑动窗口尺寸。Each element w sr in the optimized sliding window matrix M w corresponds to the pixel position (s, r) in the first image or the second image, that is, each pixel position (s, r) has its corresponding optimization Sliding window size.

步骤5:采用步骤4计算得到的优化滑动窗口在第一影像的对应像素位置进行区域划分,得到N个第二区域窗口,采用步骤4计算得到的优化滑动窗口在第二影像的对应像素位置进行区域划分,得到N个第三区域窗口。Step 5: Use the optimized sliding window calculated in step 4 to perform area division at the corresponding pixel position of the first image, to obtain N second area windows, and use the optimized sliding window calculated in step 4 to perform the corresponding pixel position of the second image. The area is divided to obtain N third area windows.

示例性的,以像素位置(1,1)为中心,按照优化滑动窗口尺寸w11在第一影像、第二影像内截取的区域分别作为第一个第二区域窗口、第一个第三区域窗口;以像素位置(s,r)为中心,按照优化滑动窗口尺寸wsr在第一影像、第二影像内截取的区域分别作为第二区域窗口、第三区域窗口。如图5所示,不同像素位置对应的优化滑动窗口尺寸不同,即所获得的区域窗口尺寸不同。Exemplarily, with the pixel position (1, 1) as the center, the areas captured in the first image and the second image according to the optimized sliding window size w 11 are used as the first second area window and the first third area, respectively. Window: Taking the pixel position (s, r) as the center, the regions intercepted in the first image and the second image according to the optimized sliding window size w sr are respectively used as the second region window and the third region window. As shown in Fig. 5, the optimized sliding window sizes corresponding to different pixel positions are different, that is, the obtained regional window sizes are different.

对于第一影像或第二影像的每个像素位置,所采用的优化滑动窗口尺寸并非固定不变的,而是每个像素位置均有一个优化滑动窗口对应,优化滑动窗口尺寸与像素位置相适配,既保证了每个区域窗口内纹理信息足够,避免了失相关情况,提高了位移场的获取准确度,又避免了不同像素位置对应的滑动窗口尺寸过大而导致的时间消耗增加,提高了获取效率;同时本发明在对第一影像和第二影像进行区域划分前先确定每个像素位置的优化滑动窗口尺寸,再按照确定好的优化滑动窗口尺寸在该像素位置进行区域划分,避免了为了确定某个像素位置的滑动窗口尺寸而在该像素位置多次循环导致的时间消耗巨大,效率低的问题。For each pixel position of the first image or the second image, the size of the optimized sliding window used is not fixed, but each pixel position corresponds to an optimized sliding window, and the size of the optimized sliding window is suitable for the pixel position. It not only ensures that the texture information in each region window is sufficient, avoids the loss of correlation, improves the accuracy of displacement field acquisition, but also avoids the increase in time consumption caused by the excessive size of the sliding window corresponding to different pixel positions. At the same time, the present invention first determines the optimal sliding window size of each pixel position before dividing the first image and the second image, and then divides the area at the pixel position according to the determined optimal sliding window size to avoid In order to determine the sliding window size of a certain pixel position, the time consumption is huge and the efficiency is low due to multiple loops at the pixel position.

步骤6:将对应的第二区域窗口与第三区域窗口进行相位相关,得到对应像素位置的位移,由所有位移构成位移场,位移场的具体表示为:Step 6: Perform phase correlation between the corresponding second area window and the third area window to obtain the displacement of the corresponding pixel position, and form a displacement field by all the displacements. The specific expression of the displacement field is:

Figure BDA0003631828490000071
Figure BDA0003631828490000071

其中,

Figure BDA0003631828490000072
为x方向位移场,
Figure BDA0003631828490000073
为y方向位移场,xsr为像素位置(s,r)处在x方向的位移,ysr为像素位置(s,r)处在y方向的位移。第二区域窗口与第一影像的像素位置一一对应,第三区域窗口与第二影像的像素位置一一对应,因此,第二区域窗口与第三区域窗口一一对应,例如第一个第二区域窗口与第一个第三区域窗口一一对应,将对应的第二区域窗口与第三区域窗口进行相位相关,即可得到当前像素位置的位移。in,
Figure BDA0003631828490000072
is the displacement field in the x direction,
Figure BDA0003631828490000073
is the displacement field in the y direction, x sr is the displacement of the pixel position (s, r) in the x direction, and y sr is the displacement of the pixel position (s, r) in the y direction. The second area window has a one-to-one correspondence with the pixel positions of the first image, and the third area window has a one-to-one correspondence with the pixel positions of the second image. Therefore, the second area window has a one-to-one correspondence with the third area window. The second area window is in one-to-one correspondence with the first third area window, and the phase correlation between the corresponding second area window and the third area window is performed to obtain the displacement of the current pixel position.

图6给出了采用本发明方法所得到的位移场与采用最大值wmax、最小值wmin得到的位移场,表1给出了本发明方法所得到的位移场以及采用最大值wmax、最小值wmin得到的位移场所使用的时间。由图6和表1可知,在达到与采用最大值wmax得到的相同精度位移场的情况下,本发明的时间消耗大幅降低;同时表明最小值wmin得到的位移场精度很差。Figure 6 shows the displacement field obtained by the method of the present invention and the displacement field obtained by using the maximum value w max and the minimum value w min . Table 1 shows the displacement field obtained by the method of the present invention and the maximum value w max , The time used for the displacement field obtained by the minimum value w min . It can be seen from Fig. 6 and Table 1 that the time consumption of the present invention is greatly reduced when the displacement field with the same accuracy obtained by using the maximum value w max is obtained; meanwhile, the accuracy of the displacement field obtained by the minimum value w min is poor.

表1不同滑动窗口尺寸得到位移场所使用的时间Table 1. Different sliding window sizes to obtain the time used by the displacement field

Figure BDA0003631828490000081
Figure BDA0003631828490000081

以上所揭露的仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或变型,都应涵盖在本发明的保护范围之内。The above disclosure is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited to this. should be included within the protection scope of the present invention.

Claims (7)

1.一种相位相关位移场获取方法,其特征在于,包括以下步骤:1. a phase correlation displacement field acquisition method, is characterized in that, comprises the following steps: 读取变形前的第一影像和变形后的第二影像,确定初始滑动窗口尺寸的最大值wmax和最小值wminRead the first image before deformation and the second image after deformation, and determine the maximum value w max and the minimum value w min of the initial sliding window size; 以最大值wmax作为初始滑动窗口的尺寸,采用所述初始滑动窗口在所述第一影像的每个像素位置进行区域划分,得到N个第一区域窗口;Taking the maximum value w max as the size of the initial sliding window, and using the initial sliding window to perform region division at each pixel position of the first image, N first region windows are obtained; 计算每个所述第一区域窗口内所有像素点的方差,由所有方差构成方差场矩阵,并对所述方差场矩阵进行归一化处理;Calculate the variance of all pixels in each of the first area windows, form a variance field matrix from all the variances, and normalize the variance field matrix; 根据归一化处理后的方差场矩阵、最大值wmax和最小值wmin计算对应像素位置的优化滑动窗口尺寸;Calculate the optimal sliding window size corresponding to the pixel position according to the normalized variance field matrix, the maximum value w max and the minimum value w min ; 采用所述优化滑动窗口在所述第一影像的对应像素位置进行区域划分,得到N个第二区域窗口,采用所述优化滑动窗口在所述第二影像的对应像素位置进行区域划分,得到N个第三区域窗口;The optimized sliding window is used to perform area division at the corresponding pixel position of the first image to obtain N second area windows, and the optimized sliding window is used to perform area division at the corresponding pixel position of the second image to obtain N a third area window; 将对应的第二区域窗口与第三区域窗口进行相位相关,得到对应像素位置的位移,由所有位移构成位移场。Phase correlation is performed between the corresponding second area window and the third area window to obtain the displacement of the corresponding pixel position, and a displacement field is formed by all the displacements. 2.如权利要求1所述的相位相关位移场获取方法,其特征在于,采用所述初始滑动窗口在所述第一影像的每个像素位置进行区域划分的具体实现过程为:以当前像素位置为中心,按照初始滑动窗口尺寸在第一影像内截取的区域作为当前第一区域窗口。2. The method for obtaining a phase-dependent displacement field according to claim 1, wherein the specific implementation process of using the initial sliding window to perform region division at each pixel position of the first image is: using the current pixel position as the center, and the area captured in the first image according to the size of the initial sliding window is used as the current first area window. 3.如权利要求1所述的相位相关位移场获取方法,其特征在于,每个所述第一区域窗口内所有像素点的方差的计算公式为:3. The phase correlation displacement field acquisition method as claimed in claim 1, wherein the formula for calculating the variance of all pixel points in each of the first area windows is:
Figure FDA0003631828480000011
Figure FDA0003631828480000011
Figure FDA0003631828480000012
Figure FDA0003631828480000012
其中,σ为当前第一区域窗口内所有像素点的方差,w为当前第一区域窗口的边长,w=wmax,g(i,j)为当前第一区域窗口内像素位置(i,j)处的像素值,(i,j)为像素点在当前第一区域窗口中的位置,
Figure FDA0003631828480000013
为当前第一区域窗口内所有像素点的像素值的均值。
Among them, σ is the variance of all pixels in the current first area window, w is the side length of the current first area window, w=w max , g(i, j) is the pixel position (i, j) in the current first area window The pixel value at j), (i,j) is the position of the pixel in the current first area window,
Figure FDA0003631828480000013
is the average of the pixel values of all pixels in the current first region window.
4.如权利要求1所述的相位相关位移场获取方法,其特征在于,归一化处理后的方差场矩阵为:4. The method for obtaining a phase-dependent displacement field as claimed in claim 1, wherein the normalized variance field matrix is:
Figure FDA0003631828480000021
Figure FDA0003631828480000021
Figure FDA0003631828480000022
Figure FDA0003631828480000022
其中,M* σ为归一化处理后的方差场矩阵,σ* sr为方差场矩阵M* σ中第s行第r列元素,σsr为未归一化处理的方差场矩阵Mσ中第s行第r列元素,σmin为方差场矩阵Mσ中的最小元素,σmax为方差场矩阵Mσ中的最大元素,m为第一影像的高度,n为第一影像的宽度,m×n=N。Among them, M * σ is the normalized variance field matrix, σ * sr is the element of the sth row and rth column in the variance field matrix M * σ , and σ sr is the unnormalized variance field matrix M σ . The element in row s and column r, σ min is the smallest element in the variance field matrix M σ , σ max is the largest element in the variance field matrix M σ , m is the height of the first image, n is the width of the first image, m×n=N.
5.如权利要求1~4中任一项所述的相位相关位移场获取方法,其特征在于,每个像素位置的所述优化滑动窗口尺寸的计算公式为:5. The method for obtaining a phase-dependent displacement field according to any one of claims 1 to 4, wherein the calculation formula of the optimized sliding window size for each pixel position is: wsr=wmin+(log2* sr+1])(wmax-wmin)w sr =w min +(log 2* sr +1])(w max -w min ) 其中,wsr为像素位置(s,r)处的优化滑动窗口尺寸,(s,r)为像素点在第一影像或第二影像中的位置,s=1,2,…,m,r=1,2,…,n,m为第一影像或第二影像的高度,n为第一影像或第二影像的宽度,m×n=N,σ* sr为归一化处理后的方差场矩阵M* σ中第s行第r列元素。Among them, w sr is the optimal sliding window size at the pixel position (s, r), (s, r) is the position of the pixel in the first image or the second image, s=1,2,...,m,r =1,2,...,n, m is the height of the first image or the second image, n is the width of the first image or the second image, m×n=N, σ * sr is the variance after normalization processing The element in the sth row and rth column of the field matrix M * σ . 6.一种电子设备,包括存储器和处理器,所述存储器上存储有能够在所述处理器上运行的计算机程序,其特征在于:所述处理器运行所述计算机程序时执行权利要求1~5中任一项所述相位相关位移场获取方法的步骤。6. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein the processor executes claims 1 to 1 when the processor runs the computer program. Steps of the method for obtaining a phase-dependent displacement field according to any one of 5. 7.一种计算机可读存储介质,所述计算机可读存储介质为非易失性存储介质或非瞬态存储介质,其上存储有计算机程序,其特征在于:所述计算机程序被处理器运行时执行权利要求1~5中任一项所述相位相关位移场获取方法的步骤。7. A computer-readable storage medium, the computer-readable storage medium being a non-volatile storage medium or a non-transitory storage medium, on which a computer program is stored, characterized in that: the computer program is run by a processor When executing the steps of the method for obtaining the phase-dependent displacement field according to any one of claims 1 to 5.
CN202210491022.7A 2022-05-07 2022-05-07 Phase-related displacement field acquisition method, electronic device and storage medium Active CN115100100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210491022.7A CN115100100B (en) 2022-05-07 2022-05-07 Phase-related displacement field acquisition method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210491022.7A CN115100100B (en) 2022-05-07 2022-05-07 Phase-related displacement field acquisition method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN115100100A true CN115100100A (en) 2022-09-23
CN115100100B CN115100100B (en) 2024-08-20

Family

ID=83287926

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210491022.7A Active CN115100100B (en) 2022-05-07 2022-05-07 Phase-related displacement field acquisition method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115100100B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005265441A (en) * 2004-03-16 2005-09-29 Wakayama Univ Displacement distribution measurement method using digital holography
CN101980304A (en) * 2010-10-20 2011-02-23 北京大学 A method for measuring deformation of three-dimensional digital volume images
CN106197287A (en) * 2016-08-03 2016-12-07 西安敏文测控科技有限公司 Self-calibration measurement apparatus and method for large scale structure composition deformation or displacement parameter
CN111981997A (en) * 2020-07-21 2020-11-24 广东工业大学 PS-OCT strain estimation method based on large deformation
CN112068136A (en) * 2020-09-14 2020-12-11 广东省核工业地质局测绘院 An Azimuth Deformation Monitoring Method Based on Amplitude Offset

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005265441A (en) * 2004-03-16 2005-09-29 Wakayama Univ Displacement distribution measurement method using digital holography
CN101980304A (en) * 2010-10-20 2011-02-23 北京大学 A method for measuring deformation of three-dimensional digital volume images
CN106197287A (en) * 2016-08-03 2016-12-07 西安敏文测控科技有限公司 Self-calibration measurement apparatus and method for large scale structure composition deformation or displacement parameter
CN111981997A (en) * 2020-07-21 2020-11-24 广东工业大学 PS-OCT strain estimation method based on large deformation
CN112068136A (en) * 2020-09-14 2020-12-11 广东省核工业地质局测绘院 An Azimuth Deformation Monitoring Method Based on Amplitude Offset

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
严伯铎: "济南第二长途电信枢纽工程变形监测与分析", 勘察科学技术, 31 March 2004 (2004-03-31) *
张云生: "自适应三角形约束的多基元多视影像匹配方法", 硕士论文, 31 December 2011 (2011-12-31) *

Also Published As

Publication number Publication date
CN115100100B (en) 2024-08-20

Similar Documents

Publication Publication Date Title
US12205240B2 (en) Panoramic image and video splicing method, computer-readable storage medium, and panoramic camera
WO2022141178A1 (en) Image processing method and apparatus
US20200077017A1 (en) Photograph-capture method, apparatus, terminal, and storage medium
CN110517304B (en) Method and device for generating depth map, electronic equipment and storage medium
US10951843B2 (en) Adjusting confidence values for correcting pixel defects
US20240273735A1 (en) Optical flow estimation method and apparatus
WO2022194079A1 (en) Sky region segmentation method and apparatus, computer device, and storage medium
CN111127384A (en) A Vision Measurement Method for Strong Reflection Workpieces Based on Polarization Imaging
CN117078677B (en) Defect detection method and system for starting sheet
US11669978B2 (en) Method and device for estimating background motion of infrared image sequences and storage medium
CN116091540A (en) Optical flow calculation method and device, electronic equipment and computer readable medium
CN110188640B (en) Face recognition method, face recognition device, server and computer readable medium
CN115100100A (en) Phase-dependent displacement field acquisition method, electronic device and storage medium
CN116645302A (en) Image enhancement method, device, intelligent terminal and computer readable storage medium
CN113569843A (en) Corner point detection method and device, computer equipment and storage medium
CN111445411A (en) Image denoising method and device, computer equipment and storage medium
CN106357958A (en) Region-matching-based fast electronic image stabilization method
CN117611483A (en) Image acquisition method, device, equipment and storage medium
CN103188427B (en) Image capture device capable of simplifying image feature value groups and its control method
CN111089865B (en) Defect cable detection method based on F-RCNN
CN114494034A (en) Image distortion correction method, device and equipment
CN114663308A (en) Method for realizing flat field correction and multi-angle rapid template matching based on CUDA (compute unified device architecture) and storage medium
CN114764822A (en) Image processing method and device and electronic equipment
CN115273064B (en) Small target segmentation method with sparse event points in complex motion background
CN111383260A (en) High-speed detection and processing method of adaptive laser information applied to visible light mode

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant