How can I find Peak in a signal stream with one signal point?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi!
I'm implementing a Cox watermarking algorithm. But I found similar values of extracted watermark and original watermark. But I can not do Plotting how to become this Peak.
The code looks like this: I would really appreciate it if you could give me some advice.
% Load watermarked image
[app.file, app.path] = uigetfile({'*.jpg';'*.jpeg'}, 'Select an watermarked image');
imageW = imread(strcat(app.path, app.file));
% [row, column] = size(imageW);
% dctWVector = reshape(dctW, 1, row * column);
% [dctWVector_sort, index] = sort(abs(dctWVector), 'descend');
% index = index(2:1000 + 1);
% indexD = zeros(1000, 2);
% for i = 1:1000
% x = floor(index(i) / row) + 1;
% y = mod(index(i), row);
% indexD(i, 1) = y;
% indexD(i, 2) = x;
% end
% Load original image
[app.file, app.path] = uigetfile({'*.jpg';'*.jpeg'}, 'Select an original image');
imageO = imread(strcat(app.path, app.file));
imageO = imageO(:, :, 1);
dctW = dct2(imageW);
dctO = dct2(imageO);
extract = [];
for i = 1:1000
extract = [extract (dctW(app.indexD(i, 1), app.indexD(i, 2)) / dctO(app.indexD(i, 1), app.indexD(i, 2)) - 1) * 10];
end
similarity = watermarkDetector(extract, app.watermark);
peak = corrcoef(similarity, app.watermark);
plot(app.UIAxes3, peak);
imshow(imageW, 'Parent', app.UIAxes3_2);
function similarity = watermarkDetector(extract, original)
similarity = sum(extract.*original) / sqrt(sum(extract.*extract));
end
0 comentarios
Respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!