Home > English, Matlab > LSB watermarking using MATLAB

LSB watermarking using MATLAB


Lately at university, I have been following the “Data Hiding” course. Basically the lecture are focused on digital watermarking (on images and audio files), and cryptography.

One of the first lab lessons was about LSB (least significant bit) replacement. The idea behind this watermarking technique is the following: if you see you image as a matrix NxM (where N and M are the dimension of the image) you can represent the value of the pixel in the position (i,j) as a binary number; this binary can be then divided in all of its bit, so that you will have a most significant bit (the one that contains quite a lot of information, and a least significant bit that contains few information).

If your image is for example in gray scale, you can make changes to the value of the LSB without any perceptible distortion for the human user therefore you can think of taking the LSB of an image (the cover image) and change its value in every pixel with the MSB of another image, that we would like to embed in a secret/non perceptible way in the cover image). For my code I used two bitmap image, unfortunately wordpress doesn’t allow me to publish bmp images, so I’m just going to put here the links for getting the images from the web: http://www.ece.rice.edu/~wakin/images/lena512.bmp http://www.eecs.qmul.ac.uk/~phao/CIP/Images/Baboon.bmp

Ok, now (as always) a lot of code about LSB watermarking and few words about it 😀 Briefly with the following code I will try to embed the MSB of the baboon image into the picture of Lena by exploiting the LSB embedding technique. We will try also to add an WGN (white gaussian noise) to the image then after these operations we will write to file the results. The code is heavily commented, so I think that further explanations are not needed.

%Project: 	Tutorial on Least Significant Bit Substitution
%               Watermark Embedding

clear all; 

% read in the cover object you want to use for embedding
file_name='lena.bmp';
cover_object=imread(file_name);

% read the message image you want to hide in the cover image
file_name='baboon.bmp';
message=imread(file_name);

% conversions needed to spread the image values on a 256 gray-scale
message=double(message);
message=round(message./256);
message=uint8(message);

% determine the size of cover image used for embedding
Mc=size(cover_object,1);	%Height
Nc=size(cover_object,2);	%Width

% determine the size of message object to embed
Mm=size(message,1);	        %Height
Nm=size(message,2);	        %Width

%y = uint8(wgn(Mm,Nm,1));

% title the message object out to cover object size to generate watermark
for ii = 1:Mc
    for jj = 1:Nc
        watermark(ii,jj)=message(mod(ii,Mm)+1,mod(jj,Nm)+1);
    end
end

% set the LSB of cover_object(ii,jj) to the value of the MSB of watermark(ii,jj)
watermarked_image=cover_object;
for ii = 1:Mc
    for jj = 1:Nc
        watermarked_image(ii,jj)=bitset(watermarked_image(ii,jj),1,watermark(ii,jj));
    end
end

% add noise to watermarked image
noisy = imnoise(watermarked_image,'gaussian');

% write to file the two images
imwrite(watermarked_image,'lsb_watermarked.bmp','bmp');
imwrite(noisy,'lsb_watermarked_noise.bmp','bmp');

% display watermarked image
figure(1)
imshow(watermarked_image,[])
title('Watermarked Image')

% display watermarked and noised image
figure(2)
imshow(noisy,[])
title('Watermarked and noised Image')

So if you execute this code you are going to have on screen and on disk two images, that I can’t dsiplay here because they are bmp files.

Now let’s see how to recover the watermark:

%Project: 	Tutorial on Least Significant Bit Substitution
%               Watermark Recover

clear all;

% read in watermarked image
file_name='lsb_watermarked.bmp';
watermarked_image=imread(file_name);

% determine size of watermarked image
Mw=size(watermarked_image,1);	%Height
Nw=size(watermarked_image,2);	%Width

% use lsb of watermarked image to recover watermark
for ii = 1:Mw
    for jj = 1:Nw
        watermark(ii,jj)=bitget(watermarked_image(ii,jj),1);
    end
end

% scale the recovered watermark
watermark=256*double(watermark);

% scale and display recovered watermark
figure(1)
imshow(watermark,[])
title('Recovered Watermark')

