美文网首页
LSB密写分析-GPC分析

LSB密写分析-GPC分析

作者: 科科Cole | 来源:发表于2020-07-18 11:01 被阅读0次

实现如下:

image='ste_cover.bmp';
ste_cover=imread(image);
[row,col]=size(ste_cover);

%计算穿过平面簇p0_num,p1_num总次数。
p0_num=0;
p1_num=0;
min_num=0;
max_num=0;
temp0=0;
temp1=0;
for i=1:row
    for j=1:col
        if((i<row)&&(j<col))
            %计算行方向的值
            min_num=min(ste_cover(i,j),ste_cover(i,j+1));
            max_num=max(ste_cover(i,j),ste_cover(i,j+1));
            %判断更小的值是奇数还是偶数
            if(mod(min_num,2)==0) 
                %为奇数时
                %计算p0_num
                temp0=min_num+1.5;
                while temp0<max_num
                    p0_num=p0_num+1;
                    temp0=temp0+2;
                end
                %计算p1_num
                temp1=min_num+0.5;
                while temp1<max_num
                    p1_num=p1_num+1;
                    temp1=temp1+2;
                end
            else
                %为偶数时
                temp0=min_num+0.5;
                while temp0<max_num
                    p0_num=p0_num+1;
                    temp0=temp0+2;
                end
                %计算p1_num
                temp1=min_num+1.5;
                while temp1<max_num
                    p1_num=p1_num+1;
                    temp1=temp1+2;
                end
            end
            %计算列方向的值
            min_num=min(ste_cover(i,j),ste_cover(i+1,j));
            max_num=max(ste_cover(i,j),ste_cover(i+1,j));
            %判断更小的值是奇数还是偶数
            if(mod(min_num,2)==0) 
                %为奇数时
                %计算p0_num
                temp0=min_num+1.5;
                while temp0<max_num
                    p0_num=p0_num+1;
                    temp0=temp0+2;
                end
                %计算p1_num
                temp1=min_num+0.5;
                while temp1<max_num
                    p1_num=p1_num+1;
                    temp1=temp1+2;
                end
            else
                %为偶数时
                %计算p0_num
                temp0=min_num+0.5;
                while temp0<max_num
                    p0_num=p0_num+1;
                    temp0=temp0+2;
                end
                %计算p1_num
                temp1=min_num+1.5;
                while temp1<max_num
                    p1_num=p1_num+1;
                    temp1=temp1+2;
                end
            end   
        else 
            if((j==col)&&(i<row))  
                %计算列方向的值
                min_num=min(ste_cover(i,j),ste_cover(i+1,j));
                max_num=max(ste_cover(i,j),ste_cover(i+1,j));
                %判断更小的值是奇数还是偶数
                if(mod(min_num,2)==0) 
                    %为奇数时
                    %计算p0_num
                    temp0=min_num+1.5;
                    while temp0<max_num
                        p0_num=p0_num+1;
                        temp0=temp0+2;
                    end
                    %计算p1_num
                    temp1=min_num+0.5;
                    while temp1<max_num
                        p1_num=p1_num+1;
                        temp1=temp1+2;
                    end
                else
                    %偶数的时候干的活
                    %计算p0_num
                    temp0=min_num+0.5;
                    while temp0<max_num
                        p0_num=p0_num+1;
                        temp0=temp0+2;
                    end
                    %计算p1_num
                    temp1=min_num+1.5;
                    while temp1<max_num
                        p1_num=p1_num+1;
                        temp1=temp1+2;
                    end
                end   
            end
            if((i==row)&&(j<col))
                %计算行方向的值
                min_num=min(ste_cover(i,j),ste_cover(i,j+1));
                max_num=max(ste_cover(i,j),ste_cover(i,j+1));
                %判断更小的值是奇数还是偶数
                if(mod(min_num,2)==0) 
                    %为奇数时
                    %计算p0_num
                    temp0=min_num+1.5;
                    while temp0<max_num
                        p0_num=p0_num+1;
                        temp0=temp0+2;
                    end
                    %计算p1_num
                    temp1=min_num+0.5;
                    while temp1<max_num
                        p1_num=p1_num+1;
                        temp1=temp1+2;
                    end
                else
                    %为偶数时
                    temp0=min_num+0.5;
                    while temp0<max_num
                        p0_num=p0_num+1;
                        temp0=temp0+2;
                    end
                    %计算p1_num
                    temp1=min_num+1.5;
                    while temp1<max_num
                        p1_num=p1_num+1;
                        temp1=temp1+2;
                    end
                end 
            end 
        end  
    end
end

R=p1_num/p0_num;
fprintf('R=%f\n',R);

相关文章

  • LSB密写分析-GPC分析

    实现如下:

  • LSB密写分析-RS分析

    卡方分析及信息量估计法利用图像直方图特性分析,RS分析与GPC分析利用图像空间相关性进行分析。RS分析,简单来说,...

  • LSB密写分析-卡方分析

    使用卡方(χ2)特性进行的密写分析。原理是一堆数学证明,网上有,不再赘述。简单来说,就是由图像左上角开始逐步扩大计...

  • LSB密写

    LSB密写是较简单且容易实现的一种。我们知道图像的灰度值在0到255的范围内,0表示白色,255表示黑色。灰度值是...

  • LSB密写分析-信息量估计法

    信息量估计法的实现,简单说,先计算原图像F1,F2判断是否经过密写,再二次密写,在不同密写率下计算不同的F1,F2...

  • 数字密写与密写分析

    数字密写即利用文件的冗余部分隐藏信息。大致方法为用秘密信息替换文件的冗余部分,并保持原文件的一部分特性不改变,即,...

  • JPEG图像

    算是阅读隐写学原理与技术做的笔记 LSBR替换 LSBR容易产生值对效应 LSB隐写代码: 分析代码我们可以看出,...

  • 升级 python 后 pip 无法运行问题

    分析 原因是找不到 lsb_release 模块 解决 找到 lsb_release 模块所在的目录,将其复制到设...

  • 隐写术

    常用工具 1.binwalk2.stegsolve(查找LSB隐藏痕迹)3.linux自带命令:file(分析文件...

  • 代换密码的密码分析—详细分析过程

    代换密码的密码分析 使用单表代换密码,对于给出的密文进行分析并得到结果,了解加密解密过程 密文信息如下:AHNFC...

网友评论

      本文标题:LSB密写分析-GPC分析

      本文链接:https://www.haomeiwen.com/subject/wuqvghtx.html