Skip to content
Snippets Groups Projects
Commit 32e5370b authored by Taburet Théo's avatar Taburet Théo
Browse files

Add pseudo embedding in spatial domain, remove README.html

parent 70816e48
Branches
No related tags found
No related merge requests found
No preview for this file type
This diff is collapsed.
No preview for this file type
No preview for this file type
......@@ -162,6 +162,33 @@ class Sampler():
self.stego = raw_to_dct(raw_stego)[:, :, 0] #Luminance only
return self.stego
def Embedding_pseudo_spatial(self):
nb_bits = 14
lvl_max = 2**nb_bits-1
im_cover = self.raw_cover.raw_image
raw_stego = self.raw_cover
h, w = self.cover.shape
im_stego = np.zeros((h, w))
var_stego_signal = im_cover[:, :]*self.a+self.b
var_stego_signal[var_stego_signal<0]=0
sens_noise = np.random.randn(h, w)*np.sqrt(var_stego_signal)
im_stego[:,:] = im_cover[:, :] + sens_noise
# Wet pixels
im_stego[im_stego>lvl_max]=lvl_max
im_stego[im_stego<0]=0
im_stego[im_cover==lvl_max]=lvl_max
im_stego[im_cover==0]=0
raw_stego.raw_image[:, :] = im_stego[:, :]
self.stego = raw_to_ycbcr(raw_stego)[:, :, 0] #Luminance only
return self.stego
def Embedding_intra_only(self):
np.random.seed(self.seed) #Feed the RNG
......
No preview for this file type
......@@ -98,6 +98,12 @@ def raw_to_dct(raw):
compute_dct_domain(ycbcr[:, :, 2])
return np.dstack((dct_Y, dct_Cb, dct_Cr))
def raw_to_ycbcr(raw):
rgb = raw.postprocess(params)
ycbcr = toYCbCr(rgb)
return ycbcr
def compute_dct_domain(im_pix):
"""
Convert the image into DCT coefficients without performing quantization
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment