Info
This question is closed. Reopen it to edit or answer.
I wrote one program. In that output, the pixels values are randomly change with little bit variation. please tell me the solution to this problem
4 views (last 30 days)
Show older comments
Dear Sir / Madam,
I wrote the code in this way.
clc
clear all
close all
val=[77 121 32 103 117 114 117 32 110 97 109 101 32 105 115 32 68 114 46 32 118 105 106 97 121 97 32 114 97 103 104 97 118 97 110 32 83 105 114];
a=imread('Chrysanthemum.jpg');
a=imresize(a,[512 512]);
wname='db2'
[ll,lh,hl,hh]=dwt2(a,wname);
for i=1:length(val)
hh(10,10+i)=val(i);
e(i)=hh(10,10+i);
end
b=idwt2(ll,lh,hl,hh,wname);
b=uint8(b);
imwrite(b,'processed_image.png');
b=imread('processed_image.png');
[ll2,lh2,hl2,hh2]=dwt2(b,wname);
for i=1:length(val)
f(i)=hh2(10,10+i);
f(i)=uint8(f(i));
end
isequal(e,f)
e
f
RESULT:
e =
Columns 1 through 19
77 121 32 103 117 114 117 32 110 97 109 101 32 105 115 32 68 114 46
Columns 20 through 38
32 118 105 106 97 121 97 32 114 97 103 104 97 118 97 110 32 83 105
Column 39
114
f =
Columns 1 through 19
77 121 32 103 118 114 117 32 110 97 108 101 33 105 115 32 68 115 46
Columns 18 through 38
32 118 105 106 98 121 96 32 114 97 103 105 97 118 98 110 33 83 104
Columns 39
113
In the above resultl, 'e' is the input values given to input image. 'f' is the extracted values from th eprocessed image. But the values are randomly change with little bit variation. i am expecting input values equal to output values.
if "wname=db10" then input and output values are equal (in this example only). But the result is not exactly equal if change the values or change the image
please tell me the solution to this problem. This solution is very helpful to me
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!