💥1 概述
随着互联网的高速发展,社交网络服务越来越发达,人们通过社交网络服务分享图片、音频、视频等多媒体信息更加便捷,但同时也存在着一些隐患甚至是危害。例如图片等数字媒体内容在传输的过程中被恶意攻击者非法截取、窃听或篡改等,轻者造成了个人信息的泄露,重者引发严重的网络安全事故。为了满足人们对于安全性的需求,基于可逆数据隐藏的图像可逆视觉变换研究被提出。通过将图像视觉内容转换为任意参考图像的视觉内容,图像可逆视觉变换可以保护图像内容和隐私。此外,尽管相机技术不断完善,但在某些恶劣环境下所拍摄出来的照片视觉效果不佳,影响后续对照片的查看及处理。此类环境背景促进了研究学者们对基于可逆数据隐藏的图像可逆对比度增强算法的研究。图像可逆对比度增强可以增强图像不清晰部分的细节,并且增强图像在需要时可以被恢复回原始图像。本文将实现自动亮度对比度增强功能的可逆数据隐藏。
📚2 运行结果
部分代码:
function main %Image image=double(imread('Kodak images/Original/kodim01_org.png')); %Payload rng(1) %Presets randomness to ensure the results are reproducible payload_length=15000; %number of bits to be embedded payload=randi([0,1],payload_length,1); %% Embedding for maximum contrast iteration_max=1000; % default maximum iteration_max is 1000, you can increase it as much as you want, but it may take longer time max_contrast_bypass_mode=0; % 0 = embedes addtional synthetic bits after the specified payload has been embedded to maximize the contrast [rdh_image, ~, ~, ~,embedding_capacity_left]=mbp(image,payload,iteration_max,max_contrast_bypass_mode); if embedding_capacity_left < 0 disp('Failed embedding, try increasing iteration_max') else disp(['Can embed ' num2str(embedding_capacity_left) ' bits more (estimated)']) end %% Recovery check for maximum contrast case [payload_rec, re_image] = mbp_recovery(rdh_image); if isequal(re_image,image) disp('Original image recovered') else disp('Failed to recover the original image') end if isequal(payload_rec,payload) disp('Payload recovered') else disp('Failed to recover the payload') end %% Embedding only the payload => does not maximize the contrast iteration_max=1000; % default maximum iteration_max is 1000, you can increase it as much as you want, but it may take longer time max_contrast_bypass_mode=1; %1=terminates after specified payload has been embedded, does not achieve maximum contrast [rdh_image_non_max_contrast, ~, ~, ~,embedding_capacity_left_non_max_contrast]=mbp(image,payload,iteration_max,max_contrast_bypass_mode); if embedding_capacity_left_non_max_contrast ~= -1 disp('Failed embedding, try increasing iteration_max') else disp(['Successfully embedded ' num2str(payload_length) ' bits. Cannot determine how many more bits can be embedded since max_contrast_bypass_mode was 1. To determine maximum number of bits embeddable (estimated), run with max_contrast_bypass_mode =0']) end %% Recovery check for when only the specified payload has been embedded => does not maximize the contrast [payload_rec_non_max_contrast, re_image_non_max_contrast] = mbp_recovery(rdh_image_non_max_contrast); if isequal(re_image_non_max_contrast,image) disp('Original image recovered') else disp('Failed to recover the original image') end if isequal(payload_rec_non_max_contrast,payload) disp('Payload recovered') else disp('Failed to recover the payload') end %show the image close all figure(1) imshow(uint8(image)) figure(2) imshow(uint8(rdh_image)) figure(3) imshow(uint8(rdh_image_non_max_contrast)) end
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]吴汉舟. 可逆数据隐藏及调色板图像隐写技术研究[D].西南交通大学,2017.
[2]王森林. 可逆数据隐藏技术研究[D].兰州大学,2012.