隐写分析RS算法

1.RS算法主函数%%% Shuan % shuanholmes@outlook.com% Copyright@2016-2017 Shuan BUPT IS% RSUmain%%clc;clear;%%% Fig = imread('LenaGray.bmp');Fig = imread('128pic_50%.bmp');[x,y] = size(Fig);Type
摘要由CSDN通过智能技术生成

1.RS算法主函数

%%
% Shuan 
% shuanholmes@outlook.com
% <strong><span style="font-family:KaiTi_GB2312;font-size:14px;">Copyright@2016-2017 Shuan BUPT IS</span></strong>
% RSUmain
%%
clc;
clear;
%%
% Fig = imread('LenaGray.bmp');
Fig = imread('128pic_50%.bmp');
[x,y] = size(Fig);
Type1 = 2; % BlockSize
Type2 = 1; % 1:Row first 2:Col first 3:ZigZag
[Rm,Sm,Um,R1m,S1m,U1m] = RSU(Fig,x*y,Type1,Type2);
ComFig = bitxor(double(Fig),ones(x,y));
[CRm,CSm,CUm,CR1m,CS1m,CU1m] = RSU(ComFig,x*y,Type1,Type2);
d0 = Rm - Sm;
d1 = CRm - CSm;
d10 = R1m - S1m;
d11 = CR1m - CS1m;
a = 2*(d0 + d1);
b = d10 - d11 - d1 - 3*d0;
c = d0 - d10;
root = [a,b,c];
solutions = roots(root);
if abs(solutions(1)) > abs(solutions(2))
    fprintf('Steganography Rate : %.5f\n',solutions(2)/(solutions(2)-1/2));
else
    fprintf('Steganography Rate : %.5f\n',solutions(1)/(solutions(1)-1/2));
end

2.RS函数

%%
% Shuan 
% shuanholmes@outlook.com
%
% Regula, Singular points calc
%%
function [R,S,U,R1,S1,U1] = RSU(A,bufsize,Type1,Type2)
R
  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值