Digital Image Watermarking using Optimized DWT-DCT

(69 customer reviews)

$0.00

Total downloads: 532

This repository is for the free code of digital image watermarking .  This code is for the invisible digital image watermarking using combination of three methods: Discrete Wavelet Transform (DWT), Discrete Cosine transform (DCT) and Bacterial Foraging optimization (BFO). You need to run the file ‘main.m’ in MATLAB and follow the steps shown in video https://youtu.be/jgkaG8hA5vo.

Download Test
 Discuss Code

Description

The digital image watermarking is based on the fact that a message is hide into the image such that image doesn’t get disturbed and message can be retrieved easily. The method should be robust. For this purpose, this repository is implementing the discrete wavelet transform (DWT) and discrete cosine transform (DCT) in cascade so that more robustness and security can be achieved. These methods divide the image into different frequency regions so that watermark message can be embedded into lowest frequency region which will not disturb the image. DCT is applied first which is similar to Fourier transform and divides the image into two parts of lower and higher frequency region. Lower frequency region has most of the image information.

DCT frequency coefficient of image

Figure: (a) original image (b) low frequency component of DCT (c) high frequency component of DCT

Similarly, DWT using haar  wavelet transform split the images into four different frequency coefficients: approximation coefficients, horizontal , vertical and detailed frequency component.

DWT frequency coefficient for image

Figure: DWT frequency components of image

Horizontal coefficient is used to insert the watermark image and DCT transform is further applied to cH1 component of DWT transformed image. The embedding of watermark image needs a optimal gain factor which sets the robustness of the message. If this value is too high then security will be increased but retrieval of message will be difficult and vice-versa. So trade off gain factor has to be used for embedding of watermark in it. We used Bacterial Foraging optimization (BFO) for this purpose at https://free-thesis.com.

Embedding of Watermark

  1. Take the message and reformulate the message into sequence of 1 and 0.
  2. Encode the message using convolution and this encoded message is further used for processing
  3. Take the key and generate a PN sequence by that key. This PN sequence is kept same during all embedding process.
  4. Generate two highly uncorrelated PN sequence pn_sequence_1 and pn_sequence_0.
  5. Perform DWT on the host image to decompose it into four non-overlapping multi resolution coefficient sets: cA1, cH1, cV1 and cD1.
  6. Choose block size and a mid band coefficients matrix for DCT. In our paper block size of 8 is chosen and a mid band matrix of 8*8 is chosen from literature review.
  7. Now perform DCT on cH1 and embed both PN sequence with a gain factor ‘k’ depending on the bit value of message. The algorithm for embedding PN sequence is shown as

    X = x + k * PN0 if b = 0

    X = x + k * PN1 if b = 1

    Where,

                  x = is the cover image

                  b = is the watermarked bit

                 X = is the embedded image

  8.  Now perform IDCT on cH1.
  9. Repeat step6 and 7 for cV1.
  10. Perform IDWT on updated values of cA1, cH1, cV1, cD1 and name this image as watermarked image.
  11. PSNR and Normalized cross correlation is found out to determine robustness and image quality of watermarked image.
  12. Now follow steps from 1 to 10 for embedding next watermark using separate key for PN sequence. The size of watermark is determined by hit and trial method and that comes less than the previous watermark size.
  13. Number of watermarks embedded depends upon retrieval process because watermark should be retrieved properly that is without any distortion.

Retrieval of Watermark

The joint DWT-DCT algorithm is a blind watermarking algorithm, and thus the original host image is not required to extract the watermark.

  1. Step 1: Steps from 1 to 5 of embedding process are same using same key for PN sequence generation.
  2. Now perform DCT on cH1 and generate a sequence at condition where mid band matrix element is 1. Correlate that sequence to pn_sequenc_0 and to pn_sequence_1.
  3. Repeat the step 2 with cV1.
  4. Take the mean of correlation value for pn_sequence_1 of cH1 and cV1 and correlation value for pn_sequence_0 of cH1 and cV1.
  5. If correlation value for 0 is greater than the correlation value of 1, put the message vector element equal to 0 otherwise 1.correlation_0>correlation_1Message vector = 0

    Otherwise

    Message vector = 1

  6. Apply viterbi decoder on message vector to deocde message vector into original.
  7. Reshape the message vector and that will be similar to message embedded.
  8. Same steps are repeated for next watermark message retrieval.

Fitness Function Calculation

To set the optimum value of gain factor bacterial foraging optimization is used in our work. The BFO minimizes the objective function value to get the best location of E.Coli bacteria. So the task is to formulate the objective function to achieve the best gain value. For this purpose inverse of normalized cross correlation has been considered the parameter which is to be minimized. Initially random gain value is selected and that is passed to the embedding and retrieval process of message using DWT and DCT watermarking process. At the watermarked image by this process various noises like Gaussian noise, salt & pepper noise, speckle noise and poisson noise have been added and message is recovered from these noisy images. NCC between the original message and recovered from these noisy watermarked images have been found out. Then the inverse of sum of all these NCCs is considered as the objective function of BFO.

