## 4 The Proposed Methodology  
In images that are created digitally by using watermarking, an image is secretly implanted into a carrier image, and it is difficult to remove. Two processes make up watermarking: embedding and detection. The watermark image is embedded into the cover image to create a watermarked image. The scaling factor is crucial in creating a reliable and effective watermark. An optimal scaling factor is calculated to improve the algorithm's reliability and performance. The suggested technique utilizes DTOSFS to calculate the scaling factor. The DCT coefficients of both the cover and watermark images are modified by a scaling factor for embedding purposes. Extracting them means getting the watermark with as little damage as possible. The inverse DWT and inverse DCT are used to extract the information. Figure 4 shows the flow of the steps included in the proposed methodology. These steps are described in the following. 1. The cover image (\(l_{c}\)) and watermark images (\(l_{w}\)) are initially used for the watermarking process. 2. The Haar wavelet transform is used to calculate the cover image's wavelet transform [20]. The approximate result is the application of the Haar wavelet transform in two dimensions, with further computations for the horizontal, vertical, and diagonal components. Therefore, the \(M\times N\) discrete wavelet transform of the cover image (\(l_{c}\)) is: \[W_{\Theta}(j_{0},m,n)=\frac{1}{\sqrt{MN}}\sum_{x=0}^{M-1}\sum_{y=0}^{N-1}f(x, y)\Theta_{j_{0}m,n}(x,y)\] (18)
3. Applying the DCT transform to the wavelet transform results in a transformation from the time domain to the frequency domain. The formula for this step is as follows: \[F(u,v)=\sigma(u)\sigma(v)\sum_{i=0}^{m-1}\sum_{j=0}^{n-1}g(i,j).cos\bigg{[} \frac{(2i+1)u\pi}{2m}\bigg{]}cos\bigg{[}\frac{(2j+1)v\pi}{2n}\bigg{]}\] (19)  
The computation of the inverse of the DCT can be applied as follows:  
\[G(m,n)=\sigma(u)\sigma(v)\sum_{i=0}^{M-1}\sum_{j=0}^{N-1}f(u,v).cos\bigg{[} \frac{(2i+1)u\pi}{2m}\bigg{]}cos\bigg{[}\frac{(2j+1)v\pi}{2n}\bigg{]} \tag{20}\]where  
\[\sigma(u)= \begin{cases}\frac{1}{\sqrt{2}}&u=0\\ 1&u=1,2,3...,m-1^{{}^{\prime}}\end{cases}  \tag{21}\]  
\[\sigma(v)= \begin{cases}\frac{1}{\sqrt{2}}&v=0\\ 1&u=1,2,3...,n-1^{{}^{\prime}}\end{cases}  \tag{22}\]  
The proposed algorithm is presented in Algorithm 1. 4. The DTOSFS algorithm is applied to search for the optimal scaling factor and the coefficient for embedding the watermark. The result of using DTOSFS is the computation of the optimal value of \(\alpha\), which is the invisibility or weighting coefficient. 5. The watermark \(W(i,j)\) is inserted into the cover image \(I(i,j)\) by using an additive technique that is applied using the following formula. \[I^{\prime}(i,j)=I(i,j)+(\alpha\times W(i,j))\] (23) For the original image, the DWT coefficient is denoted by \(I\). In contrast, \(I^{\prime}\) refers to the DWT coefficient for the watermarked image, and for the watermark image, the DWT coefficient is denoted by \(W\). 6. The inverse DCT and inverse DWT of \(I^{\prime}\) are applied to obtain the watermarked image. 7. The inverse of the additive formula is applied to extract the watermark. \[W=\frac{I^{\prime}(i,j)-I(i,j)}{\alpha}\] (24) Finally, the inverse DWT of \(W\) is applied to compute the raw watermark image \(I_{w}\). Figure 4: The detailed steps of the proposed approach.