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

조회 수: 1 (최근 30일)
Bhavneet Sharma
Bhavneet Sharma 2019년 3월 9일
댓글: Bhavneet Sharma 2019년 3월 13일
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
Walter Roberson
Walter Roberson 2019년 3월 12일
it is a 2d array . Each column is a group of 3 bins.
Bhavneet Sharma
Bhavneet Sharma 2019년 3월 13일
Thanks a lot sir @Walter Roberson

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by