【RDH隐藏】基于减少直方图移位中像素的无效移位的可逆数据隐藏附matlab代码

您所在的位置:网站首页 matlab循环移位运算 【RDH隐藏】基于减少直方图移位中像素的无效移位的可逆数据隐藏附matlab代码

【RDH隐藏】基于减少直方图移位中像素的无效移位的可逆数据隐藏附matlab代码

2023-04-22 04:41| 来源: 网络整理| 查看: 265

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信      无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机

⛄ 内容介绍

近年来,可逆信息隐藏(RDH)是信息安全领域的一个新研究热点,受到了研究人员的越来越多的关注。现有的大多数RDH方案都没有完全考虑到自然图像的纹理会影响嵌入失真。将数据嵌入图像的平滑区域所导致的图像失真要比不平滑区域小得多,这主要是因为在平滑区域中嵌入其他数据对应于直方图移位中的无效移位像素(ISP)更少。因此,我们提出了一种基于图像纹理的RDH方案,以减少直方图移位中像素的无效移位。具体来说,首先,通过棋盘格图案将封面图像分为两个子图像,然后计算每个子图像的波动值。最后,可以将附加数据优先地嵌入到具有较小波动值的子图像区域中。实验结果表明,与现有的一些RDH方案相比,该方法具有更高的容量和更好的隐秘图像质量。

⛄ 部分代码

function varargout = arith07(xC)

% Arith07     Arithmetic encoder or decoder 

% Vectors of integers are arithmetic encoded, 

% these vectors are collected in a cell array, xC.

% If first argument is a cell array the function do encoding,

% else decoding is done.

%

% [y, Res] = Arith07(xC);                    % encoding

% y = Arith07(xC);                           % encoding

% xC = Arith07(y);                           % decoding

% ------------------------------------------------------------------

% Arguments:

%  y        a column vector of non-negative integers (bytes) representing 

%           the code, 0 1

%   8     all symbols are equal, L>1, x(1)=x(2)=...=x(L)=0/1

%  10     all symbols are equal, L>1, x(1)=x(2)=...=x(L)0

      PutBit(~bitget(low,K-1));

      ub=ub-1;

   end

   % flush is finished

   y=y(1:Byte);   

   varargout(1) = {y};

   if (nargout >= 2) 

      % now calculate results for the total

      Res(NumOfX+1,1)=Ltot;

      Res(NumOfX+1,2)=0;

      Res(NumOfX+1,3)=Byte*8;

      if (Ltot>0); Res(NumOfX+1,4)=Byte*8/Ltot; else Res(NumOfX+1,4)=Byte*8; end;

      varargout(2) = {Res}; 

   end

end         % if Encode

if Decode

   for k=1:K

      code=code*2;

      code=code+GetBit;   % read bits into code

   end

   NumOfX=GetVLIC;   % first read number of sequences

   xC=cell(NumOfX,1);

   for num=1:NumOfX

      % find what kind of sequenqe we have, xType, stored first in sequence

      xType=GetS(TypeS,TypeC);

      % now decode the different kind of sequences, each the way it was stored 

      if (xType==0)       % empty sequence, no more symbols coded

         x=[];

      elseif (xType==1)       % one symbol and x=x(1)>1

         x=GetVLIC+2;

      elseif (xType==2)   % L>1 but only one symbol, x(1)=x(2)=...=x(L)>1

         L=GetVLIC+2;

         x=ones(L,1)*(GetVLIC+2);

      elseif sum(xType==[3,4,5,6])  % now 'normalized' sequences: 0 x1+x2:      lengths are ',int2str(L1),'+',int2str(L2),...

               '  bits are ',num2str(b11,'%6.0f'),'+',num2str(b12,'%6.0f'),...

               '.  Total is ',num2str(b1,'%6.0f'),' bits.']);

      end

   else

      b1=b0+1;      % just to make this larger

   end

   if (L31>3) & ((L-L31)>3) 

      % try to split x3 into x4 and x5, depending on previous symbol

      if L31



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3