Skip to content

Frequency Methods

Qingquan(Q.Q.) Wang edited this page Feb 1, 2021 · 4 revisions

Supported Algorithms:

  • dwtDct: DWT + DCT
  • dwtDctSvd: DWT + DCT + SVD

The method conducts embedding in frequency space with DWT + DCT transform. This method runs fast and can be used for tracking the upload user. At the same time, it is sensitive to image size change.

Below is the test result and method process of DWT + DCT method. As for DWT + DCT + SVD method, the test result is almost same with this method, but it runs slower due to svd decomposition.

Test Result

This method shows it is not robust to size or aspect ratio change but robust to noise, color filter, brightness and jpg compress. For better doc reading, we compress all images in this page, but the test is taken for 1920x1080 original image.

  • Input Image: 1960x1080 Image
  • Watermark: 64bits, string expression "qingquan"
  • Encode Time: 350ms
  • Decode Time: 150-200ms
  • Parameters: only take U frame to keep image quality, scale=36

Watermarked Image

wm

Attacks Image Result
JPG Compress wm_jpg Pass
Noise wm_noise Pass
Brightness wm_darken Pass
Overlay wm_overlay Pass
Mask wm_mask_large Pass
crop 7x5 wm_crop_7x5 Fail
Resize 50% wm_resize_half Fail
Rotate 30 degress wm_rotate Fail

Encode Process

Input

 - BGR Image: bgr = matrix width x height x 3
 - watermark bits list: wm = [0,1,...]
 - watermark bits length: wmLen = 32

Process

  1. Convert BGR color space to YUV space
  2. Take U frame, compute haar DWT transform. ca1, (h1,v1,d1) <- 2 dimension dwt(Uframe)
  3. split ca1 into 4x4 blocks
  4. For each block (b,n), b is 4x4 block, n means the n-th block. compute DCT transform, coefficients = dct(b)
  5. Embed wmbit = wm[n % wmLen] into max non-trivial coefficient as below
(p,q) <- max(abs(coefficient[i][j]), i+j > 0)
if wmBit == 1 then: coef[p][q] = (coef[p][q]//scale + 0.75) * scale
else: coef[p][q] = (coef[p][q]//scale + 0.25) * scale
  1. for each block, reverse DCT
  2. reverse DWT
  3. change YUV to BGR space

Decode Process

Input

 - BGR Image: bgr = matrix width x height x 3
 - watermark bits length: wmLen = 32

Process

  1. Convert BGR color space to YUV space
  2. Take U frame, compute haar DWT transform. ca1, (h1,v1,d1) <- 2 dimension dwt(Uframe)
  3. split ca1 into 4x4 blocks
  4. For each block (b,n), b is 4x4 block, n means the n-th block. compute DCT transform, coefficients = dct(b)
  5. Decode wmbit = wm[n % wmLen] from max non-trivial coefficient as below
(p,q) <- max(abs(coefficients[i][j]), i+j > 0)
if coef[p][q] % scale > 0.5 * scale then: wmbit = 1
else: wmbit = 0
  1. calculate all watermark bits. Probably we decode the same bit from different blocks, we use avg > 0.5 to decide the final watermark bit
Clone this wiki locally