Вы находитесь на странице: 1из 18

EE608ATERMPAPER

DIGITALVIDEOWATERMARKING

Submittedby
RoopaLahariKalluri
14104136
krlahari@iitk.ac.in


AbstractIn this paper, we propose a new method that use side view video
preprocessingwithDWTSVDbasedwatermarkingscheme.Thisprocessingswitchthe
video referencesof the frames withdimensionsequivalentof thenumberofframeslike
width and the same height than the original video. The DWTSVD watermarking is
appliedinthisvideousingagrayscaleimageinsertedinY(luminance)oftheYUV.The
experimental results showed that method have success to make the watermark
imperceptible accordingtothe PSNRmetric androbust againstnoisesaddition,frames
attacksandMPEGcompression
.

I.INTRODUCTION:
The digital video is used in internet for many people to express their ideas,but these
medias can be access forany person and copied.To protect the data, people usedto
write or put some images to identify the owner of the digital object. Today, its easy to
useasoftwarethatremovethesevisibleinformation.Howeveriftheseinformationis
not visiblethe extraction process willbeimpossibleorsohardtoextractthatdontworth
it,thistechniqueiscalleddigitalwatermark.Thesemarksareinvisibleandhavetobe
robust against some attacks, this robustness dependsof the application.Therearetwo
major classes of video watermarking:spatial domain and frequency domain. The first
one modifies the least significant bit (LSB) of the pixels to insert the mark, but these
watermarks are fragile and dont resist against attacks like compression or signal
processing operations.The video watermarking canbeclassifiedintwoclasses:spatial
domain and frequency domain. Spatialdomainmodifiestheleastsignificantbit(LSB)of
the pixels to insertthemark,but these watermarksare fragileand donotresistagainst
attacks like compression or signal processing operations. The methods that use
frequencydomainembedthewatermarkinsidethespectrumoftheframes,tomakefirst
marked the least significant bit (LSB) and the second embed the watermark using a
strengthcoefficient.Inthispaperweproposedanewmethodthatembeddedaimage
watermark in video using a side view preprocessing, also take advantage DWT and
SVD. The paper is organized as follows. In Section II, we described sometheoretical
fundamentation. In Section III, we present the proposed method. The experimental
resultsarediscussedinSectionIVandSectionVistheconclusion.

II.THEORETICALFUNDAMENTATION:

A.DiscreteWaveletTransform:
The DWT provides a important tool for multiresolution decomposition for images or
frames. The wavelet can separated these objects in four subbands (LL, HL, LH and
HH) with the same bandwidth. This transform can be repeated on the subbands, this
schemegiveamultiplescaleperspectivelikethefollowingfigure:

The DWTbased watermarks embedded the mark in frequencies coefficients, the


selected subband can improve some watermark robustness [8]. If the watermark is
embedded in low frequencies (LL) that can provide some resistance against
compressionlikeJPEG orMPEG, howevermiddleandhighfrequencieschannelshave
robust against noises addiction and severaltypesof filter.On the other handthemain
advantageofwaveletsistheeasilyadaptationforhumanvisualsystem(HSV).

B.SingularValueDecomposition:
SVD has been used in watermarks methods for improving the robustness. This
techniquedecomposesamatrixinthreematrices:U,SandVaccordingtheequation

below:

T
A=USV

Where Ais theoriginal matrix, Sis a MxN diagonalmatrix oftheEigenvalues (


)ofA,
i
these diagonal values are also called the singular values. U and V are orthogonal
matrices MxM andNxNrespectively.U is the matrixthatthecolumnsarecalledtheleft
singular vectorsand theV columnsaretherightsingularvectorsofA.Inliteraturemost
papers use SVDbased watermarks insert in S matrix added some informationonthe
(
)coefficients,duetothehighstabilityofthesesingularvalues
i
ofSVD.
C.Peaksignaltonoiseratio(PSNR)
The PSNR is an objective metric that allows measuring distortions in an image,
comparing two images pixels. Salomon demonstrate that the typical PSNR range 20
and 40 for higher values of PSNRimply in a highcorrelation betweenthe images, but
dontprovide guarantee thatthe imagewillbeperfect.ThePSNRequationcanbewrite
as:

PSNR
(dB)=20log
(v
/MSE)
n
10
peak

Where the term peak is equivalent to 2k 1 , where k isderived from the numberof
bitsperpixelofthepeakoftheluminancecomponent.Themeansquareerror(MSE)
can assume values intherange. Thus, the qualityimproveswhenthe MSEis closeto
zero,thereforethevalueofPSNRtendstoincrease.

III.PROPOSEDMETHOD:
The video watermarking scheme of the proposed method is composed in stages that
makesomespecificallyprocessing.FromtheblockdiagramoftheFigure2weseethat
the video have to be preprocessed before the watermarking process, therefore this
stage is crucial to mark ablock of frames.Afterthat,aDWTSVD watermarkbased is
inserted in cover video. The watermark used for these experiments have a size of
120x30 pixels in grayscale and is embedding in a video with 120 frames, each one
havingasizeof640x480pixels.

