how to hide the message in maximum number of frames in a video steganography using LSB algorithm. i already done a single image then how can i add no of frames to hide text in my coding
    5 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Deepa lakshmi
 el 20 de Feb. de 2017
  
    
    
    
    
    Comentada: ayaz
 el 7 de Abr. de 2023
            vid=VideoReader('C:\Users\DEEPA\Documents\MATLAB\test.avi');
numFrames = vid.NumberOfFrames;
n=80;
for i = 1:n
    frames = read(vid,i);
    imwrite(frames,['Image' int2str(i), '.jpg']);
 end;
 %%sdsd
 x=imshow('C:\Users\DEEPA\Documents\MATLAB\Image1.jpg');
c = imread('C:\Users\DEEPA\Documents\MATLAB\Image1.jpg');
    message = 'I am good';
    message = strtrim(message);
    m = length(message) * 8;
    AsciiCode = uint8(message); 
    binaryString = transpose(dec2bin(AsciiCode,8));
    binaryString = binaryString(:);
    N = length(binaryString);
    b = zeros(N,1); %b is a vector of bits
    for k = 1:N
        if(binaryString(k) == '1')
            b(k) = 1;
        else
            b(k) = 0;
        end
    end
    s = c;
    height = size(c,1);
    width = size(c,2);
    k = 1;
    for i = 1 : height
        for j = 1 : width
            if (k<=m)
             LSB=mod(double(s(i,j)),2);
             s(i,j)=s(i,j)+LSB+b(k);
            k = k + 1;
            end
        end
    end
     imwrite(s, 'hi.bmp');
     imshow('hi.bmp');
     %%Retriever coding
    z=imshow('hi.bmp');
    s = imread('hi.bmp');
    height = size(s,1);
    width = size(s,2);
    %For this example the max size is 100 bytes, or 800 bits, (bytes * = bits
    m = 800;
    k = 1;
    for i = 1 : height
        for j = 1 : width
            if (k <= m)
                b(k) = mod(double(s(i,j)),2);
                k = k + 1;
            end
        end
    end
    binaryVector = b;
    binValues = [ 128 64 32 16 8 4 2 1 ];
    binaryVector = binaryVector(:);
    if mod(length(binaryVector),8) ~= 0
        error('Length of binary vector must be a multiple of 8.');
    end
    binMatrix = reshape(binaryVector,8,100);
    %display(binMatrix);
    textString = char(binValues*binMatrix);    
    disp(textString);
    %%frames to video
writerObj=VideoWriter('video.avi');
writerObj.FrameRate=80;
open(writerObj)
for i=1:80
    frame=sprintf('Image%d.jpg',i);
    input=imread(frame);
    writeVideo(writerObj,input);
end
close(writerObj);
0 comentarios
Respuesta aceptada
  Image Analyst
      
      
 el 20 de Feb. de 2017
        I don't understand what you need. Do you want to hide one image in all the N frames? Do you want to hide N images in N frames? Do you want to hide 1 image in N frames?
0 comentarios
Más respuestas (1)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


