# Online Phase Measurement Profilometry for a Fast-Moving Object
## Principle
### Super-Resolution Image Reconstruction Algorithm Based on MAP  
#### 2.2.1 The Basic Principles of the MAP  
Due to the change of camera acquisition mode for fast online measurement, the captured deformed pattern is degraded to low-resolution deformed pattern, and the main degradation process can be expressed as follows:  
\[I^{\prime\prime}{}_{n,k}=D_{n,k}B_{n,k}M_{n,k}I^{\prime\prime}{}_{n}+\Delta I ^{\prime\prime}{}_{n,k} \tag{5}\]  
where \(I^{\prime\prime}{}_{n,k}\) is the low-resolution deformed pattern, which is the \(k\)-th (\(k=1,2,\ldots,K\)) frame captured in the \(n\)-th (\(n=1,2,\ldots,N\)) phase-shifting position, and \(K\) represents the number of low-resolution deformed patterns captured at the same work station (the same shifting phase), \(D_{n,k}\) represents the down-sampling matrix, which means that the high-resolution image is sampled at a certain distance so that the resolution of the image is reduced, \(B_{n,k}\) is the blur matrix, it can be used to express the effect of the optical system's blur and aberration on high-resolution image, the point spread function (PSF) is used to express mathematically. \(M_{n,k}\) is the motion matrix, used to characterize the pixel displacement of the low-resolution image relative to the high-resolution image. \(I^{\prime}{}_{n}\) is the original high-resolution deformed pattern matrix, and \(\Delta I^{\prime}{}_{n,k}\) is the additive random noise matrix. \(B_{n,k}\) and \(D_{n,k}\) of each low-resolution deformed pattern are the same when a reference is selected, but \(M_{n,k}\) of each deformed pattern may not be the same because of the motion of the object. For convenience, only one phase-shifting position is analyzed here, so the Equation (5) can be written as:  
\[I^{\prime\prime}{}_{k}=H_{k}I^{\prime}+\Delta I^{\prime\prime}{}_{k} \tag{6}\]  
where \(H_{k}=D_{k}B_{k}M_{k}\) is a degenerate matrix. Only \(I^{\prime\prime}{}_{k}\) is known in Equation (6), so we need to use an algorithm to estimate \(H_{k}\) and \(\Delta I^{\prime\prime}{}_{k}\) to solve \(I^{\prime}\). In experiment, to obtain the high-resolution image from the low-resolution image, we need to set the resolution magnification factor \(q\) and interpolate the low-resolution image, so that we can interpolate the first frame by bicubic interpolation, and this interpolated image can be regarded as the reference frame of high-resolution image. Then the down-sampling matrix \(D_{k}\) can be solved, and motion matrix \(M_{k}\) between other frames of low-resolution images and the reference frame can be calculated by pixel matching. Blur matrix \(B_{k}\) can be represented by PSF. Above all, \(H_{k}\) is estimated. Because super-resolution image reconstruction is an ill-posed problem, \(I^{\prime}\) needs to be estimated, so what satisfies the condition is a set of images, not the unique solution. However, under the Bayesian theory [21], MAP can flexibly add the prior probability of image, which is the mathematical expression of image features, and then it can convert ill-posed problems into well-posed problems by means of regularization. Finally, the unique solution of the problem can be obtained. MAP estimation refers to the maximum probability of obtaining a high-resolution image under the condition of known low-resolution image sequence \(I^{\prime\prime}\), which can be expressed as solving \(\max P(I^{\prime}|I^{\prime\prime})\). According to Bayesian theory, it can be calculated as:  
\[\hat{I}=\arg\!\max P(I^{\prime}\Big{|}I^{\prime\prime})=\arg\!\max(\frac{P(I^{ \prime\prime}|I^{\prime})P(I^{\prime})}{P(I^{\prime\prime})}) \tag{7}\]  
where \(\hat{I}\) represents the estimation of a high-resolution image \(I^{\prime}\), \(P(I^{\prime}|I^{\prime\prime})\)  is a posteriori probability, \(P(I^{\prime\prime}|I^{\prime})\) is a conditional probability when a high-resolution image degenerates into a low-resolution image, \(P(I^{\prime})\) and \(P(I^{\prime\prime})\) are the prior probabilities of the high-resolution image and the low-resolution image, respectively.