A.Videopreprocessing
The preprocessing scheme changes the original video for side view. This new video
reference have the frame with dimensions NxH, this frame is the plane thatcompose
the entire side of the video. The figure 3 demonstrate howthevideo become the new
video reference. In step 1 is present the original video, step 2 is the video rotated on
NxW plane. In step 3 shows basically the step 2 video, but now the frames is
consideredtheplaneNxHandthenumberofframeisL.

B.Embedding
Theprocedureforembeddingthewatermarkisdescribedinfollowingsteps:
Step1.Preprocessthevideo.
Step2.ChangethevideoRGBtoYUV
Step3.ApplytheDWTonlyinYcomponentofthefirst
frameofthesizeview.
Step4.ApplyDWTonHL1subband.
Step5.ApplySVDforeachsubbandLL2,resultingin
matrices:Uy,Sy,Vy.Whereyistheluminance.

Step6.ApplySVDonwatermark,resultingUw,Swand
Vw.
Step7.Toembedthewatermarkisusedthefollowing
equation:

S
=S
+S
mark
y
w
WhereS
istheSmatrixmarkedandisthevisibilitycoefficient.
mark
Step8.Rebuildthesubbandsusingtheequation1.
Step9.Apply2levelsofinverseDWTtogetthewatermarked
frame.
Step10.ReturntoRGB.
Step11.Returnthevideofornormalview.

C.Extraction
Thismethodisnonblind,thereforeitsnecessarytohave
theoriginalvideoandthewatermarktoextraction.To
recoverythewatermarkwehavetomakesomestepslisted
below:
Step1.Usethepreprocessinwatermarkedvideoandin
theoriginalvideo.
Step2.ChangethevideosRGBtoYUV
Step2.ApplytheDWTforonlyinYcomponentofthe
firstframeofthesizeviewofthebothvideos.
Step3.ApplyDWTonHL1subband.
Step4.UseSVDinsubbandsLL2fortheoriginaland
watermarkedvideos.
Step5.Torecoverythewatermarkweusedtheequation
below:
S
=(S
S
)/
rec
w
yoriginal
WhereS
istheSmatrixoftheretrievedwatermark.
rec
Step6.Rebuildthewatermarkusing:

T
wm
=U
S
V
y
w
rec
w

IV.EXPERIMENTALRESULTS:


V.MATLABCODE:
clc
clearall
%Readvideo
obj=VideoReader('video.avi')
%Gettheinformationofthevideo
get(obj)
numFrames=obj.NumberOfFrames
n=numFrames
fori=1:1:n
frames=read(obj,i)
imwrite(frames,['Image'int2str(i),'.jpg'])
im(i)=image(frames)
mov(:,:,:,i)=imread(strcat('Image',num2str(i),'.jpg'))
end
mod=permute(mov,[4132])
img1=mod(:,:,:,1)
figureimshow(img1)
title('Firstframeofsideviewvideo')
img2=rgb2yuv(img1,1)
%YUVImage
figureimshow(img2)
title('YUVconvertedframe')
imgy=img2(:,:,1)
imgu=img2(:,:,2)
imgv=img2(:,:,3)
imgx=im2double(imgy)
[LL1,LH1,HL1,HH1]=dwt2(imgx,'haar')
sx1=size(imgx)
[LL2,LH2,HL2,HH2]=dwt2(HL1,'haar')
sx2=size(HL1)
[U1,S1,V1]=svd(LL2)

U1padded=padarray(U1,[11],0,'post')
%U1padded2=padarray(U1padded,[3535],0,'post')
imgd=imread('newimg.jpg')
img4=rgb2gray(imgd)
figureimshow(img4)
title('Watermarkimage')
imy=im2double(img4)
[U2,S2,V2]=svd(imy)
U2padded=padarray(U1,[11],0,'post')
S1padded=padarray(S1,[10],0,'post')
S2padded=padarray(S2,[11],0,'post')
V2padded=padarray(V2,[11],0,'post')
%S1padded2=padarray(S1padded,[3534],0,'post')
S3=0.01.*S2padded
So=S3+S1padded
V1padded=padarray(V1,[00],0,'post')
%V1padded2=padarray(V1padded,[3434],0,'post')
B=transpose(V1padded)
finalimg=(U1padded*So*B)
img5=idwt2(finalimg,LH2,HL2,HH2,'haar',sx2)
img6=idwt2(LL1,LH1,img5,HH1,'haar',sx1)
%WatermarkedYcomponentfirstframe
figureimshow(img6,[])
title('Ycomponentofwatermarkedframe')
%WatermarkedYUVimageoffirstframe
img7=cat(3,uint8(img6),imgu,imgv)
figureimshow(img7)
title('yuvoffirstframewatermarked')
img8=yuv2rgb(img7)
%WatermarkedRGBframe
figureimshow(img8)
title('watermarkedimage')
img8=mod(:,:,:,1)

