图像隐写基于matlab DWT+IDWT数字水印嵌入+提取含Matlab源码 1530期

Posted 紫极神光

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了图像隐写基于matlab DWT+IDWT数字水印嵌入+提取含Matlab源码 1530期相关的知识,希望对你有一定的参考价值。

一、获取代码方式

获取代码方式1:
完整代码已上传我的资源: 【图像隐写】基于matlab DWT+IDWT数字水印嵌入+提取【含Matlab源码 1530期】

二、部分源代码

clc;
clear all;
warning off;
chos=0;
possibility=11;

while chos~=possibility,
    chos=menu('Digital 3-level image watermarking','select the cover image','select the watermark image','show 3-level coverimage','show 3-level watermarkimage','show watermarked image','show extracted image','Calculate MSE for embedding','Calculate PSNR for embedding','Calculate MSE for extraction','Calculate PSNR for extraction','exit');
    if chos==1
        [fname pname]=uigetfile('*.jpg','select the Cover Image');
        %eval('imageinput=imread(fname)');
        imageinput=imread(fname);
        

A=rgb2gray(imageinput);
P1=im2double(A);
P=imresize(P1,[2048 2048]);
%imshow(P);
%figure(1);
%title('original image');

[F1,F2]= wfilters('haar', 'd');
[LL,LH,HL,HH] = dwt2(P,'haar','d');
[LL1,LH1,HL1,HH1] = dwt2(LL,'haar','d');
[LL2,LH2,HL2,HH2] = dwt2(LL1,'haar','d');
%figure(2)
%imshow(LL2,'DisplayRange',[]), title('3 level dwt of cover image');
    end
    if chos==2
    [fname pname]=uigetfile('*.jpg','select the Watermark');
    %eval('imageinput=imread(fname)');
    %imageinput=imread(fname);
    imw2=imread(fname);
    imw=rgb2gray(imw2);
watermark=im2double(imw);
watermark=imresize(watermark,[2048 2048]);
%figure(3)
%imshow(uint8(watermark));title('watermark image')
[WF1,WF2]= wfilters('haar', 'd');
[L_L,L_H,H_L,H_H] = dwt2(watermark,'haar','d');
[L_L1,L_H1,H_L1,H_H1] = dwt2(L_L,'haar','d');
[L_L2,L_H2,H_L2,H_H2] = dwt2(L_L1,'haar','d');
%figure(4)
%imshow(L_L2,'DisplayRange',[]), title('3 level dwt of watermark image');
    end
    if chos==3
        imshow(LL2,'DisplayRange',[]), title('3 level dwt of cover image')
    end
    if chos==4
        imshow(L_L2,'DisplayRange',[]), title('3 level dwt of watermark image')
    end
    if chos==5
        Watermarkedimage=LL2+0.0001*L_L2;



%computing level-1 idwt2
Watermarkedimage_level1= idwt2(Watermarkedimage,LH2,HL2,HH2,'haar');
%figure(5)
%imshow(Watermarkedimage_level1,'DisplayRange',[]), title('Watermarkedimage level1');

%computing level-2 idwt2
Watermarkedimage_level2=idwt2(Watermarkedimage_level1,LH1,HL1,HH1,'haar');
%figure(6)
%imshow(Watermarkedimage_level2,'DisplayRange',[]), title('Watermarkedimage level2');


%computing level-3 idwt2
Watermarkedimage_final=idwt2(Watermarkedimage_level2,LH,HL,HH,'haar');
%figure(7)
imshow(Watermarkedimage_final,'DisplayRange',[]), title('Watermarkedimage final')
    end
    if chos==6
        [F11,F22]= wfilters('haar', 'd');
[a b c d]=dwt2(Watermarkedimage_final,'haar','d');
[aa bb cc dd]=dwt2(a,'haar','d');
[aaa bbb ccc ddd]=dwt2(aa,'haar','d');
function [ out ] = MSE( pic1,pic2 )
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
e=0;
[m n]=size(pic1);

for i=1:m
    for j=1:n
        e=e+double((pic1(i,j)-pic2(i,j))^2);
    end

三、运行结果


四、matlab版本及参考文献

1 matlab版本
2014a

2 参考文献
[1] 蔡利梅.MATLAB图像处理——理论、算法与实例分析[M].清华大学出版社,2020.
[2]杨丹,赵海滨,龙哲.MATLAB图像处理实例详解[M].清华大学出版社,2013.
[3]周品.MATLAB图像处理与图形用户界面设计[M].清华大学出版社,2013.
[4]刘成龙.精通MATLAB图像处理[M].清华大学出版社,2015.
[5]梁欣.基于DWT和SVD的彩色图像数字水印算法研究[J].计算机与数字工程. 2019,47(08)
[6]张秀娟,朱春伟.一种基于DWT-SVD的图像数字水印算法[J].数字技术与应用. 2017,(10)

以上是关于图像隐写基于matlab DWT+IDWT数字水印嵌入+提取含Matlab源码 1530期的主要内容,如果未能解决你的问题,请参考以下文章

图像隐写基于matlab小波变换DWT数字盲水印嵌入+攻击含Matlab源码 2313期

图像隐写基于matlab小波变换DWT数字盲水印嵌入+攻击含Matlab源码 2313期

图像隐写基于matlab DWT+DCT+LSB数字水印隐藏提取比较含Matlab源码 1623期

图像隐写基于matlab GUI DWT+DCT+SVD数字水印嵌入+提取+攻击(带面板)含Matlab源码 1664期

图像隐写基于matlab DWT数字水印多种攻击效果对比含Matlab源码 1134期

图像隐写基于matlab DWT+FFT+DCT水印攻击+提取含Matlab源码 2411期