# Image Copy-Move Forgery Detection Based on Fused Features and Density Clustering
## 4 The Proposed Scheme
### Tampered Region Localization  
To further improve the accuracy of tampered region localization, in this paper we compute the affine matrix of matching pairs and apply this transformation to the dense regions of the image at the pixel level. The final tampered region is located by comparing the similarity between the transformed image and the original image at the same unknown location.  
Estimation of affine transformation: An affine transformation matrix can reveal geometric changes that occur between objects, such as rotation, scaling, and so on. Based on feature point matching, the affine transformation between original and tampered regions can be estimated using the coordinates of the matching pairs. Given two corresponding sets of matching pair coordinates \(X=\left(x,y\right)\) and \(\widetilde{X}=\left(\widetilde{x},\widetilde{y}\right)\), their relationship is shown as follows:  
\[\begin{pmatrix}\widetilde{x}\\ \widetilde{y}\\ 1\end{pmatrix}=\begin{pmatrix}a&b&t_{x}\\ c&d&t_{y}\\ 0&0&1\end{pmatrix}\begin{pmatrix}x\\ y\\ 1\end{pmatrix}=T\begin{pmatrix}x\\ y\\ 1\end{pmatrix} \tag{14}\]  
In the formula, \(t_{x}\) and \(t_{y}\) are translation parameters, while \(a\), \(b\), \(c\), and \(d\) are scale and rotation transformation parameters. Matrix \(T\) can be calculated using at least three non-collinear matching pairs.  
The set of matching pairs after removing the mismatched pairs is denoted as \(\left\{\left(X_{1},\widetilde{X_{1}}\right),\left(X_{2},\widetilde{X_{2}} \right),\ldots,\left(X_{n},\widetilde{X_{n}}\right)\right\}\). Three points are randomly selected from each cluster, their corresponding points are found in the matching list, and an affine transformation matrix \(T_{i}\) is estimated from the three pairs of points. All matrices are then computed, and an optimal matrix \(T\) is found that minimizes the error, as shown in the following formula:  
\[\underset{T}{\text{argmin}}\left\|\widetilde{X}-T_{i}X\right\|^{2} \tag{15}\]  
Using the obtained optimal affine matrix \(T\), the transformation is applied to all pixels in the entire image. Then, the transformed image is overlaid with the original image, with the original region \(Y_{O}\) overlapping the tampered region \(Y_{D}\). Similarly, the inverse transformation is applied to region \(T^{-1}\), with the tampered region \(Y_{D}\) overlapping the original region \(Y_{O}\) in the same way.  
\[Y_{D}=TY_{O},Y_{O}=T^{-1}Y_{D} \tag{16}\]  
To locate the tampered regions, we utilize the polar cosine transform (PCT) feature as the similarity measure and compute it for corresponding positions in both the original and transformed images. When the difference between the two features is less than a certain threshold, the location is marked to obtain a region-of-interest map. The PCT feature calculation of the \(n\)-order continuous image \(g\) for \(l\) consecutive times is as follows:  
\[f=\left\{\left|M_{n,l}\right|\text{\emph{such that }}n+l\leq 3,0\leq n,l<3\right\} \tag{17}\]  
In the formula:  
\[M_{n,l}=\Omega_{n}\int_{0}^{2\pi}\int_{0}^{1}\left[H_{n,l}(r,\theta)\right] \times g(r,\theta)rdrd\theta \tag{18}\]  
\[\Omega_{n}=\left\{\begin{array}{l}1/\pi n=0\\ 2/\pi\ n\
eq 0\end{array},\ H_{n,l}(r,\theta)=\cos\left(\pi nr^{2}\right)e^{ il\theta} \tag{19}\]where \(g(r,\theta)\) is the image representation in polar coordinates.  
Using a threshold value \(t\) to compare the feature differences in the overlapping areas, the region is identified, and the final correlation map is obtained. Then, a Gaussian filter is applied with a window size of \(7\times 7\) and a standard deviation of 0.5 for denoising and detail processing. Finally, the closing operation is performed to obtain the final detection result.