mov1=permute(mod,[2431])
%implay(mov1)

%%%Extractionofwatermark
%preprocesswatermarkvideo:
mod1=permute(mov1,[4132])
%implay(mod1)
img9=mod1(:,:,:,1)
%figureimshow(img9)
img10=rgb2yuv(img9,1)
%figureimshow(img10)
img13=img10(:,:,1)
%preprocessoriginalvideo:
%implay(mod)
img11=mod(:,:,:,1)
imshow(img11)
img12=rgb2yuv(img11,1)
%figureimshow(img12)
img14=img12(:,:,1)
%applydwtonwatermarkedvideoframe:
img20=im2double(img13)
[LLe1,LHe1,HLe1,HHe1]=dwt2(img20,'haar')
sxe1=size(img20)
[LLe2,LHe2,HLe2,HHe2]=dwt2(HLe1,'haar')
sxe2=size(HLe1)
[Ue1,Se1,Ve1]=svd(LLe2)
Se1padded=padarray(Se1,[10],0,'post')
Srec=(Se1S1)/0.01
C=transpose(V2)
reconst=(U2*Srec*C)
figureimshow(reconst)
title('extractedwatermarkimage')

implay(mod)

%%addingnoise
img_noise1=imnoise(img6,'gaussian',0,0.01)%gaussiannoise
img21=im2double(img_noise1)
[LLg1,LHg1,HLg1,HHg1]=dwt2(img_noise1,'haar')
sxe1=size(img_noise1)
[LLg2,LHg2,HLg2,HHg2]=dwt2(HLg1,'haar')
sxe2=size(HLg1)
[Ug1,Sg1,Vg1]=svd(LLg2)
Sg1padded=padarray(Sg1,[10],0,'post')
Srec1=(Sg1S1)/0.01
C=transpose(V2)
reconst1=(U2*Srec1*C)
figureimshow(reconst1)
title('extractedwatermarkimageaftergaussiannoiseattack')

img_noise2=imnoise(img7,'salt&pepper',0.01)
img22=im2double(img_noise2)
img23=rgb2gray(img22)
[LLs1,LHs1,HLs1,HHs1]=dwt2(img23,'haar')
sxe1=size(img23)
[LLs2,LHs2,HLs2,HHs2]=dwt2(HLs1,'haar')
sxe2=size(HLs1)
[Us1,Ss1,Vs1]=svd(LLs2)
Ss1padded=padarray(Ss1,[10],0,'post')
Srec2=(Ss1paddedS1)/0.01
C=transpose(V2)
reconst2=(U2*Srec2*C)
figureimshow(reconst2)
title('extractedwatermarkimageaftersalt&peppernoiseattack')

MATLABCodeforfunctions:

rgb2yuv:
functionYUV=rgb2yuv(RGB,plot_flag)

R=RGB(:,:,1)
G=RGB(:,:,2)
B=RGB(:,:,3)

%ConversionFormula
Y=0.299*R+0.587*G+0.114*B
U=1280.168736*R0.331264*G+0.5*B
V=128+0.5*R0.418688*G0.081312*B

if(plot_flag==1)%plotfigures
figure()
subplot(1,3,1)imshow(Y)title('Y')
subplot(1,3,2)imshow(U)title('U')
subplot(1,3,3)imshow(V)title('V')
end

YUV=cat(3,Y,U,V)

end

2.yuv2rgb:
%convertsyuvdatatorgb

functiondst=yuv2rgb(src)

%ensurethisrunswithyuvimagesaswellasyuvtriples
if(length(size(src))>2)

%yuvimage([y][u][v])
y=double(src(:,:,1))
u=double(src(:,:,2))
v=double(src(:,:,3))

elseif(length(src)==3)

%yuvtriplet([y,u,v])
y=double(src(1))
u=double(src(2))
v=double(src(3))

else

%unknowninputformat
error('yuv2rgb:unknowninputformat')

end

%convert...
u=2*u256
v=2*v256

r=y+v

g=floor(y0.51*v0.19*u)
b=y+u

%ensurevalidrangeforuint8values
r(r>255)=255
r(r<0)=0
g(g>255)=255
g(g<0)=0
b(b>255)=255
b(b<0)=0

%generateoutput
if(length(size(src))>2)

%rgbimage([r][g][b])
dst(:,:,1)=uint8(r)
dst(:,:,2)=uint8(g)
dst(:,:,3)=uint8(b)

else

%rgbtriplet([r,g,b])
dst=uint8([r,g,b])

end

Вам также может понравиться