## 4 Proposed Methodology  
Spatial domain watermarking algorithms are robust, secure and adaptive; however, they are not strong against all types of attacks. In this work, frequency domain watermarking algorithms are applied to obtain resistant results in non-blind, semi-blind and blind watermarking for images. DWT, DCT and DFT algorithms have some advantages and disadvantages regarding extracted watermarks and attacks. In this research work, we enhanced the DWT algorithm in semi-blind watermarking in the embedding of binary  
Figure 2: 64 Basis functions of an 8-by-8 matrix. images. Figure 3 shows the original cover image, binary watermark and watermarked image using the DWT algorithm [37; 38]. [PERSON] et al. [39] proposed a Wavelet-based watermarking algorithm that is robust and secure. The cover image is converted into the DWT with four bands: low frequencies in the LL band and high frequencies in HL, LH and HH bands. Pseudorandom Number (PRN)-based secret information is embedded into the high frequencies of the first level of decomposition. Experimental results show that DWT-based watermarking is very promising; however, embedding only the first decomposition of the cover image is weak for some of the geometric attacks [40]. The [PERSON] et al. [39] watermark embedding methodology is demonstrated in Algorithm 1. **INPUT: Cover Image I (size is N \(\times\) N), watermark W (size is N/2 \(\times\) N/2) and secret key S**  
1. If a cover image is a color image, convert it into the greyscale image
2. Transform the cover image into the first level decomposition of the discrete Wavelet transformation
3. Select LL coefficients as a low-level frequency and select HL, LH and HH coefficients as high-level frequencies
4. Embed binary watermark W into the cover image I using the following formula. \(\alpha\) is a scaling factor that is obtained using several options WI (Watermarked Image) = W + \(\alpha\) \(\times\) I
5. First level of inversion applied to embedded image coefficients to obtain watermarked image WI  
**OUTPUT: Binary image embedded watermarked image WI**  
**In this method, instead of hiding PSN, a binary image is used as a watermark. When PSN is used as a watermarking, the algorithm detects if there is a watermark or not. If embedding a watermark is an image, stamp, logo, or text, the proposed algorithm extracts hidden multimedia elements. The Dugat algorithm is enhanced using block-based DWT in binary images. The block-based algorithm creates 4 \(\times\) 4, 8 \(\times\) 8 or 16 \(\times\) 16 blocks equal to size blocks from the cover image and embeds a binary image into each block using discrete Wavelet transformation. In block-based watermarking, there is greater chance to find the best embedding pixels to hide secret data, especially against attacks. Algorithm 2 below demonstrates the block-based DWT methodology [41]. Information hiding using Algorithm 2 gives very promising results, especially in vector images. One of the drawbacks is the high CPU time because of the application of the same algorithm to the N \(\times\) N blocks. Compared to Algorithm 1, this method is more robust and secure. On the other hand, it has more complexity time. The block-based DWT algorithm is weak against cropping, rotation and image scaling attacks. In this research work, Algorithms 1 and 2 are enhanced in order to find the optimal value of \(\alpha\) using the flexible scaling factor idea [42]. Figure 3: Cover image, binary watermark and watermarked image. ```
1. If a cover image is a color image, convert it into the grey scale image
2. Apply 4 \(\times\) 4 (or another size) of decomposition to the cover image and binary image. Each block size of the cover image and size of the watermark should be the same
3. Transform each block of the cover image into the first level decomposition of the discrete Wavelet transformation
4. Select LL coefficients as a low-level frequency and select HL, LH and HH coefficients as high-level Frequencies in each band
5.