How to embed image watermark bits into histogram of the audio file?

2 vues (au cours des 30 derniers jours)
Bhavneet Sharma
Bhavneet Sharma le 9 Mar 2019
Commenté : Bhavneet Sharma le 13 Mar 2019
I have an image watermarks that is converted into binary bits and histogram of an audio wav file. I need to embed the watermarking bits in the histogram.
close all;
clc;
% read image
[embededimage_fname, image_pthname] = ...
uigetfile('*.jpg; *.png; *.tif; *.bmp', 'Select the Cover Image');
if (embededimage_fname ~= 0)
embedded_image = strcat(image_pthname, embededimage_fname);
embedded_image = double( rgb2gray( imread( embedded_image ) ) );
embedded_image = imresize(embedded_image, [512 512], 'bilinear');
else
return;
end
% read audio
[watermarkAudio_fname, watermark_pthname] = ...
uigetfile('*.wav', 'Select the Watermark audio');
if (watermarkAudio_fname ~= 0)
watermark_audio = strcat(watermark_pthname, watermarkAudio_fname);
[n, fs] = audioread(watermark_audio); % "n" is number of samples and fs is the sample rate
%watermark_audio = imresize(watermark_audio, [512 512], 'bilinear');
else
return;
end
imbin_seq = reshape(dec2bin(embedded_image, 8) - '0', 1, []);
% To calculate modified mean
na = 2^15;
n = n*na;
nLength = length(n);
modified_mean = mean(abs(n));
% Embedding Range
lmda = 2.4; %pick any value of lmda from the range (2.0, 2.5);
e_range = ceil(lmda * modified_mean);
%number of bins and Bin Width
h = histogram(n);
Bin_Num = h.NumBins();
Bin_Width = h.BinWidth();
Now, my next step is selecting three consecutive bins of the histogram and then 1 bit of watermark is embeded into these 3 bins. I am not getting how to this embedding, suggest me how to perform this watermarking??
Thanks in Advance!!!!
  12 commentaires
Walter Roberson
Walter Roberson le 12 Mar 2019
it is a 2d array . Each column is a group of 3 bins.
Bhavneet Sharma
Bhavneet Sharma le 13 Mar 2019
Thanks a lot sir @Walter Roberson

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by