资源简介
Image Steganograpy using Pixel-Value Differencing
代码片段和文件信息
clc;
close all;
clear;
%%%%%%%%%%%%%%%%%%%%%%% Reading a Secret Text File %%%%%%%%%%%%%%%%%%%%%%%%
file_id = fopen(‘message.txt‘‘r‘);
file_content = fread(file_id);
file_length = length(file_content);
in = [];
in = [in dec2bin(file_length20)]; %character to binary conversion
for i=1:file_length
in=[in dec2bin(file_content(i)7)];
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%% Reading Cover Image %%%%%%%%%%%%%%%%%%%%%%%%%%%
cover_image = imread(‘cover_image.bmp‘); %get cover image
red = cover_image(::1); %seperating rgb values
blue = cover_image(::2);
green = cover_image(::3);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% embedding Data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
color = red; %red color selected for embedding
[rc] = size(color);
final = double(color);
next=0;
capacity=0; %total no of bits that can be embedded
for x=0:1:r-1
for y=0:2:c-1
enable = 1; %enable=0 when new pixels may fall off the boundary
p = color(1+x1+y:2+y); %block of two pixels pi & pi+1
p = double(p);
d = p(12) - p(11); %d = difference between 2 pixel
d_abs = abs(d); %absolute difference
lb=[0 8 16 32 64 128]; %lowerbound
ub=[7 15 31 63 127 255]; %upperbound
for i=1:1:6 %test the R boundary
if((d_abs >= lb(i)) && (d_abs <= ub(i))) %selecting range
%check if any pixel in a block fall off the boundary [0255]
even2 = mod(d2);
m2 = ub(i) - d;
if (even2 == 0)
Pcheck=[p(11)-floor(m2/2) p(12)+ceil(m2/2)];
else
Pcheck=[p(11)-ceil(m2/2) p(12)+floor(m2/2)];
end
if(Pcheck(1)<0 || Pcheck(2)<0 || Pcheck(1)>255 || Pcheck(2)>255)
enable = 0;
break
end
n = ub(i)-lb(i)+1; %quantization width of range
t = floor(log2(n)); %maximum bit can be embedded in 2 pixels
capacity=capacity+t; %max capacity of the cover image
%check if next exceeds the length of message
if(next>length(in))
m=0;
%check if next+t exceeds the length of message
elseif(next+t>length(in))
if(1+next>=length(in))
k=zeros(1t);
else
k=in(1+next:length(in));
end
diff =next+t-length(in);
k1=zeros(1t);
if(diff>0)
for j=1:next+t-length(in)
k1(j)=k(j);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 786486 2012-05-12 18:09 Image_Steg\cover_image.bmp
文件 12342 2012-05-09 23:43 Image_Steg\cover_image2.bmp
文件 4951 2012-05-27 16:40 Image_Steg\data_em
文件 2743 2012-05-27 21:24 Image_Steg\data_extraction.m
文件 2735 2012-05-27 01:27 Image_Steg\histogram_analysis.m
文件 4757 2012-05-27 18:15 Image_Steg\message.txt
文件 923 2012-05-27 16:31 Image_Steg\psnr.m
文件 897 2012-05-27 18:13 Image_Steg\Read Me Please!.txt
目录 0 2012-10-10 13:30 Image_Steg
----------- --------- ---------- ----- ----
815834 9
- 上一篇:PSO Toolbox
- 下一篇:pso algorithms 粒子群算法
相关资源
- 基于Matlab的最大熵模糊图像复原算法
- KITTI雷达点云与图像数据融合matlab源码
- matlab 解码 NMEA0183格式GGA数据
- 一个有关飞机的模板匹配的跟踪的m
- 基于MATLAB的电弧模型仿真
- PRI信号分选
- Matlab论文:基于Matlab的二进制数字调
- 802.11协议吞吐量随节点数性能仿真
- matlab图片rgb转yuv,存.yuv文件 播放器
- Duda模式分类Pattern Classification MATLAB 代
- dijkstra算法的matlab实现31274
- 随机路径生成函数matlab
- matlab语音信号处理工具箱
- matlab2013激活文件
- matlab实现游程编码
- 暗通道先验+引导滤波MATLAB代码
- 边缘检测中的canny算法及其matlab实现
- 通过达曼光栅生成点阵的matlab程序.
- MATLAB核函数算法
- 求控制系统的性能指标MptrtsFAI,matl
- matlab 求DTFT
- 逆变器重复控制算法MATLAB仿真
- MATLAB R2014b 许可协议文件
- matlab读取comtrade格式的程序
- 基于Matlab的RC一阶电路仿真
- Las点云数据读取代码
- 雷达回波加天线方向图模拟程序
- MATLAB 2017b 安装文件及其破解文件百度
- Matlab实现音频降噪
- matlab实现导航卫星系统中计算多普勒
评论
共有 条评论