Enhanced Dct Image Watermarking Scheme Based on Zonal Sampling Algorithm Applied With Sspce Contour Extraction, Ramer and Adaptive Triangle Contour Compression Methods

This paper proposes an image watermarking scheme based on DCT transform and selected zonal sampling algorithms. The scheme used LPF and HPF transform coefficients in a certain geometric zone of the original image are retained. All the rest of the parameter is set to zero (0), quantized and transmitted where the watermark will be embedded. In order to test robustness, some attacks are performed. However, prior to the watermark extraction process, the attacked watermarked image will be subdued into contour processing methods using Single Step Parallel Contour Extraction, Ramer and Adaptive Triangle algorithms. The proposed method for contour compression will help enhance image recognition, security and especially where time (speed) is an essential factor. The results show that the proposed watermarking method is robust and secure against various signal/image processing attacks with PSNR values of approximately 35 dB with NCC values of 0.60 and above. In addition, experimental results from contour compression indicate that the proposed Adaptive Triangle method has a high compression ratio without significant visible distortion.


INTRODUCTION
An image is defined as a representation, likeness or imitation of an object or thing; it is a vivid or graphic description or something to represent something else [1] which can be stored in any representation, provided there is an algorithm that can convert it to a form usable by a display [2].As technology in a rapid speed has developed in the area of software and internet, storing (digital) information is no longer safe for they can be easily copied, stolen and distributed.Traditional encryption technology somehow is deficient, giving way to the emergence of digital watermarking techniques.Contour extraction (using SSPCE) and compression (using Ramer) from digital medical image are used as in [29,30].Recently, Arabic & English binary contours are compressed using new approaches as in [31,32].These digital watermarking techniques hide a special or distinct message in images, video, songs, texts and any multimedia data.However, digital watermarking techniques must also meet the requirement of imperceptibility, robustness and security [3,4] in order to be effective.For instance, the imperceptibility and the robustness requirements are two conflicting factors.Therefore, from a signal processing point of view, imperceptibility limits the strength of the embedded watermark.On the other hand, it is important to encode a relatively strong watermark for it to be resistant to content manipulation and attacks.A similar conflict may hold for the requirements of information capacity and efficiency.Hence, certain trade-offs (or compromises) are involved in the design of an effective watermarking system.Digital watermarking is essential because it aims to establish ownership [5] of the content i.e. image, a fingerprint to avoid unauthorized duplication and distribution of publicly available media content, for authentication and integrity verification purposes, Furthermore, watermark is added as usage control in order to limit the number of copies created, for content labeling and for content protection.Digital watermarks can be applied in copyright protection systems which are intended to prevent or determine unauthorized copying of digital media [6], source tracing or as broadcast monitoring application [7].Unfortunately, there is not a universal watermarking technique to satisfy all these purposes [8].The content in the environment that it will be used determines the digital watermarking technique.
Watermarking algorithms can be divided into two major categories: spatial and frequency domains.Spatial domain algorithms such as LSB [9], [10], Predictive coding, correlationbased techniques and patchwork techniques [11] have the advantages of fast and simple operations, utilizing the human visual system but the robustness, image quality and data payload have been greatly compromised.Frequency domain algorithms, on the other hand, first analyses a given signal whose structure and features are better understood by transforming the data into another domain [12,[13][14][15].There are several transforms available like the Fourier transform, Hilbert transform, wavelet transform, etc.In [15], discrete cosine transform (DCT) and discrete wavelet transform (DWT) are used for embedding and extracting watermark and concluded that DWT gives better image quality than DCT.However, DCT has its advantages too.It has a special property that most of the visually significant information of the image is concentrated in just a few coefficients of the DCT referred to as "energy compaction property".Many DCT based digital image watermarking algorithms are developed because of this property [16].DCT transforms a signal from a spatial representation into frequency representation [17].Lower frequencies are more obvious ‫العلوم‬ ‫األسمزيت:‬ ‫الجامعت‬ ‫مجلت‬ ‫األساسية‬ ‫والتطبيقية‬ Journal of Alasmarya University: Basic and Applied Sciences in an image than higher frequencies.Therefore, if an image is transformed into its frequency components and throw away a lot of higher frequency coefficients, the amount of data required to describe the image can be reduced without sacrificing too much image quality.DCT has the property that, for a typical image, most of the visually significant information about the image is concentrated in just a few coefficients of the DCT.Therefore, for this reason, the DCT is often used in image compression applications [12].

WATERMARKING METHODOLOGY 2.1 Block diagram of the proposed enhanced digital watermarking scheme
Watermarking schemes generally have three parts: the watermark, the embedding and extraction.In this section, the block diagrams of the proposed method are shown in Fig. 1a and Fig. 1b.The watermarking algorithm has two stages.In the first stage, the watermark is embedded in the original image using the proposed enhanced methods DCT for image compression and zonal sampling, to embed the watermark in the most secure position.A key is used during the embedding process.Then, DCT process is inverted to obtain the watermarked image.It is then transmitted to the receiver which has the watermarked image.This watermarked image will be tested for its robustness by applying various image processing attacks.In the second stage, the receiver then extracts the attacked host image which has been watermarked, using the inverse algorithm process performed in the first stage.The proposed watermarking scheme is performed using MATLAB software.a. Embedding algorithm b.Extraction algorithm Figure 1.The proposed enhanced watermarking algorithm

Embedding process
The original gray level image is compressed first using DCT method with the forward formula (1) [18].Where M and N are the rows and columns of an image.Then, zonal sampling is performed.

Zonal sampling
In the encoding/embedding process, transform coefficients are stored.It is the art of choosing the right place to embed the data.Zonal sampling refers to the sampling scheme where transform coefficients in a certain geometric zone are retained and all the rest is set to zero (0).The coefficients that are in the zone are then quantized and transmitted.An inverse transform is performed on the quantized coefficients in order to recover the original image.For a fixed bit rate, the performance, such as image quality and mean square error, will thus depend on the transform used, size of block, geometric shape and size of the sampling zone and quantization bit allocation of the transform coefficients [19].In this paper, two geometric zones are selected to retain the transform coefficients in embedding the watermark data.The rest of the transform coefficients of the host image must be set to zero.In zonal sampling algorithm 1, a square block in the upper left corner N*M of the host image (shadow region, Low Pass Filters) is the chosen region where the transform coefficients are set to zero.The transform coefficients outside the shadow region (High pass Filters) will be retained and will be used to embed data as shown in Fig. 2a and Fig. 3a; while zonal sampling algorithm II uses a triangular block in the upper left corner N*M of the host image as illustrated in Fig. 2b and Fig. 3b.After finding the index of the N largest coefficient values of the HPF, the watermark can then be embedded with the use of a key.The inverse process, IDCT is performing using formula (2) in order to obtain the watermarked image [18]. Where, Where M and N are the rows and columns of an image.

Extraction process
This method is used to retrieve the watermark which was inserted in the original image.The attacked watermarked image will be restored by first applying a filtering process.Then, the restored image will be transformed by applying DCT again and then determine the N largest coefficients of the HPF.After that, inverse transform IDCT will be applied to obtain the extracted watermark.The extracted watermark is then compared with the original watermark image.Zonal sampling is used to separate Low Pass Filter and High Pass Filter coefficients.LPF coefficients will be used for image compression while the remaining HPF coefficients will be used in the contour reconstruction stage.The two spectral sub-images are obtained using the low and high-pass filters after the zonal sampling procedures (in both algorithms I and II).

Contour compression processing
This paper has integrated contour processing which is performed after the embedding process; it is aimed to test a new method for contour compression known as the Adaptive Triangle method.After obtaining the watermarked image, it undergoes various attacks.One of the applied attacks is blurring.From this point, threshold is applied to obtain a binary image of the attacked watermarked image.In order to extract its contours, SSPCE method is used.Then, these contours are compressed using the Ramer/Adaptive Triangle method.The block diagram of this technique is shown in Fig. 4 ( ‫المجلذ‬

Single Step Parallel Contour Extraction (SSPCE) Algorithm:
The contour data for the proposed algorithm is extracted from black-white images (which can be derived from colour or gray images by conversion) using a well-known method of contour extraction called SSPCE.There are two methods that use a 3×3 pixels window structure to extract the object contours using the central pixel to find the possible edge direction, which connect the central pixel with one of the remaining pixels surrounding it.The first one uses 8connectivity scheme between pixels using the 8-Directional Freeman chain coding scheme to distinguish all eight possible line segments connecting the nearest neighbours.The second algorithm uses the 4-connectivity scheme between pixels using 4-Directional Freeman chain coding scheme to distinguish all four possible line segments.This paper uses the first mentioned method.
The following three stages are required for the extraction procedure: Extract contours by applying 8-directional chain-code.The extracted edge code is represented by 2 k (k: 0-7), while b(i, j) represents the binary value of a pixel point (i, j) and are calculated using pseudocodes .Stage 3: Sort and optimize [20,21,28].

Contour compression using the Ramer method:
The algorithm is based on the maximum distance of the curve from the approximating polygon and this distance is used as the fit criterion.The algorithm produces a polygon with a small number of edges for arbitrary two-dimensional digitized curves.The segment of the curve is approximated using a straight-line segment connecting its initial and terminus.If the fit criterion is not fulfilling, the curve segment is terminated into two segments at the curve point most distant from the straight-line segment.This loop is repeated until each curve segment can be approximated by a straight-line segment through its endpoints.The termini of all these curve segments then are the vertices of a polygon that satisfy the given maximumdistance approximation criterion [22,23,24] as shown in Fig. 5.This distance is compared using the given threshold as formulated in 3 [22]: Where SP is the starting point; EP is the ending point; d max is the maximum distance from (SP-EP) line to the contour curve; th is threshold.This loop is repeated until each curve segment can be approximated by a straight-line segment through its endpoints.The termini of all these curve segments then are the vertices of a polygon that satisfy the given maximumdistance approximation criterion.This type of polygonal curve representation exhibits two important disadvantages.First the polygons contain a very large number of edges and, therefore, are not in as compact a form as possible.Second, the length of the edges is comparable in size to the noise introduced by quantization.

Contour compression using Adaptive triangle method:
Adaptive Triangle method is perform by choosing two points on the contour curve and computes the maximum distance from contour curve to the straight line that connects them as shown in Fig. 6.This distance is compared using the given threshold as formulated in 4: (4) VA is the sequence of indices of the final vertices; CC is the sequence of the input for the contour; SP is the starting point; EP is the ending point; d max is the maximum distance from (SP-EP) line to the contour curve; L is the input contour length and (f) is the length between each two points, S1 is length of first segment of vertex point, S2 is length of second segment of vertex point, LN is real distance between start and end point of vertex segment, LO is direct distance between start and end point of vertex segment, ff is segment length of the vertex point , th 1 is Threshold1 and th 2 is Threshold2.If the ratio between the direct distance and the real distance is smaller than the second threshold [22]: (5) This step is to show what happens in case the ratio value exceeds the threshold value.If the ratio exceeds the second threshold th2 value, then no edge points between the starting and ending points of the triangle will be stored.

Research parameter measurement
Robustness: Watermarking method"s robustness is assessed by applying attacks (geometrical, noise, image compression, etc.) on the watermarked image and evaluates the similarity of the extracted watermark to the original watermark.The Normalized Correlation Coefficient is expressed in the following equation 6 [25]: Where ( ) = original watermark; ( ) = extracted watermark after transformation.Its value should be closed to 1 or 1 for a watermark to be considered robust, meaning, high similarity is achieved between the extracted watermark and the original watermark.

Imperceptibility:
The original image and the watermarked image" quality (statistical difference) is measured using peak signal-to-noise ratio (PSNR).The PSNR between the original and reconstructed images is expressed in the equation 7 [25]: Where L = grey-level number; = original mage; ̃= watermarked image.

Quality measurement:
In order to measure the quality of an approximation during the approximating procedure, mean square error (MSE) and signal-to-noise ratio (SNR) criteria are used 8 [22]: Compression ability: In order to evaluate the compression ability of the scheme (i.e.zonal sampling), the following compression ratio is used 9 [22]: ‫العلوم‬ ‫األسمزيت:‬ ‫الجامعت‬ ‫مجلت‬ ‫األساسية‬ ‫والتطبيقية‬

Journal of Alasmarya University: Basic and Applied Sciences
Where NOZ is number of the zero coefficients in the spectral domain and the (n, m) are the number of rows and column of the image.Bit per pixel (BPP) is expressed in 10 [22]: Where: S = Coefficients number in the desired zonal used as LPF filter; 8 = Means each pixel represented by eight bit; n m = size of the image.

Experimental results of various host images using DCT with zonal sampling I & II
In this section, tests were conducted to evaluate the imperceptibility and robustness of the proposed method.The test images have 512*512 size; zonal sampling I size is set to N=M=66 and zonal sampling II is set to N=M=47.The size of the watermark UTHMFKEE is 141*157.
The test images are shown in Fig. 7(a-f).A new watermark is used as shown in Fig. 8. Table 1 -Table 3, present the results of watermarked images, attacked watermarked images and the extracted watermark in zonal sampling I while zonal sampling II experimental results are shown from Table 4 -Table 6.These tables display the test results of the extracted watermark in several attacks.It can be seen that different parameters of attacks are chosen to achieve a PSNR of about 35 dB for the watermarked images and the NCC of the extracted watermark should at least be 0.60 and above in order to be considered robust.It is observed that at such PSNR, the watermarked images are almost indistinguishable from the original image to the human eyes.The proposed watermarking method will undergo enhanced testing.1-6, the proposed watermarking method is robust against various blurring attacks.The extracted watermark is near identical specially in motion blurring with a very high PSNR value after extraction as the PSNR value is always greater than 35 dB (without attack) and there is high correlation after all attacks have been applied.These results show that the watermarked document is visually near identical to the original image.In addition, the simulation results indicate that the proposed watermarking method is robust against signal processing attacks such as JPEG compression, salt and peppers, adding blurring attacks like Gaussian, motion attack such as blurring, LoG, sharpening, low pass filtering and median filtering.A correlation value above 0.60 is considered robust after watermark extraction.However, the proposed watermarking method shows vulnerability to salt and peppers noise.Nevertheless, correlation coefficient is still above 0.60 which means that the extracted watermark nearly resembles the original watermark after attacks are applied.

Enhanced watermarking method using DCT with zonal sampling I and II
algorithms against other related work methods.The proposed method is tested on gray level test image Lena of size 512*512 pixels with a watermark image of size 64*64 pixels, a logo taking the alphabets "JNTUACEA" as shown in Fig. 9(a-b).In this experiment, six different image processing attacks are used.The comparative results are measured by its normalized cross correlation (NCC) values to prove robustness against various attacks mentioned.Image processing attacks applied to the watermarked image include JPEG with QF= 50 and a salt and peppers noise of 1%.All the edges in the image are enhanced in sharpening attack.The watermarked image is passed through a low pass filter wherein median filter is applied for filtering attacks.In this attack, the image is smoothened, and from this, watermark image is extracted.Finally, blurring motion attack is applied to test the robustness of the scheme.The results in Table 7 and Fig. 10 show the NCC values of the test image after watermark embedding and extraction processes are performed using the proposed method and compared with FIS method [26].In most results, the proposed method is better in terms of robustness requirement than FIS because it is more resilient to salt and peppers noise (zonal sampling I 6% and zonal sampling II, 7% better); For JPEG compression, the proposed method is 6% better in zonal sampling I and 5% better in zonal sampling II.For low pass filtering, zonal sampling I is 12% better while 13 % better in zonal sampling II for the proposed method.For motion blurring attack, zonal sampling I and II are 9% better.However, FIS method performs slightly better when median filtering (6% in the average) and sharpening attacks (4% better than the proposed method) are applied.Even so, the correlation value of the proposed method can still be considered high which means, it is still robust against median filtering and sharpening attacks.

Figure 10. Comparative NCC results of the proposed method versus FIS using DCT in bar plots
In this second comparison, the proposed method is tested on gray level test image Mandrill of size 512*512 pixels with a watermark image of size 32*32 pixels, a logo taking the alphabets "JNTU" as shown in Fig. 11( a-b).12 show the NCC values of the test image after watermark embedding process is performed using the proposed method which is compared with Neural Networks (BPNN and GRNN) [27].The results indicate a detected perfect correlation for JPEG compressed watermarked images with quality factor q=90, and sharpening.Therefore, the proposed method is highly robust because there is a high correlation between the extracted watermark and the original watermark after different attacks.
However, the proposed method is vulnerable to median filtering against Back Propagation Neural Network (BPNN) (lesser robust 4% on the average) and about 37% lesser robust when salt and salt and pepper noise is applied to both BPNN and GRNN.

Contour compression from watermarked image in frequency domain DCT using zonal sampling methods
In order to obtain the binary image from the attacked watermarked image Tools in (Fig. 13a), a threshold has been applied.The contour extraction is done through the SSPCE (Fig. 13b) while contour compression results were measured using the mean square error, peak signal-tonoise ratio and compression ratios.Table 9 shows the results of contour compression using Ramer method and zonal sampling I and II from attacked watermarked image Tools and Table10 for the Adaptive triangle method. of the compressed contours using Ramer method are shown in Fig. 14a and Fig. 14b while compressed contours using the Adaptive triangle method are shown in Fig. 15a and Fig. 15b.Performed analysis and experiments for the analysed algorithms show that PSNR should be greater than 32 dB to obtain the expected compromise between compression ratio and quality of reconstruction.In the case of high threshold level, the contour details are eliminated and the level of introduced distortion will not be accepted.Compression ratio higher than 50 is within the acceptable target.This will apply to both the Ramer and Adaptive triangle method of contour compression.The following are the data gathered to recall, test image Tools" size is 256x256.In order to obtain the desired binary image of the attacked watermarked image Tools, four threshold values were used.Then by applying SSPCE, contours were extracted, followed by the visual representation of the acquired results from Table 9 of the compressed contour images from the attacked watermarked image Tools using the Ramer method and zonal sampling I and II respectively.In this manner, one could tell whether the data contained in the image are not damaged or altered but has maintained security and the binary image is still recognizable.Using DCT, it can be observed that as the threshold is increased, the PSNR value of the binary image decreases while compression ratio increases.From the results obtained in Table 9, zonal sampling I has a slightly better result than zonal sampling II, when it comes to the quality of the image during the approximation process using the Ramer method.The amount of distortion differs slightly to zonal sampling II.However, zonal sampling II has a better compression ability compared to zonal sampling I allowing a slightly higher amount of distortion.The way to contour compression using the Adaptive Triangle has an identical process as the Ramer method.Meaning, a certain threshold is used in order to obtain the binary image from the attacked watermarked image, followed by contour extraction using SSPCE.
The difference between Ramer and the proposed Adaptive Triangle contour compression methods is that the first uses only one thresholding, while the latter uses a set of two thresholds at four given variables sets and a constant length (f) as shown in Table 10 for DCT.
A time factor for in seconds is also included to measure its compression speed while distortion is measured by taking its Mean Squared Error, peak signal-to-noise ratio criterions to measure image quality after compression, and compression ratio (or bit per pixel).
In order to obtain the desired binary image of the test image Tools, four threshold values were used.As the threshold is increased, the PSNR value of the binary image decreases while compression ratio increases.From the results obtained, the Adaptive triangle method shows better results maintaining higher PSNR values compare with Ramer, both in zonal I and II.Although Ramer has shown higher compression per threshold, it has a lesser average compression ability (71.50% zonal sampling I and 71%,75% for zonal sampling II), Adaptive triangle method achieves a higher compression ability (76 % and 77% for zonal sampling I and II respectively) than Ramer even if the distortion of the image increased in every given double threshold.This proves that Adaptive triangle method produces good quality approximation with a fast-computational time.This also means that Adaptive triangle method for contour compression shows a 6% improvement when compared with Ramer.The results show that the proposed compression algorithm in DCT has slightly better PSNR and CR using zonal sampling algorithm II compared to zonal sampling algorithm I.The amount of distortion as per MSE is lower in ZS II thus giving a better quality compressed image.The elapsed compression time is also faster in ZS II as compared to ZS I.

Comparative results of the different contour compression methods against the
proposed Adaptive Triangle method In this section, further test is performed to compare and validate the compression abilities between Ramer, Trapezoid and the proposed algorithm [28] as shown in Table 11.Note that the image Tools with contour compression using the Adaptive triangle method is watermarked (UTHM FKEE) whereas Ramer and Trapezoid are not.This explains why higher MSE values on both zonal sampling I and zonal sampling II results are obtained.
The results show that the analyzed algorithm has a good extraction property and contour compression abilities with accepted quality compared with the binary image using threshold value in the case of Ramer and Trapezoid.It is seen that these two contour compression algorithms take more compression time while the method using Adaptive triangle is significantly faster compared with them for Tools image.The SNR is improved with the proposed algorithm compared to the binary images that use suitable threshold value only.

CONCLUSIONS 4.1 The proposed enhanced watermarking method
The watermarking method was tested and compared with other existing works using DCT and other combined techniques.From the experimental results gathered in the extraction process, the proposed enhanced watermarking method has a fidelity which is near identical to the original image as the PSNR values are always greater than 35 dB even when subdued to another image processing method prior to the extraction process.It is also robust against various attacks as the NCC values are 0.60 and above.Therefore, it can be concluded that using the proposed enhanced watermarking method using DCT with zonal sampling methods for embedding data passed the criterion of robustness and imperceptibility.

Contour extraction and contour compression techniques
A significant achievement from this paper is the combination of contour extraction using SSPCE and contour compression techniques from the attacked watermarked image which add value to image detection ability.Furthermore, it can be used with a minimum level of image distortion.A method called Adaptive Triangle method for image compression is introduced.It is found that the short computational time of operations and good quality of approximation are the main advantages of the proposed algorithm.This gives usefulness in a wide application for contours where speed is necessary.It has a better compression ability compared with the Ramer and Trapezoid methods based on the experimental results.

Figure 4 .
Figure 4. Block diagram of contour extraction using SSPCE and compression using Ramer and Adaptive Triangle methods

Figure 5 .
Figure 5. Curve approximation using the Ramer method

Figure 7 .Figure 8
Figure 7. Various test host images (a) Tools (b) Cameraman (c) Rice (d) Fruit (e) Lena (f) Baboon First with no attack giving a perfect correlation value of 1. Noise addition attack (Salt and peppers, Gaussian noise), Filtering attack (Gaussian LPF, median filters), Various attack (sharpening, blurring motion), LoG and JPEG Compression are among the few image processing attacks used to test the robustness of the scheme.The results are shown in Tables 1-6.According to the ‫العلوم‬ ‫األسمزيت:‬ ‫الجامعت‬ ‫مجلت‬ ‫األساسية‬ ‫والتطبيقية‬ Journal of Alasmarya University: Basic and Applied Sciences results obtained from Tables

Figure 12 .
Figure 12.Comparative NCC results of the proposed method versus Neural Networks using DCT

Figure 13 . 3 . 3 . 1
Figure 13.Host image Tools (a) Attacked watermarked host image (b) Extracted contours from attacked watermarked host image using SSPCE3.3.1 Results in the frequency domain DCT using zonal sampling methods, SSPCE and Ramer contour compression method:The following are the data gathered to recall, test image Tools" size is 256x256.In order to obtain the desired binary image of the attacked watermarked image Tools, four threshold values were used.Then by applying SSPCE, contours were extracted, followed by the visual representation of the acquired results from Table9of the compressed contour images from the attacked watermarked image Tools using the Ramer method and zonal sampling I and II respectively.In this manner, one could tell whether the data contained in the image are not damaged or altered but has maintained security and the binary image is still recognizable.

Figure 14 .
Figure 14.Compressed contour of the watermarked image Tools using Ramer a) zonal sampling I method b) zonal sampling II method 3.3.2Results in the frequency domain DCT using zonal sampling methods, SSPCE and Adaptive triangle contour compression method:

Table 1 .
DCT with zonal sampling I

Table 2 .
DCT with zonal sampling I experimental results without attack, experimental results with Gaussian noise, salt and peppers and JPEG attacks blurring attacks motion and LoG

Table 3 .
DCT with zonal sampling ITable 4. DCT with zonal sampling II experimental results with sharpening, experimental results without attack, LPF and median filter salt and peppers and JPEG attacks

Table 5 .
DCT with zonal sampling IITable 6. DCT with zonal sampling II experimental results with Gaussian noise, experimental results with sharpening, blurring attacks motion and LoG LPF and median filter attacks

Table 8 and
Fig.

Table 8 .
Comparative result between Neural Networks and the proposed enhanced watermarking method using DCT and zonal sampling

) Issue 5 (December 2021)
The results obtained indicate visual representations

Table 9 .
Contour processing results in DCT using SSPCE, Ramer method and zonal sampling I & II

Table 10 .
Contour compression results in frequency domain DCT using, SSPCE, Adaptive Triangle method and zonal sampling algorithm I & II