video report

18
EE 608A TERM PAPER DIGITAL VIDEO WATERMARKING Submitted by Roopa Lahari Kalluri 14104136 [email protected]

Upload: roopa-lahari

Post on 29-Sep-2015

212 views

Category:

Documents


0 download

DESCRIPTION

video watermarking

TRANSCRIPT

  • EE608ATERMPAPER

    DIGITALVIDEOWATERMARKING

    SubmittedbyRoopaLahariKalluri

    [email protected]

  • AbstractIn this paper, we propose a new method that use side view video preprocessing with DWTSVD based watermarking scheme. This processing switch the video references of the frames with dimensions equivalent of the number of frames like width and the same height than the original video. The DWTSVD watermarking is appliedinthisvideousingagrayscaleimageinsertedinY(luminance)oftheYUV.Theexperimental results showed that method have success to make the watermark imperceptible according to the PSNR metric and robust against noises addition, frames attacksandMPEGcompression.I.INTRODUCTION:The digital video is used in internet for many people to express their ideas, but these medias can be access for any person and copied. To protect the data, people used to write or put some images to identify the owner of the digital object. Today, its easy to useasoftwarethatremovethesevisibleinformation.Howeveriftheseinformationisnot visible the extraction process will be impossible or so hard to extract that dont worth it,thistechniqueiscalleddigitalwatermark.Thesemarksareinvisibleandhavetoberobust against some attacks, this robustness depends of the application. There are two 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 can be classified in two classes: spatial domain and frequency domain. Spatial domain modifies the least significant bit (LSB) of the pixels to insert the mark, but these watermarks are fragile and do not resist against attacks like compression or signal processing operations. The methods that use frequency domain embed the watermark inside the spectrum of the frames, to make first marked the least significant bit (LSB) and the second embed the watermark using a strengthcoefficient.Inthispaperweproposedanewmethodthatembeddedaimagewatermark in video using a side view preprocessing, also take advantage DWT and SVD. The paper is organized as follows. In Section II, we described some theoretical 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 compression like JPEG or MPEG, however middle and high frequencies channels have robust against noises addiction and several types of filter. On the other hand the main advantageofwaveletsistheeasilyadaptationforhumanvisualsystem(HSV).B.SingularValueDecomposition:SVD has been used in watermarks methods for improving the robustness. This techniquedecomposesamatrixinthreematrices:U,SandVaccordingtheequation

  • below: A=USVT

    Where A is the original matrix, S is a MxN diagonal matrix of the Eigenvalues (i) of A, these diagonal values are also called the singular values. U and V are orthogonal matrices MxM and NxN respectively. U is the matrix that the columns are called the left singular vectors and the V columns are the right singular vectors of A. In literature most papers use SVDbased watermarks insert in S matrix added some information on the (i)coefficients,duetothehighstabilityofthesesingularvaluesofSVD.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 PSNR imply in a high correlation between the images, but dont provide guarantee that the image will be perfect. The PSNR equation can be write as:

    PSNRn(dB)=20log10(vpeak/MSE)

    Where the term peak is equivalent to 2k 1 , where k is derived from the number of bitsperpixelofthepeakoftheluminancecomponent.Themeansquareerror(MSE)can assume values in the range. Thus, the quality improves when the MSE is close to zero,thereforethevalueofPSNRtendstoincrease.III.PROPOSEDMETHOD:The video watermarking scheme of the proposed method is composed in stages that makesomespecificallyprocessing.FromtheblockdiagramoftheFigure2weseethatthe video have to be preprocessed before the watermarking process, therefore this stage is crucial to mark a block of frames. After that, a DWTSVD watermark based 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.VideopreprocessingThe preprocessing scheme changes the original video for side view. This new video reference have the frame with dimensions NxH, this frame is the plane that compose the entire side of the video. The figure 3 demonstrate how the video 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.EmbeddingTheprocedureforembeddingthewatermarkisdescribedinfollowingsteps:Step1.Preprocessthevideo.Step2.ChangethevideoRGBtoYUVStep3.ApplytheDWTonlyinYcomponentofthefirstframeofthesizeview.Step4.ApplyDWTonHL1subband.Step5.ApplySVDforeachsubbandLL2,resultinginmatrices:Uy,Sy,Vy.Whereyistheluminance.

  • Step6.ApplySVDonwatermark,resultingUw,SwandVw.Step7.Toembedthewatermarkisusedthefollowingequation:

    Smark=Sy+SwWhereSmarkistheSmatrixmarkedandisthevisibilitycoefficient.Step8.Rebuildthesubbandsusingtheequation1.Step9.Apply2levelsofinverseDWTtogetthewatermarkedframe.Step10.ReturntoRGB.Step11.Returnthevideofornormalview.C.ExtractionThismethodisnonblind,thereforeitsnecessarytohavetheoriginalvideoandthewatermarktoextraction.Torecoverythewatermarkwehavetomakesomestepslistedbelow:Step1.Usethepreprocessinwatermarkedvideoandintheoriginalvideo.Step2.ChangethevideosRGBtoYUVStep2.ApplytheDWTforonlyinYcomponentofthefirstframeofthesizeviewofthebothvideos.Step3.ApplyDWTonHL1subband.Step4.UseSVDinsubbandsLL2fortheoriginalandwatermarkedvideos.Step5.Torecoverythewatermarkweusedtheequationbelow:

    Srec=(SwSyoriginal)/WhereSrecistheSmatrixoftheretrievedwatermark.Step6.Rebuildthewatermarkusing:

    wmy=UwSrecVwT

  • IV.EXPERIMENTALRESULTS:

  • V.MATLABCODE:clcclearall%Readvideoobj=VideoReader('video.avi')%Gettheinformationofthevideoget(obj)numFrames=obj.NumberOfFramesn=numFramesfori=1:1:nframes=read(obj,i)imwrite(frames,['Image'int2str(i),'.jpg'])im(i)=image(frames)mov(:,:,:,i)=imread(strcat('Image',num2str(i),'.jpg'))endmod=permute(mov,[4132])img1=mod(:,:,:,1)figureimshow(img1)title('Firstframeofsideviewvideo')img2=rgb2yuv(img1,1)%YUVImagefigureimshow(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.*S2paddedSo=S3+S1paddedV1padded=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)%WatermarkedYcomponentfirstframefigureimshow(img6,[])title('Ycomponentofwatermarkedframe')%WatermarkedYUVimageoffirstframeimg7=cat(3,uint8(img6),imgu,imgv)figureimshow(img7)title('yuvoffirstframewatermarked')img8=yuv2rgb(img7)%WatermarkedRGBframefigureimshow(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.01C=transpose(V2)reconst=(U2*Srec*C)figureimshow(reconst)title('extractedwatermarkimage')

  • implay(mod)%%addingnoiseimg_noise1=imnoise(img6,'gaussian',0,0.01)%gaussiannoiseimg21=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.01C=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.01C=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)%ConversionFormulaY=0.299*R+0.587*G+0.114*BU=1280.168736*R0.331264*G+0.5*BV=128+0.5*R0.418688*G0.081312*Bif(plot_flag==1)%plotfiguresfigure()subplot(1,3,1)imshow(Y)title('Y')subplot(1,3,2)imshow(U)title('U')subplot(1,3,3)imshow(V)title('V')endYUV=cat(3,Y,U,V)end

  • 2.yuv2rgb:%convertsyuvdatatorgbfunctiondst=yuv2rgb(src)%ensurethisrunswithyuvimagesaswellasyuvtriplesif(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 %unknowninputformaterror('yuv2rgb:unknowninputformat') end %convert...u=2*u256v=2*v256r=y+v

  • g=floor(y0.51*v0.19*u)b=y+u%ensurevalidrangeforuint8valuesr(r>255)=255r(r255)=255g(g255)=255b(b2) %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