Why is the compressed Image White?
1 view (last 30 days)
Show older comments
Foday Jorh
on 11 Jan 2019
Answered: Image Analyst
on 11 Jan 2019
I working on watermarking scheme using the DWT domain. That's not even the problem, my problem is after decomposing the image into cA, CH, cV, cD, after achieving this i re-decomposed the cA into cA1, cH1, cV1, cD1. I took the cA1 compressed it to jpg using the imwrite function White image is showing. Below is my code:
clear ALL,
clc,
close ALL;
%% Facial image (cover image)
FacialIMGpath = 'C:\Users\foday\Documents\Thesis\originalImage\1-041.png';
host = imread(FacialIMGpath);
host=host(:,:,1);
% [rows, cols]=size(host);
figure (1);
subplot(1,3,1)
imshow(host,[]);
title('Original Image');
%% Adding the Haar wavelet to the host image
[host_LL,host_LH,host_HL,host_HH]=dwt2(host,'haar');
[host_LL1,host_LH1,host_HL1,host_HH1]=dwt2(host_LL,'haar');
% [rows, cols]= size(host_LL);
subplot(1,3,2)
imshow((host_LL1),[]);
title('MULTILEVEL DECOM IMG');
%% JPEG COMPRESSION
imwrite(host_LL1, 'compressedimage.jpg', 'jpg', 'Quality', 90);
JPeg_attack =imread('C:\Users\foday\Documents\Thesis\double watermark\LL\LL multi_level\compressedimage.jpg');
[rows, cols]= size(JPeg_attack);
subplot(1,3,3)
imshow(uint8(JPeg_attack),[]);
Kindly need your assistance
0 Comments
Accepted Answer
Image Analyst
on 11 Jan 2019
I see you're using [] in imshow, so that's good - it should be able to handle floating point images.
I think the problem may be in
imwrite(host_LL1, 'compressedimage.jpg', 'jpg', 'Quality', 90);
What is the class of host_LL1? Is it uint8 or uint16 (should be no problem)?
Or is it double -- if so, that is probably the problem.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!