Image watermarking objective function

Result Discussion

We tested the algorithm at three different kind of images which are low,high and medium key images. This category is suggested on the basis of computer graphics literature where the image with more number of histogram bins are aligned to left for low key image, to right for hugh key image and in middle  for medium key image.

low key image for image watermarking

Figure: histogram plot for low and high key image

A gui to compare the three different watermarking algorithms is also designed in MATLAB. It makes easy to run the algorithm and analyse. On the criteria of PSNR, NCC and IF parameters, we found the gain factor tuning by BFO gives best performance.

Image Watermarking GUI

69 reviews for Digital Image Watermarking using Optimized DWT-DCT

  1. fodayj25 (verified owner)

    I am working on my thesis using DWT-SVD and I have embedded in different sub-band of the DWT. I came across your work. It has really helped me. The reason is that my supervisor wants me to compare DWT with other watermarking techniques and see the results. I really appreciate the work done with this code. It very neat and easy to understand.
    Thank you!

    • admin (verified owner)

      We are glad, it helped you.

  2. pratuisha.koripilli (verified owner)

    thnks

  3. azlina.mahad (verified owner)

    ok

  4. qq.qq (verified owner)

    nice

  5. imjoy (verified owner)

    good

  6. anshuman.prakash (verified owner)

    Good

  7. kumarraghav (verified owner)

    very good

  8. raillon.georges (verified owner)

    Très interresentes approche

  9. ashishsoni (verified owner)

    Great

  10. venkat.reddy (verified owner)

    great

  11. venkat.reddy (verified owner)

    great

  12. rohit.bumo (verified owner)

    Great!

  13. mieszko.nowicki (verified owner)

    yoo

  14. nikhil (verified owner)

    GOOD

  15. nikhil (verified owner)

    GOOD

  16. anilkumar.katharotita (verified owner)

    Good !!!!

  17. ankush.chaudhary (verified owner)

    Good

  18. hello.world (verified owner)

    nice

  19. vvp.vvpiet (verified owner)

    good

  20. vvp.vvpiet (verified owner)

    good

  21. blade.runner (verified owner)

    good experince

  22. sameer.kumthekar (verified owner)

    best

  23. vankani.arjun (verified owner)

    Nice project !!

  24. jyoti.khandelwal (verified owner)

    good

  25. anshuman.vishwakarma (verified owner)

    Good

  26. SHENXIAOXIAO (verified owner)

    well done

  27. namit.gupta (verified owner)

    Thanks

  28. sandeep.reddy (verified owner)

    Ch

  29. sathvik.hr (verified owner)

    Nice

  30. muhammad.luki (verified owner)

    ok

  31. mehrab.hosain (verified owner)

    That good one

  32. Manikanta (verified owner)

    nice

  33. akshad.singh (verified owner)

    good

  34. aditya.anugrah (verified owner)

    nice brooo

  35. aditya.anugrah (verified owner)

    nicee

  36. hanaa.hamouda (verified owner)

    i like this website

  37. deeraj.kumar (verified owner)

    good

  38. rishu.singh (verified owner)

    Good

  39. rishu.singh (verified owner)

    Good

  40. dheeraj.dang (verified owner)

    jnfam ma

  41. tom.thomas (verified owner)

    tks

  42. rasheed.shake (verified owner)

    good

  43. brown.charlie (verified owner)

    。

  44. arpita.kuntageri (verified owner)

    good

  45. Pranayasahu (verified owner)

    very good service

  46. chou_aib (verified owner)

    Great

  47. tung2310 (verified owner)

    good

  48. muhammad.rosyadi (verified owner)

    great

  49. ashishsoni (verified owner)

    NIce

  50. alaoui.alaoui (verified owner)

    good

  51. krisma.ziliwu (verified owner)

    how

  52. nandan.kumar (verified owner)

    N/a

  53. hashim almosawi (verified owner)

    thanks

  54. samoua.alsamoua (verified owner)

    Thank you very much

  55. akash.tureha (verified owner)

    Give code

  56. Kaushik5650 (verified owner)

    ok

  57. shivangi.panda (verified owner)

    nice

  58. shivangi.panda (verified owner)

    nice

  59. velan.s (verified owner)

    good

  60. raripi.das (verified owner)

    nice

  61. nguyen.minh luc (verified owner)

    nice

  62. nguyen.minh luc (verified owner)

    nice

  63. nguyen.minh luc (verified owner)

    nice

  64. nguyen.minh luc (verified owner)

    nice

  65. rania.hamami (verified owner)

    good

  66. aditi (verified owner)

    NICE

  67. saiteja.gurjala (verified owner)

    super

  68. melvin.monachan (verified owner)

    awesome

  69. ali.broumandnia (verified owner)

    thanks

Only logged in customers who have purchased this product may leave a review.