Try the code and let me know in case of troubles!

  1. Tomasz
    May 21, 2010 at 7:30 pm

    Hi,
    If you are good in watermark algorithms developing
    this is for you: https://mydrmspace.com/upload/
    Regards,

  2. Sachin
    June 28, 2010 at 10:03 am

    Hiee,

    I have written a similar code for encoding data instead of picture like u did…I’m not able to retrieve the same text while recovering can u please help me out in d recovery of text from LSB. Actually while encoding I’m converting it to Double and then saving at the LSB of the image. so while retrieving i’m not getting the same text/ascii value.

    Thanks in Advance
    Sachin

    • pdincau
      June 28, 2010 at 10:30 am

      Hi,
      i can take a look at it. Do you want to hide the text or just add it?In the first case i think the problem is in the data conversion when you recover.

      let me know so that i can be more precise

      • lamiaa
        August 6, 2010 at 3:02 am

        I have the same problem
        if you solve it could you send the code to me at
        lamiaabak@yahoo.com

  3. lavanya
    July 20, 2010 at 9:02 am

    hi,
    ur code is working fine for bmp images,but not for jpeg images.
    any change of code is required for jpeg images?

    • pdincau
      July 20, 2010 at 9:29 am

      can you tell me what problem you have?it may be related to data conversion..

    • Abdullah
      August 25, 2010 at 9:25 am

      I got this problem
      when I save the watermarked image as JPEG, I lost the data. But if I save the watermarked image as BMP, it works and I get the data back.
      How can I solve this problem?

      • pdincau
        August 26, 2010 at 7:25 am

        well, this kind of technique should not survive to a jpeg compression, because there is a loss in the compression process…and obviously the LSBs are lost!

  4. lavanya
    July 27, 2010 at 8:31 am

    Hi,
    i am not getting any error,but i cant retrieve recovered watermark.

    • pdincau
      July 27, 2010 at 9:44 am

      i will try it as well with jpeg

  5. lamiaa
    August 6, 2010 at 2:59 am

    Sachin :
    Hiee,
    I have written a similar code for encoding data instead of picture like u did…I’m not able to retrieve the same text while recovering can u please help me out in d recovery of text from LSB. Actually while encoding I’m converting it to Double and then saving at the LSB of the image. so while retrieving i’m not getting the same text/ascii value.
    Thanks in Advance

    I have the same problem
    if you solve it could you send the code to me at
    lamiaabak@yahoo.com

    Sachin

  6. lamiaa
    August 6, 2010 at 3:06 am

    lamiaa :
    I have the same problem Iwant to hide text in image and extract the same text
    if you solve it could you send the code to me at
    lamiaabak@yahoo.com

    Thanks

  7. krishna
    September 17, 2010 at 3:56 am

    i am doing project on Colored Digital Image Watermarking using the Wavelet Technique.can u implement this code. i tried some code but i am getting problem during lsb insertion i am unable understand.can u please try to help me.its urgent.it is an american journal
    thank q

  8. amit kumar
    October 1, 2010 at 7:17 am

    Sir, i am doing thesis on image steganography in my M.tech thesis.I have done LSB algorithm for implementing this.So I need some new ideas for my M.tech thesis.Please sort out my problem.

    • QASIM JAN
      October 11, 2014 at 11:19 am

      amit kumar i m also doing my master thesis on watermarking iris feature into the face image of person.. so plz would u like to send me your watermarking source code…

  9. Bharat
    October 30, 2010 at 6:17 pm

    Sir , even i tried your code.. Its working fine , but sir i want to hide text in an image . The Lsb insertion technique. Please ,help me with it Sir.
    frenzz.b@gmail.com

  10. pardeep sharma
    November 11, 2010 at 8:26 am

    amit kumar :Sir, i am doing thesis on image steganography in my M.tech thesis.I have done LSB algorithm for implementing this.So I need some new ideas for my M.tech thesis.Please sort out my problem.

    hi sir , as you said you are doing thesis on lsb, if you have literature survey of lsb please send me , after 3 days i submit my report for minor project

  11. chavani
    December 6, 2010 at 7:29 pm

    hi pdincau I want to hide text in image and extract the same text
    if you solve it could you send the code to me at chaabane@hotmail.com
    thank u before

  12. merieme
    December 17, 2010 at 12:06 am

    if you solve it could you send the code to me
    i need your help this my email
    aud1o@live.com

  13. pdincau
    December 20, 2010 at 1:49 pm

    hi all,

    for all of you who asked for “hiding text into an image”, take a look at http://www.mathworks.com/matlabcentral/fileexchange/12654-hide-text-files-into-image

    br,

    paolo

  14. merieme
    December 20, 2010 at 3:25 pm

    hi pdincau i need your help please
    i use koch and zhao algorthim in my project (watermarking )
    i try to do the DCT algorithim the code is :
    I = imread(‘cameraman.tif’);
    I = im2double(I);
    T = dctmtx(8);
    dct = @(x)T * x * T’; %anonymous function dct
    B = blkproc(I,[8 8],dct)
    mask = [1 1 1 1 0 0 0 0
    1 1 1 0 0 0 0 0
    1 1 0 0 0 0 0 0
    1 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0];
    m=@(x)mask.* x
    B2 = blkproc(B,[8 8],m);
    invdct = @(x)T’ * x * T;
    I2 = blkproc(B2,[8 8],invdct);
    imshow(I), figure, imshow(I2)
    but my aim how to choose the 2 coefficients from the dct pleaaaaaaaaaaaaaaaaaaaaaase help me

  15. merieme
    December 20, 2010 at 5:50 pm

    how i device my image into8x8 bloc and how i can select 2 coefficients from the bloc by matlab i need your help
    I am waiting for your reply

  16. merieme
    December 22, 2010 at 10:46 pm

    please answer me

  17. merieme
    December 29, 2010 at 5:07 pm

    where are you please i need your help
    please

  18. merieme
    January 16, 2011 at 8:05 pm

    you forget me please help me i needyour help

    • deepti arora
      April 13, 2013 at 4:47 pm

      hello
      can you please help me with DWT based watermarking
      thanks in advance

      • deepti arora
        April 13, 2013 at 4:49 pm

        DWT based watermarking MATLAB code

  19. Juan
    January 22, 2011 at 8:54 am

    Hello!

    I’m interested in your site and congratulations for this!, I’m mexican student and my question is do you have LSB algorithm in MATLAB for audio signals?? please help me!!

    • pdincau
      January 22, 2011 at 2:42 pm

      hi,
      thanks! yeah, i’m working on digital audio signal right now…stay tuned!

      • Juan
        January 30, 2011 at 10:11 pm

        Hello!

        Please do not forget to help me with the LSB method for audio signals, really need help from an expert like you

      • pdincau
        January 31, 2011 at 12:44 pm

        the case is fairly simple, i will post you something as soon as i can

  20. merieme
    February 16, 2011 at 11:05 pm

    why u don’t answer me pdincau
    about algorithme lsb watermarking for image

  21. Juan
    February 17, 2011 at 10:51 pm

    pdincau :
    the case is fairly simple, i will post you something as soon as i can

    help me please

    • pdincau
      February 18, 2011 at 10:11 am

      will be busy until end of february….if you want i can give you only some hints now

      • Juan
        February 22, 2011 at 5:23 pm

        I’ll wait you, thank you so much!!

      • Juan
        May 5, 2011 at 12:15 am

        pdincau :
        the case is fairly simple, i will post you something as soon as i can

        Please help me with the LSB algorithm for audio watermarking, do you remember me?

      • Deepti
        May 14, 2013 at 5:32 pm

        Pdincau i have messaged you so many times but you did not replied .please reply i really need your help
        I want matlab code for dwt and dct based image in image watermarking…
        Or send me some link…

      • pdincau
        May 14, 2013 at 8:47 pm

        there is a blog post about DCT…DWT is just another transform

  22. merieme
    February 21, 2011 at 7:20 pm

    je travaille sur l’algorithme de koch et zhao
    voici une description fomelle des algorithmes d’insertion d’une marque

    1\.Soit une séquence de k bits(b1,……,bk) à cacher dans l’image
    2\.Sélectionner dans l’image (selon une clé secrète) k blocs B(B1,…..Bk)de taille 8×8

    3-\Calculer les coefficients DCT (a11,…..,a88)de chaque bloc sélectionné
    4-\Pour i allant de 1 à k :
    soient (akl)et (amn)deux des coefficientsDCT du bloc Bi,et bi le bit a cacher
    -si {(bi=1)et (akl)i>(amn)i }
    {(bi=0)et (akl)iamn ou l’inverse
    sinon modifier les valeurs de (akl)i et (amn)i pour que la relation précédente soit vérifiée quelle relation
    pouvez vous m’aider:sos: :fs: svp
    si vous avez des documentations plus detaillé sur l’algorithme meme des programmes (n’importe quelle langauge matlab ou c )

  23. merieme
    February 21, 2011 at 7:24 pm

    svp i need your help pdincau

  24. merieme
    February 21, 2011 at 7:25 pm

    this my email aud1o@live.com
    if u wanna to help me i wait your help please every body

  25. merieme
    February 22, 2011 at 7:24 pm

    pdincau in your prgramme you used
    watermark(ii,jj)=message(mod(ii,Mm)+1,mod(jj,Nm)+1);
    this instruction put the pixels of message in watermark
    why we don’t use immediately like this instruction
    watermarked_image=cover_object;
    please answer me i want you to explain me the function of this instruction

  26. merieme
    February 22, 2011 at 8:36 pm

    I need your help as soon as
    please don’t forget me

  27. merieme
    March 5, 2011 at 11:59 am

    I am looking for some help in dividing an image to 8×8 block and access each block separately. My image I is of size 640×480. I need to divide the image into subblocks of size 8×8 and have to add watermark to each block separately. blkproc is not helping as I cannot access each block separately. If someone can help me with some working code, it will be great.
    please help me

  28. merieme
    March 9, 2011 at 10:15 pm

    To embed more bits into the LSB of the cover image our algorithm as selecting 1, 2, 3 and 4 LSBs bits of each pixel.

     Selecting 1 bit is mod (img, 2)

    Selecting 2 bits is mod (img, 4)

     Selecting 3 bit is mod (img, 8)

    for i=1:L; % Loop till logo length 1024.
    if binary(i)==1
    img_stego(key(i))=cover(key(i)) – mod(cover(key(i)),2)+1;
    else
    if binary(i)==0
    img_stego(key(i))=cover(key(i)) – mod(cover(key(i)),2);
    end
    end
    end
    have any idea about this condition mister pdincau

  29. Richa S
    April 17, 2011 at 1:08 pm

    Hello everyone,
    I need a matlab code for embedding a visible watermarrk in an image….
    Pleease reply asap.
    thanks

  30. fifi
    April 22, 2011 at 5:48 pm

    slt tous le mnde , je travail sur la décomposition EMD sur les image si quelqun a le code matlab envoyer moi svp je le besoin urgen merci

  31. fifi
    April 22, 2011 at 5:49 pm

    mon email c:
    w.afa.88@hotmail.fr

  32. Rohini
    May 3, 2011 at 10:13 am

    Hey!!
    I was wondering why exactly we need the following lines of code:

    % conversions needed to spread the image values on a 256 gray-scale
    message=double(message);
    message=round(message./256);
    message=uint8(message);

    why can’t we use mat2gray instead?

  33. elli
    May 9, 2011 at 9:03 am

    Hello,

    I have a project in image watemarking using DWT transform, i need an algorithm and its code.
    anyone can help me?
    Please…

    Thanks for advance…:)

  34. Rohini
    May 13, 2011 at 6:25 am

    Hey!

    How exactly does bitset work?
    If the LSB of the coverimage is being replaced only by MSB of the watermark, what happens to rest of the bits of watermark?
    How come the whole image is retrieved in the end?

  35. Maya
    May 22, 2011 at 7:25 pm

    Hi..
    I’m interested in your site..
    I am looking for some help in hide text in audio/picture instead of hide picture in picture
    can you help me please ?? 🙂

  36. madhu patnik
    September 29, 2011 at 6:01 am

    excellent material…. all our lecturers are following this and stated doing their PHD’s….

  37. adorable_girl
    October 4, 2011 at 9:26 am

    heeyyy hiii
    i need the code in matlab of lsb replacement using rows of images
    plz help guys
    and thanks in advance 🙂

  38. Imran Khan
    November 22, 2011 at 5:59 am

    Sir the code is working well for bmp images but if u embedding that in jpg images then at that time of recovering message from the cover work then the result will be different. So there is any other technique for embedding in jpg images…?????

  39. phucmanh
    November 27, 2011 at 4:28 am

    Help me !
    => programming in matlab
    ——————————————————————————
    I’m making a Project on digital watermarking on digital images.
    I have to implementate it by DCT domain, embed text watermark in image to protected copyright.

    Would you please share with me.!!

    Thank you everyone, thank you verymuch !!!!!!!

    And now:
    matlab code project: digital signature on RSA (or DSS, ..) //on digital image.
    MD5 (or SHA,..) // on digital image

    Please contact me : manhphuc.cnt48@gmail.com
    supermario.lovely@yahoo.com
    Thanks!

  40. amir
    February 1, 2012 at 8:42 am

    HI
    I am looking for some help in pixel images and hiding image in another image in Photoshop. so i want printing this work by laser printer or other printer. thanks!

  41. asraa
    February 15, 2012 at 8:31 am

    I want aprogram to hide atext in image code anyone help me please
    if anyone have this code send it to me at the my email
    asraahassan31@yahoo.com

  42. najla
    March 15, 2012 at 12:14 pm

    I write the same code but it appears a problem in line 22 (
    The size of the indicated variable or array appears to be changing with each loop iteration)
    could you help me please
    my mail is slama_najla@yahoo.fr

    • pdincau
      March 19, 2012 at 8:40 am

      is it a warning or an error?

      • March 19, 2012 at 10:08 am

        Hello, it was an error :Error in ==> Untitled4 at 19
        watermark(ii,jj)=message(mod(ii,Mm)+1,mod(jj,Nm)+1);
        Thanks to help me

  43. March 15, 2012 at 1:22 pm

    can some body help me to correct this problem, when i write this programm, in line 22 apperas a mistake, that i can’t correct in the variable watermark

    • pdincau
      March 19, 2012 at 10:23 am

      i don’t have matlab right now. The first thing coming to my mind now is that your matlab version is not able to handle matrix with non specified dimensions. You may wanto to try to declare matrix watermark outside of the for loop with specified dimensions

  44. March 19, 2012 at 10:32 am

    Can you tell me what is the best version of matlab hat can i use ?

  45. Vinay Srivastava
    April 2, 2012 at 7:43 pm

    Sir,
    can you tell me the base paper that consider for above algo.
    plz give me the link of pdf file for that algo.

    • pdincau
      April 3, 2012 at 7:02 am

      I didn’t use a specific paper for this post. Anyhow, after a quick search in http://www.ieee.org I found many results, a nice paper to be used as starting point could be “Digital Watermarking Algorithm Using LSB” by Abdullah Bamatraf, Rosziati Ibrahim and Mohd. Najib B. Mohd Salleh.

      • Vinay Srivastava
        April 3, 2012 at 11:46 am

        can you suggest any of the algo code for Joint DWT-DCT watermarking………..
        If code is available, it is great help for me……..

        Regards

    • pdincau
      April 3, 2012 at 12:05 pm

      “Secure Spread Spectrum Watermarking for Multimedia” by Ingemar Cox et al.
      In my blog post https://pdincau.wordpress.com/2010/05/18/similarity-threshold-computation-for-cox-watermarking/ you can find pseudo code for it. Matlab code is easy for that, you can start with pseudo code and other stuff you find in this blog. i will try to find on my old laptop the code anyway

      • Vinay Srivastava
        April 3, 2012 at 5:58 pm

        Sir,
        Can I give you the coding and my base paper by my side so you can rectify the problem for me. for this transaction please give me your E-mail id. or mail me your ID at “tauras09@gmail.com”. i am very thankful for your help.

        Regards

  46. salma
    April 4, 2012 at 12:08 pm

    Hey!!
    I was wondering why exactly we need the following lines of code:
    % conversions needed to spread the image values on a 256 gray-scale
    message=double(message);
    message=round(message./256);
    message=uint8(message);

    and this instruction put the pixels of message in watermark
    watermark(ii,jj)=message(mod(ii,Mm)+1,mod(jj,Nm)+1);
    this instruction put the pixels of message in watermark

    please answer me i want someone to explain me the function of this instructions

  47. salma
    April 5, 2012 at 9:09 am

    someones can describe me what this function (bitset) do ?
    thanks for your help!

  48. salma
    April 5, 2012 at 12:19 pm

    yes I have already seen the definiton in math works but I want more detail, how it works, can you tell me

    • pdincau
      April 5, 2012 at 1:13 pm

      Do you know some matlab coding?

  49. nilesh
    April 9, 2012 at 10:21 am

    sir, can you tell me how to apply dwt2 command on true color images..
    thanx

    • Vinay Srivastava
      April 9, 2012 at 3:59 pm

      Sir,
      When an embedded binary form watermark is extracted from watermarked image. Specially in DWT-DCT algorithms a correlation is used to identify the watermark bit on image. If you consider my sent paper(“http://www.aicitglobal.org/jdcta/ppl/jdcta_version10_Part6.pdf”) there is an extracted procedure in which step 8 is very confusing. Can please elaborate that thing for me i can’t understand its mean.

    • Vinay Srivastava
      April 9, 2012 at 4:04 pm

      [LL1,LH1,HL1,HH1]=dwt2(A, ‘wavelet family’); ———-(1st level transform)
      where A=color image
      OR
      u can first devide image into RGB levels then apply dwt2 transform

  50. April 26, 2012 at 6:42 am

    Could I apply your code in my GUI ????

    • pdincau
      April 26, 2012 at 8:47 am

      can you be more specific?

  51. April 26, 2012 at 10:41 am

    I am not good at expressing myself
    ok ! I am interested in the project you did
    I want to Open GUI Layout Editor to try to implement the project you did .
    Just according to the code you write `.
    It ‘s that ok ???
    just for fun
    *********************************************
    Did I make myself clear ??

    • pdincau
      April 26, 2012 at 10:58 am

      yes.

      You can use it!

  52. nadia
    May 16, 2012 at 11:19 pm

    hi
    i am working in your code and i have to do a presentation next week can u please explaine to me this instruction:
    watermark(ii,jj)=message(mod(ii,Mm)+1,mod(jj,Nm)+1);

  53. May 17, 2012 at 9:58 am

    hey.
    anyone can send me the code for hiding bits into an image using lsb technique, its my final year project, please if any one can help me. send me code on
    emailnoshi@yahoo.com

  54. June 19, 2012 at 8:58 am

    the problem for the bit get , if added key the watermark image can’t be recover
    so if we have some key type in during the embedding.. do you have any solution or idea Mr. Pdincau.. Could you please help..

  55. santhanakumar
    July 9, 2012 at 6:50 am

    watermark(ii,jj)=message(mod(ii,Mm)+1,mod(jj,Nm)+1);

    Hi all,am getting error in above coding what i do anybody know pls reply me

    Am getting error is

    ” The visible watermarking appears to size change every loop iteration(with in script)”

  56. santhanakumar
    July 11, 2012 at 5:46 pm

    imwrite(watermarked_image,’lsb_watermarked.bmp’,’bmp’);
    imwrite(noisy,’lsb_watermarked_noise.bmp’,’bmp’);

    am getting error in above lines.am used matlabr2012a.any syntax is there in imagewrite ,any one know reply me.. santhanakumar87@gmail.com

  57. loca
    July 31, 2012 at 9:03 pm

    Hi there,
    dear Sir, I am suppose to do a project on audio watermarking since I am trying to learn algorithms but I am finding it difficult to apply them in matlab. Do you have any source code for embedding and detection in matlab so I could test it and see how it works..?thanks

  58. loca
    August 24, 2012 at 8:24 am

    would you please help me contruct the code for LSB watermark extraction in audio, I have managed to to embedding, but the extraction part I am not able to..I would really appreciate it..thanks

  59. loca
    August 24, 2012 at 8:25 am

    sorry I forgot to mentioned I have to used matlab ..for audio LSB watermark embedding and extraction…

    • pdincau
      August 24, 2012 at 12:16 pm

      have you got some code online? I am not sure i will be able to help you, very very busy

  60. spandex shorts women
    October 30, 2012 at 7:55 pm

    Great goods from you, man. I have understand your stuff
    previous to and you are just too great. I actually like what you have acquired here, really like what you are saying and the way in which you say it.
    You make it entertaining and you still care for to keep it sensible.
    I can not wait to read far more from you.
    This is actually a terrific site.

  61. arul
    November 5, 2012 at 2:47 pm

    hi i need a project source code on digital image watermarking using chaotic map

  62. November 13, 2012 at 9:46 pm

    HellO everyone, please i don’t know what is matlab code of patchwork watermarking technique,, please help me 🙂

  63. salma
    December 2, 2012 at 7:20 pm

    Hi
    audio watermarking techniques … ready yet ??

  64. ekta
    January 2, 2013 at 1:13 pm

    need help in audio steganography matlab code if you can help me please

  65. shashi kant singh
    January 9, 2013 at 1:52 pm

    please any one can provide me matlab code for lsb secret image hiding in cover image and recovering the secrete image…..please mail at lavanya555505@gmail.com

    • pdincau
      January 9, 2013 at 2:00 pm

      i really don’t understand your question. The code is in the post for both embedding and recovering

      • shashikant
        February 23, 2013 at 7:54 am

        actually first i want to make n number of shares of secret image and then hide them in n cover images and then recover the same…

    • pdincau
      March 28, 2013 at 10:35 am

      sorry but you are really not clear in the explanation

  66. naved
    February 5, 2013 at 2:29 pm

    hiii anybody can help me
    i have a project in text watermarking. text may be word file,doc file, pdf file.
    could any one tell how to read these files in matlab for embed and extracting watermark

  67. Gran
    February 22, 2013 at 3:07 am

    Hi to all
    Please before asking a question from the expert, first have a question from youself that really u tried by yourself for your problem solution by using google search and Matlab help?. Always try to use these two and then u can ask for a specific point. Sorry to all and never mind my saying but really it will improve your own experties.

  68. lavanya
    February 23, 2013 at 8:02 am

    How can i improve LSB information hiding algo

  69. deepti arora
    March 27, 2013 at 6:14 pm

    hello
    sir i need matlab code for hiding image using watermaking based on dwt and dct combined.
    please help me as i am really in need of your help.
    thanks in advance. i am waiting.

  70. deepti arora
    March 27, 2013 at 6:17 pm

    sir help me as soon as possible as i have to submit my m.tech thesis.
    looking forward for your help. please mail me at aroradeepti13@yahoo.com

    • pdincau
      March 27, 2013 at 6:30 pm

      you didn’t specify what you need. have you tried to search for papers?

      • deepti arora
        April 3, 2013 at 5:58 pm

        yes sir i have tried for IEEE papers…
        i have paper based on comparison of DWT and DCT watermarking.
        i want to have DWT and DCT based watermarking matlab coding..

  71. deepti arora
    March 27, 2013 at 6:28 pm

    @Gran
    sir i have already tried with matlab help and i have got much data from there but not actly what i want thats why i need the help .
    so help me out.

  72. gedam
    March 31, 2013 at 7:49 pm

    sir have problem about image watermarking will you send me source code .m format

  73. April 6, 2013 at 10:47 am

    How we embedded an bmp image in wav file, and extract the image from the wav file?
    Any idea, or could you point me to a resource where I can get some good information..
    Thanks. 🙂

  74. deepti arora
    April 13, 2013 at 4:51 pm

    pdincau
    please reply me i am in really need of that coding

  75. roopa
    April 15, 2013 at 3:05 am

    i need fragile watermarking using hierarchical mechanism code in matlab any one help me

  76. prerna
    April 15, 2013 at 9:53 am

    elli :
    Hello,
    I have a project in image watemarking using DWT transform, i need an algorithm and its code.
    anyone can help me?
    Please…
    Thanks for advance…:)

  77. prerna
    April 15, 2013 at 9:55 am

    I want to hide text in image and extract the same text
    if you solve it plzzzz send the code to me at
    prernatekam2009@gmail.com

  78. avishake
    April 19, 2013 at 7:10 am

    Hello sir,
    i wanted to hide text in a image in the same procedure as u did, but after embedding or hiding the text i am not able to recover the same text can you plzz help i have tried your procedure with images it has worked properly but for text is not the same case .Suppose i take abcd as a string and convert that into unit8 and then run bitset but still i m not being able to retrive the hidden data.plzz help as soon as possible.Thanks.

    • Deepti
      April 19, 2013 at 1:44 pm

      Hello Avishake
      Can you plzz send me that coding because i want hide image in image.
      Thanks in advance..

    • Nancy
      September 3, 2014 at 10:11 am

      Hello Avishake and Deepti,
      I am also working on the same project. Avishake I am facing the same problem as you were when you was working on this project.(I hope till now you have completed your project as you commented here back in 2013 😀 😛 ) . I’ll be very thankful to you guys if any one you can help me with the same. I need it for my Project.
      Waiting for your replies eagerly 🙂 🙂

  79. May 14, 2013 at 10:42 am

    Hi, I finally embedded and extracted an image in an audio file, thanks for link you sent, here is the output, http://black-electronics.com/blog/audio-watermarking/

    • pdincau
      May 14, 2013 at 11:12 am

      good work. congratulations 😀

  80. lavanya
    May 14, 2013 at 3:24 pm

    i want the LSB coding for 4bits substitution….plz help me out…

  81. Benny Lai
    May 15, 2013 at 7:53 am

    Hi, I’m study watermarking program for school program. Your code is work but only extract watermark message is failed if the image is watermarked image(i.e. noise attack). Is this normally problem in LSB watermarking algorithm or code limitation?

    Thank you.

    • pdincau
      May 15, 2013 at 3:53 pm

      normal. lsb is not strong at all against noise of any kind

  82. Deepti
    May 15, 2013 at 9:23 am

    Thanks for the reply….
    Yes sir i have tried that but that dct code is for single image i want to hide watermark in that… So for that what should i do? And how to use dwt in that…
    Actually i have implemented dwt based wqtermarking but in that i have combined two images together but i want to hide one in another…
    Really not getting what to do … Should i mail you my code?. .?
    And please reply so that i can proceed my work

    • pdincau
      May 15, 2013 at 4:39 pm

      please, read Cox’s paper first (the one I cited in the other post). Then ask.

      • Deepti
        May 15, 2013 at 4:59 pm

        Thanks again for replying for my post.
        But Sorry sir i am not getting about which paper you are saying .i studied many other ieee based paper . Can you mail the paper about which you are talking.
        Or should i mail you the code on which i am working???
        If you will help me i am sure my problem will get solve soon

      • pdincau
      • Deepti
        May 15, 2013 at 5:30 pm

        Yes i have just read it … Now can you please tell me how to sort cofficients ???
        or can you give your mail ID so that i can mail you my base paper and my coding on which i am working?? Or mail me the code related to your cox watermarking about which you have discussed above on my ID aroradeepti13@yahoo.com. I will be very thank full to you

      • pdincau
        May 15, 2013 at 5:41 pm

        You didn’t read my blog post otherwise you should have noticed the use of the function sort which is self explanatory. Sorry but usually i don’t review code via mail.

      • Deepti
        May 15, 2013 at 5:58 pm

        V'(i) = V(i) + alpha*watermark .. Is that part is the sorting??
        Actually i am new to matlab that is why getting so much problem.

      • pdincau
        May 15, 2013 at 6:16 pm

        No. I said the code…the part in gray…nevermind…

        Google: sort matlab

      • Deepti
        May 15, 2013 at 6:37 pm

        Ok ok i got it
        Now i will post you tomorrow what i have used in my code as i don’t have my laptop with me right now .
        And thanks for replying to my posts…:-)

      • deepti arora
        May 16, 2013 at 4:41 am

        [Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(‘haar’);
        [ca,ch,cv,cd] = dwt2(originalImage,’haar’);
        y = [ca ch;cv cd];
        Y = y +(c* watermark);
        for i=1:r
        for j=1:c
        nca(i,j) = Y(i,j);
        ncv(i,j) = Y(i+visibleRows,j);
        nch(i,j) = Y(i,j+visibleColumns);
        ncd(i,j) = Y (i+visibleRows,j+visibleColumns);
        end
        end
        where r , c are rows , columns respectively of original image. and c is constant.
        can you please tell me what does this means??

  83. Benny Lai
    May 15, 2013 at 4:24 pm

    Thank you for your reply.

  84. Benny Lai
    May 15, 2013 at 4:28 pm

    I’m one more question about this LSB watermarking, during execute this code, the watermark image will extended to 8 pieces if the cover image is 512×512 pixels, could I know what is the idea?

    Thanks in advance.

    • pdincau
      May 15, 2013 at 4:37 pm

      I don’t understand what you are asking. Sorry

  85. Benny Lai
    May 15, 2013 at 9:04 pm

    Do you have other code for LSB and the algorithm is more stronger? It can extract watermark from the noised watermarked image?

    Thank you.

  86. Gurleen
    May 16, 2013 at 8:28 am

    This is a very good code..
    Sir my question to you is can we recover the original image from a gray scale 1.If yes how can we do it.

  87. deepti
    July 10, 2013 at 12:06 pm

    hello sir
    could you please post the code work or formula for computing Quantization error between two images..
    thanks in advance.

  88. August 18, 2013 at 2:08 pm

    i need coding for hiding an img within anothr image using LSB method

    • pdincau
      August 19, 2013 at 4:23 pm

      Isn’it in the post? Anyhow “thanks” and “hello” are words i do appreciate!

  89. sangeeta
    April 4, 2014 at 6:49 am

    i want different algorithms to embed digital image in another image.
    plsss anyone send me the matlab code for embedding image to the following
    sngt.m1@gmail.com

  90. svetlana
    May 6, 2014 at 2:10 pm

    hello sir
    i am doing mtech thesis on audio watermarking via emd. plz send me matlab code for the same. my email id is – svetlana.bunny@gmail.com

  91. M.tech
    September 1, 2014 at 6:05 am

    hai..anyone hlp me to embeded dta in ECG signal…plz hlp me..

  92. Nancy
    September 3, 2014 at 9:58 am

    Hello Sir,
    I am doing M.Sc. project on steganography. I have to hide a text message in the image using the LSB technique. I have write the code for the same but in retrieving the hidden text message,I am not getting the same hidden text message which I am hiding in that cover image. Plz send me matlab code for the same if you have.

  93. Debdeep Dutta
    September 7, 2014 at 7:33 pm

    Hi, I am having digital watermarking as my minor project in my MCA. I am very new to MATLAB. So please excuse me in case this is an amateur question. I can execute the above code fine. Extraction also occurs but while embedding, is this invisible watermarking implementation? I cannot make out whether the watermark is getting embedded into the original image. How can I modify the code to make it a visible watermarking code?
    Any help will be very helpful for me.

  94. September 9, 2014 at 6:26 am

    My brother suggested I would possibly like this blog.

    He used to be totally right. This submit actually made
    my day. You can not consider simply how much time I had spent for
    this info! Thanks!

  95. Debdeep Dutta
    October 21, 2014 at 3:08 pm

    Can the watermark be extracted from the noisy watermarked image?

  96. imran
    December 18, 2014 at 12:13 pm

    plz tel me the MATLAB code for watermaking on RGB images using LSB
    my i email id is saadimranhanif@gmail.com

  97. Vishnu
    March 10, 2015 at 2:33 pm

    Does anyone have the decoder file for Reversible watermarking by Difference expansion.If you have please mail me
    Mail ID: gvpriya94@gmail.com

  98. shreya
    August 13, 2015 at 2:22 pm

    What is the use of mod function? Also the watermarked image goes into infinite loop? Tell the reason

    • pdincau
      August 13, 2015 at 2:31 pm

      @shreya first of all this blog post was written in 2010 so things may not work with your current matlab. You can study mod function by your own. Last, being polite does help when you ask for help

  1. No trackbacks yet.

Leave a reply to asraa Cancel reply