├── BinaryTree_Mark.m ├── Binary_Decimalism.m ├── Decimalism_Binary.m ├── Encrypt_Data.m ├── Encrypt_Embed.m ├── Encrypt_Image.m ├── Extract_Data.m ├── Main.m ├── Main_BOSSbase.m ├── Main_BOWS2OrigEp3.m ├── Main_UCID.m ├── PSNR.m ├── Predictor_Error.m ├── README.md ├── Recover_Image.m ├── SSIM.m ├── bpp_BOSSbase.mat ├── bpp_BOWS2OrigEp3.mat ├── bpp_UCID.mat ├── num_BOSSbase.mat ├── num_BOWS2OrigEp3.mat ├── num_UCID.mat ├── readme.txt └── 测试图像 ├── Airplane.tiff ├── Baboon.tiff ├── Jetplane.tiff ├── Lena.tiff ├── Man.tiff └── Tiffany.tiff /BinaryTree_Mark.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/BinaryTree_Mark.m -------------------------------------------------------------------------------- /Binary_Decimalism.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Binary_Decimalism.m -------------------------------------------------------------------------------- /Decimalism_Binary.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Decimalism_Binary.m -------------------------------------------------------------------------------- /Encrypt_Data.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Encrypt_Data.m -------------------------------------------------------------------------------- /Encrypt_Embed.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Encrypt_Embed.m -------------------------------------------------------------------------------- /Encrypt_Image.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Encrypt_Image.m -------------------------------------------------------------------------------- /Extract_Data.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Extract_Data.m -------------------------------------------------------------------------------- /Main.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Main.m -------------------------------------------------------------------------------- /Main_BOSSbase.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Main_BOSSbase.m -------------------------------------------------------------------------------- /Main_BOWS2OrigEp3.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Main_BOWS2OrigEp3.m -------------------------------------------------------------------------------- /Main_UCID.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Main_UCID.m -------------------------------------------------------------------------------- /PSNR.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/PSNR.m -------------------------------------------------------------------------------- /Predictor_Error.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Predictor_Error.m -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # An Improved Reversible Data Hiding in Encrypted Images Using Parametric Binary Tree Labeling 2 | 3 | This code is the implementation of the paper "An Improved Reversible Data Hiding in Encrypted Images Using Parametric Binary Tree Labeling". 4 | 5 | [Paper Link](https://ieeexplore.ieee.org/abstract/document/8896058) 6 | 7 | ## Abstract 8 | 9 | This work proposes an improved reversible data hiding scheme in encrypted images using parametric binary tree labeling(IPBTL-RDHEI), which takes advantage of the spatial correlation in the entire original image but not in small image blocks to reserve room for hiding data. Then the original image is encrypted with an encryption key and the parametric binary tree is used to label encrypted pixels into two different categories. Finally, one of the two categories of encrypted pixels can embed secret information by bit replacement. According to the experimental results, compared with several state-of-the-art methods, the proposed IPBTL-RDHEI method achieves higher embedding rate and outperforms the competitors. Due to the reversibility of IPBTL-RDHEI, the original plaintext image and the secret information can be restored and extracted losslessly and separately. 10 | 11 | ## 摘要 12 | 这项工作提出了一种改进的使用参数二叉树标记(IPBTL-RDHEI)的加密图像中可逆数据隐藏方案,该方案利用了整个原始图像而不是小图像块中的空间相关性来为隐藏数据保留空间。 然后,使用加密密钥对原始图像进行加密,然后使用参数二叉树将加密后的像素标记为两个不同的类别。 最后,两类加密像素之一可以通过位替换嵌入秘密信息。 根据实验结果,与几种最先进的方法相比,提出的IPBTL-RDHEI方法具有更高的嵌入率,并且性能优于竞争对手。 由于IPBTL-RDHEI具有可逆性,因此可以无损且独立地恢复和提取原始明文图像和秘密信息。 13 | 14 | 15 | ## How to cite our paper 16 | 17 | @article{wu2019improved, 18 | title={An improved reversible data hiding in encrypted images using parametric binary tree labeling}, 19 | author={Wu, Youqing and Xiang, Youzhi and Guo, Yutang and Tang, Jin and Yin, Zhaoxia}, 20 | journal={IEEE Transactions on Multimedia}, 21 | year={2019}, 22 | publisher={IEEE} 23 | } 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Recover_Image.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/Recover_Image.m -------------------------------------------------------------------------------- /SSIM.m: -------------------------------------------------------------------------------- 1 | function [mssim, ssim_map] = SSIM(img1, img2, K, window, L) 2 | 3 | % ======================================================================== 4 | % SSIM Index with automatic downsampling, Version 1.0 5 | % Copyright(c) 2009 Zhou Wang 6 | % All Rights Reserved. 7 | % 8 | % ---------------------------------------------------------------------- 9 | % Permission to use, copy, or modify this software and its documentation 10 | % for educational and research purposes only and without fee is hereby 11 | % granted, provided that this copyright notice and the original authors' 12 | % names appear on all copies and supporting documentation. This program 13 | % shall not be used, rewritten, or adapted as the basis of a commercial 14 | % software or hardware product without first obtaining permission of the 15 | % authors. The authors make no representations about the suitability of 16 | % this software for any purpose. It is provided "as is" without express 17 | % or implied warranty. 18 | %---------------------------------------------------------------------- 19 | % 20 | % This is an implementation of the algorithm for calculating the 21 | % Structural SIMilarity (SSIM) index between two images 22 | % 23 | % Please refer to the following paper and the website with suggested usage 24 | % 25 | % Z. Wang, A. C. Bovik, H. R. Sheikh, and E. P. Simoncelli, "Image 26 | % quality assessment: From error visibility to structural similarity," 27 | % IEEE Transactios on Image Processing, vol. 13, no. 4, pp. 600-612, 28 | % Apr. 2004. 29 | % 30 | % http://www.ece.uwaterloo.ca/~z70wang/research/ssim/ 31 | % 32 | % Note: This program is different from ssim_index.m, where no automatic 33 | % downsampling is performed. (downsampling was done in the above paper 34 | % and was described as suggested usage in the above website.) 35 | % 36 | % Kindly report any suggestions or corrections to zhouwang@ieee.org 37 | % 38 | %---------------------------------------------------------------------- 39 | % 40 | %Input : (1) img1: the first image being compared 41 | % (2) img2: the second image being compared 42 | % (3) K: constants in the SSIM index formula (see the above 43 | % reference). defualt value: K = [0.01 0.03] 44 | % (4) window: local window for statistics (see the above 45 | % reference). default widnow is Gaussian given by 46 | % window = fspecial('gaussian', 11, 1.5); 47 | % (5) L: dynamic range of the images. default: L = 255 48 | % 49 | %Output: (1) mssim: the mean SSIM index value between 2 images. 50 | % If one of the images being compared is regarded as 51 | % perfect quality, then mssim can be considered as the 52 | % quality measure of the other image. 53 | % If img1 = img2, then mssim = 1. 54 | % (2) ssim_map: the SSIM index map of the test image. The map 55 | % has a smaller size than the input images. The actual size 56 | % depends on the window size and the downsampling factor. 57 | % 58 | %Basic Usage: 59 | % Given 2 test images img1 and img2, whose dynamic range is 0-255 60 | % 61 | % [mssim, ssim_map] = ssim(img1, img2); 62 | % 63 | %Advanced Usage: 64 | % User defined parameters. For example 65 | % 66 | % K = [0.05 0.05]; 67 | % window = ones(8); 68 | % L = 100; 69 | % [mssim, ssim_map] = ssim(img1, img2, K, window, L); 70 | % 71 | %Visualize the results: 72 | % 73 | % mssim %Gives the mssim value 74 | % imshow(max(0, ssim_map).^4) %Shows the SSIM index map 75 | %======================================================================== 76 | 77 | 78 | if (nargin < 2 | nargin > 5) 79 | ssim_index = -Inf; 80 | ssim_map = -Inf; 81 | return; 82 | end 83 | 84 | if (size(img1) ~= size(img2)) 85 | ssim_index = -Inf; 86 | ssim_map = -Inf; 87 | return; 88 | end 89 | 90 | [M N] = size(img1); 91 | 92 | if (nargin == 2) 93 | if ((M < 11) | (N < 11)) 94 | ssim_index = -Inf; 95 | ssim_map = -Inf; 96 | return 97 | end 98 | window = fspecial('gaussian', 11, 1.5); % 99 | K(1) = 0.01; % default settings 100 | K(2) = 0.03; % 101 | L = 255; % 102 | end 103 | 104 | if (nargin == 3) 105 | if ((M < 11) | (N < 11)) 106 | ssim_index = -Inf; 107 | ssim_map = -Inf; 108 | return 109 | end 110 | window = fspecial('gaussian', 11, 1.5); 111 | L = 255; 112 | if (length(K) == 2) 113 | if (K(1) < 0 | K(2) < 0) 114 | ssim_index = -Inf; 115 | ssim_map = -Inf; 116 | return; 117 | end 118 | else 119 | ssim_index = -Inf; 120 | ssim_map = -Inf; 121 | return; 122 | end 123 | end 124 | 125 | if (nargin == 4) 126 | [H W] = size(window); 127 | if ((H*W) < 4 | (H > M) | (W > N)) 128 | ssim_index = -Inf; 129 | ssim_map = -Inf; 130 | return 131 | end 132 | L = 255; 133 | if (length(K) == 2) 134 | if (K(1) < 0 | K(2) < 0) 135 | ssim_index = -Inf; 136 | ssim_map = -Inf; 137 | return; 138 | end 139 | else 140 | ssim_index = -Inf; 141 | ssim_map = -Inf; 142 | return; 143 | end 144 | end 145 | 146 | if (nargin == 5) 147 | [H W] = size(window); 148 | if ((H*W) < 4 | (H > M) | (W > N)) 149 | ssim_index = -Inf; 150 | ssim_map = -Inf; 151 | return 152 | end 153 | if (length(K) == 2) 154 | if (K(1) < 0 | K(2) < 0) 155 | ssim_index = -Inf; 156 | ssim_map = -Inf; 157 | return; 158 | end 159 | else 160 | ssim_index = -Inf; 161 | ssim_map = -Inf; 162 | return; 163 | end 164 | end 165 | 166 | 167 | img1 = double(img1); 168 | img2 = double(img2); 169 | 170 | % automatic downsampling 171 | f = max(1,round(min(M,N)/256)); 172 | %downsampling by f 173 | %use a simple low-pass filter 174 | if(f>1) 175 | lpf = ones(f,f); 176 | lpf = lpf/sum(lpf(:)); 177 | img1 = imfilter(img1,lpf,'symmetric','same'); 178 | img2 = imfilter(img2,lpf,'symmetric','same'); 179 | 180 | img1 = img1(1:f:end,1:f:end); 181 | img2 = img2(1:f:end,1:f:end); 182 | end 183 | 184 | C1 = (K(1)*L)^2; 185 | C2 = (K(2)*L)^2; 186 | window = window/sum(sum(window)); 187 | 188 | mu1 = filter2(window, img1, 'valid'); 189 | mu2 = filter2(window, img2, 'valid'); 190 | mu1_sq = mu1.*mu1; 191 | mu2_sq = mu2.*mu2; 192 | mu1_mu2 = mu1.*mu2; 193 | sigma1_sq = filter2(window, img1.*img1, 'valid') - mu1_sq; 194 | sigma2_sq = filter2(window, img2.*img2, 'valid') - mu2_sq; 195 | sigma12 = filter2(window, img1.*img2, 'valid') - mu1_mu2; 196 | 197 | if (C1 > 0 & C2 > 0) 198 | ssim_map = ((2*mu1_mu2 + C1).*(2*sigma12 + C2))./((mu1_sq + mu2_sq + C1).*(sigma1_sq + sigma2_sq + C2)); 199 | else 200 | numerator1 = 2*mu1_mu2 + C1; 201 | numerator2 = 2*sigma12 + C2; 202 | denominator1 = mu1_sq + mu2_sq + C1; 203 | denominator2 = sigma1_sq + sigma2_sq + C2; 204 | ssim_map = ones(size(mu1)); 205 | index = (denominator1.*denominator2 > 0); 206 | ssim_map(index) = (numerator1(index).*numerator2(index))./(denominator1(index).*denominator2(index)); 207 | index = (denominator1 ~= 0) & (denominator2 == 0); 208 | ssim_map(index) = numerator1(index)./denominator1(index); 209 | end 210 | 211 | mssim = mean2(ssim_map); 212 | 213 | return -------------------------------------------------------------------------------- /bpp_BOSSbase.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/bpp_BOSSbase.mat -------------------------------------------------------------------------------- /bpp_BOWS2OrigEp3.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/bpp_BOWS2OrigEp3.mat -------------------------------------------------------------------------------- /bpp_UCID.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/bpp_UCID.mat -------------------------------------------------------------------------------- /num_BOSSbase.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/num_BOSSbase.mat -------------------------------------------------------------------------------- /num_BOWS2OrigEp3.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/num_BOWS2OrigEp3.mat -------------------------------------------------------------------------------- /num_UCID.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/num_UCID.mat -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/readme.txt -------------------------------------------------------------------------------- /测试图像/Airplane.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/测试图像/Airplane.tiff -------------------------------------------------------------------------------- /测试图像/Baboon.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/测试图像/Baboon.tiff -------------------------------------------------------------------------------- /测试图像/Jetplane.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/测试图像/Jetplane.tiff -------------------------------------------------------------------------------- /测试图像/Lena.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/测试图像/Lena.tiff -------------------------------------------------------------------------------- /测试图像/Man.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/测试图像/Man.tiff -------------------------------------------------------------------------------- /测试图像/Tiffany.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edu-yinzhaoxia/An-Improved-Reversible-Data-Hiding-in-Encrypted-Images-using-Parametric-Binary-Tree-Labeling/ce1f68b72cc7a54d2745768ee66e7429346e169f/测试图像/Tiffany.tiff --------------------------------------------------------------------------------