## 3 Preprocessing Process
### Quality and Similarity Assessment  
The generated optimal image may look improved to the naked eye, but it is not completely free from noise and image quality loss, which are chronic problems of contrast enhancement techniques. Therefore, it is necessary to evaluate quality and similarity through a comparison with the original image. In this quality verification and similarity evaluation step, PSNR and SSIM, which are representative IQA algorithms, and LoFTR, a feature point matching algorithm, are applied. PSNR (peak signal-to-noise ratio) is an indicator that measures quality by calculating the mean square error between the original image and the compressed image. It is mainly used when evaluating image quality loss information in image or video lossy compression and is expressed in decibels (db) [53]. \[\text{PSNR}=10\text{log}\,\frac{S^{2}}{MSE} \tag{3}\]  
In Equation (3), \(MSE\) (mean square error) is a value obtained by taking an average of the square errors, and S is the maximum value of a pixel. The higher the PSNR value, the lower the loss compared with the original video. In this paper, only images over 25 db were evaluated as optimal images [54]. SSIM (structural similarity index measure) is a method devised to evaluate the difference according to human visual quality rather than numerical error, and it compares the similarity of two images using three elements: luminance, contrast, and structure [55]. \[\text{SSIM}(x,y)=\text{I}(x,y)^{\alpha}\cdot c(x,y)^{\beta}\cdot s(x,y)^{ \gamma}=\frac{\left(2\mu_{x}\mu_{y}+C_{1}\right)\left(2\sigma_{xy}+C_{2}\right) }{\left(\mu_{x}^{2}+\mu_{y}^{2}+C_{1}\right)\left(\sigma_{x}^{2}+\sigma_{y}^{ 2}+C_{2}\right)} \tag{4}\]  
Figure 7: Step-by-step optimal image data generation images. The SSIM value is between 0 and 1, and the closer it is to 1, the higher the similarity. In this paper, only images with SSIM values of 0.75 or higher were evaluated as optimal images. In addition to PSNR and SSIM, there are many types of IQA algorithms, and since the performance, strengths, and weaknesses of each are different, it is good to select an algorithm suitable for the purpose. LoFTR (detector-free local feature matching with transformers) was used as a feature point matching algorithm. Existing local feature matching methods rely on detecting key points in images, which can be a tricky and computationally expensive task, especially when dealing with low-texture or repetitive regions. On the other hand, LoFTR is an approach to local feature matching in computer vision which uses a transducer-based architecture that does not rely on explicit key point detection, unlike conventional methods. LoFTR encodes pairs of image patches into feature vectors and predicts the correspondence between them. Unlike density methods, which use cost volumes to find correspondences, LoFTR uses self- and cross-attention layers in the transformer, which conditionally depend on the two images, to obtain a feature descriptor. The global receptive field provided by the transformer allows feature detectors to produce density matches in low-texture regions where it is usually difficult to create repeatable points of interest. The method is trained end-to-end on large datasets and has achieved high performance in experiments on indoor and outdoor datasets. LoFTR is a local feature matching solution that is particularly useful for matching images with low texture or repetitive regions, and it can reduce computational costs and improve the accuracy of the matching process. \[\text{Matching Accuracy}=100\times\frac{Count(Correct\;Matching\;Points)}{ Count(All\;Matching\;Points)} \tag{5}\]  
Figure 8 is the feature point matching image obtained using LoFTR. When feature point matching was performed on multiple objects, including the same object, using LoFTR, accuracy was measured using Equation (5) and showed high performance, as shown in the results in Figure 8. The accuracy of feature point matching can be determined by dividing the correctly matched feature points by the number of all matched feature points.