⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 image_stat.m

📁 基于图象的数据隐写和提取matlab代码
💻 M
字号:
%%This program works for 400X400 pictures and generates the statistics for%the power in the ones of a picture and the power of the ones of a picture%that has data hidden in it. The program is easily modified to handle%pictures of larger size. %%All the pictures and files used in the program are names pic1, pic2, etc%and file1, file2, etc.%%clear variables we will be usingclear hidden_power;clear pics;clear nothing_power;clear sizze%read in the pictures, here we are only going to look at two picturesfor i=1:2    [filename, err]=sprintf('pic%d.jpg', i);    pics(i,:,:)=imread(filename);end%Find average power in the one valued dct coefficients%in all the pictures. There are several ways to do this, we chose to look%at the power in the frequency domain. for i=1:2    sizze=size(pics(i,:,:));    ones=big_DCT_killer(reshape(pics(i,:,:),sizze(1,2),sizze(1,3),[])',1);    ones_image=invimageproc(ones);    ones_fft=fft(reshape(ones_image,1,[]));    nothing_power(i)=sum(abs(ones_fft).^2);endsave( 'pics_power', 'pics', 'nothing_power');display('saved pics!!');%now put the data files into the pictures and see what the new power%distribution looks like%read in the files, if the files have alread been read in this can be%omitted.%clear variable filesclear files;for i=1:2[filename, err]=sprintf('file%d', i);eval([filename '=readdata(filename)']);end%assumes the file read program has been runjcount=1;icount=1;for i=1:2    sizze=size(pics(i,:,:));            compressed=signed_mat2DCEB(reshape(pics(i,:,:),sizze(1,2),sizze(1,3),[]), 18);    for j=1:2        %file(i) is already a variable in MATLAB        %parse name of next file ('file'i) then set data equal to what is        %in that variable using the eval command        [filename, err]=sprintf('file%d', j);        eval(['data =' filename ';']);        %compress picture, hide data, get picture back out            hidden=signed_hide_zeros_stegcompress(compressed, data, 18);        image=invimageproc(read(hidden));        %keep only the DCT coefficients with magnitude 1 and find the power        hidden_ones=big_DCT_killer(image,1);        hidden_ones_image=invimageproc(hidden_ones);        hidden_ones_fft=fft(reshape(hidden_ones_image,1,[]));        hidden_power(count)=sum(abs(hidden_ones_fft).^2);        jcount=jcount+1    end    icount=icount+1endsave hidden_power hidden_power;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -