bpcs隐写术-mat2cell函数

时间:2014-06-05 06:59:10

标签: matlab embedding steganography

% lena -grayscale 512*512 size

a=imread('lena.png')
[c1 c2 c3 c4 c5 c6 c7 c8]=bitplane(a);
% taking lsb bitplane only
C{1} = c1;
curr_plane = C{1};
row = size(cover, 1)/8;
col = size(cover, 2)/8;

% divid it into 8*8 blocks
blocks = mat2cell(curr_plane, ones(1, row)*8, ones(1, col)*8);

for bi = 1,size(blocks,1)
for bj = 1,size(blocks,2)
    % for each block in curr_plane image , now identify the complex block
    % and replace it with secret blocks first and  then followed by conjugate
    % blocks until all information finally embedded
    my_8x8_block = blocks{bi,bj};
    figure,imshow(my_8x8_block)


end

end

我做bpcs隐写术.......

在下面的代码中,即使size(块,1)为64,也只显示8个块。我需要访问位平面图像中的所有单独块并继续进行复杂度计算和嵌入..请帮帮我?

1 个答案:

答案 0 :(得分:0)

您的循环具有不正确的语法用于其预期目的。您希望使用冒号分隔最小值和最大值而不是逗号。

for bi = 1:size(blocks,1)
    % do stuff
end do

我建议你不要在循环中使用imshow,因为它会用数字向你发送垃圾邮件。如果您想确保代码正常运行,只需打印bibj的值。